summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorMike McGreevy <mamcgree@hdfgroup.org>2009-10-15 17:08:41 (GMT)
committerMike McGreevy <mamcgree@hdfgroup.org>2009-10-15 17:08:41 (GMT)
commitdd4360dccfda32f477192bd4a4ee22ee24585cf0 (patch)
tree1a6d58a5ddaa88dfdac2e558e0ea65f38da73581 /configure.in
parent2a2a49f42280220ad7cf2c45b1e5103d3b72146a (diff)
downloadhdf5-dd4360dccfda32f477192bd4a4ee22ee24585cf0.zip
hdf5-dd4360dccfda32f477192bd4a4ee22ee24585cf0.tar.gz
hdf5-dd4360dccfda32f477192bd4a4ee22ee24585cf0.tar.bz2
[svn-r17645] Purpose:
Merge from Trunk Description: Merging all of my CFLAGS-related changes from trunk to 1.8 This includes revision #s: 17616, 17625, 17627, 17639, and 17643. Tested: h5committest and some additional checks on our FreeBSD as well as NCSA's machines.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in125
1 files changed, 92 insertions, 33 deletions
diff --git a/configure.in b/configure.in
index 4210458..21037c8 100644
--- a/configure.in
+++ b/configure.in
@@ -94,11 +94,34 @@ AC_SUBST([H5_CPPFLAGS])
AC_SUBST([H5_FCFLAGS])
AC_SUBST([H5_CXXFLAGS])
+dnl AM_CFLAGS (and company) are for CFLAGS that should be used on HDF5,
+dnl and WILL be exported to h5cc (or h5fc, etc) if set by configure.
+AC_SUBST([AM_CFLAGS])
+AC_SUBST([AM_FCFLAGS])
+AC_SUBST([AM_CXXFLAGS])
+AC_SUBST([AM_CPPFLAGS])
+AC_SUBST([AM_LDFLAGS])
+
dnl Make sure flags are set to something (otherwise macros may set them later).
+AM_CFLAGS="${AM_CFLAGS}"
+AM_CXXFLAGS="${AM_CXXFLAGS}"
+AM_FCFLAGS="${AM_FCFLAGS}"
+AM_CPPFLAGS="${AM_CPPFLAGS}"
+AM_LDFLAGS="${AM_LDFLAGS}"
CFLAGS="${CFLAGS}"
-CPPFLAGS="${CPPFLAGS}"
CXXFLAGS="${CXXFLAGS}"
FCFLAGS="${FCFLAGS}"
+CPPFLAGS="${CPPFLAGS}"
+LDFLAGS="${LDFLAGS}"
+
+dnl Configure may need to alter any of the *FLAGS variables in order for
+dnl various checks to work correctly. Save the user's value here so it
+dnl can be restored once all configure checks are complete.
+saved_user_CFLAGS="$CFLAGS"
+saved_user_CXXFLAGS="$CXXFLAGS"
+saved_user_FCFLAGS="$FCFLAGS"
+saved_user_LDFLAGS="$LDFLAGS"
+saved_user_CPPFLAGS="$CPPFLAGS"
dnl Different compilers may need default libraries. They are specified in
dnl the config/* files, so we put this statement here so that it'll be
@@ -342,7 +365,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then
dnl --------------------------------------------------------------------
dnl General Fortran flags
dnl
- FCFLAGS="${FCFLAGS} ${FFLAGS}"
+ AM_FCFLAGS="${AM_FCFLAGS} ${AM_FFLAGS}"
dnl --------------------------------------------------------------------
dnl Fortran source extention
@@ -374,8 +397,8 @@ if test "X$HDF_FORTRAN" = "Xyes"; then
dnl --------------------------------------------------------------------
dnl See if the compiler will support the "-I." option
dnl
-dnl FCFLAGS_saved=$FCFLAGS
-dnl FCFLAGS="${FCFLAGS} -I."
+dnl AM_FCFLAGS_saved=$AM_FCFLAGS
+dnl AM_FCFLAGS="${AM_FCFLAGS} -I."
dnl AC_MSG_CHECKING(if compiler supports -I. option)
dnl AC_TRY_FCOMPILE([
@@ -383,7 +406,7 @@ dnl program conftest
dnl end
dnl ], AC_MSG_RESULT(yes),
dnl AC_MSG_RESULT(no)
-dnl FCFLAGS="$FCFLAGS_saved")
+dnl AM_FCFLAGS="$AM_FCFLAGS_saved")
dnl --------------------------------------------------------------------
dnl See if the fortran compiler supports the intrinsic function "SIZEOF"
@@ -471,7 +494,7 @@ int main(void) { return 0; }
echo no
], [
echo yes
- CXXFLAGS="${CXXFLAGS} -DOLD_HEADER_FILENAME"
+ AM_CXXFLAGS="${AM_CXXFLAGS} -DOLD_HEADER_FILENAME"
])
AC_MSG_CHECKING([if $CXX can handle namespaces])
@@ -489,7 +512,7 @@ int main(void) {
echo yes
], [
echo no
- CXXFLAGS="${CXXFLAGS} -DH5_NO_NAMESPACE"
+ AM_CXXFLAGS="${AM_CXXFLAGS} -DH5_NO_NAMESPACE"
])
AC_MSG_CHECKING([if $CXX supports std])
@@ -506,7 +529,7 @@ int main(void) {
echo yes
], [
echo no
- CXXFLAGS="${CXXFLAGS} -DH5_NO_STD"
+ AM_CXXFLAGS="${AM_CXXFLAGS} -DH5_NO_STD"
])
AC_MSG_CHECKING([if $CXX supports bool types])
@@ -519,7 +542,7 @@ int main(void) {
echo yes
], [
echo no
- CXXFLAGS="${CXXFLAGS} -DBOOL_NOTDEFINED"
+ AM_CXXFLAGS="${AM_CXXFLAGS} -DBOOL_NOTDEFINED"
])
AC_MSG_CHECKING([if $CXX has offsetof extension])
@@ -556,7 +579,7 @@ int main(void) {
echo yes
], [
echo no
- CXXFLAGS="${CXXFLAGS} -DNO_STATIC_CAST"
+ AM_CXXFLAGS="${AM_CXXFLAGS} -DNO_STATIC_CAST"
])
else
echo "no"
@@ -874,7 +897,7 @@ if test "X${HDF_FORTRAN}" = "Xyes"; then
H5_FORTRAN_SHARED="no"
else
dnl echo 'adding fortran compiler flag needed for building shared libraries'
- FCFLAGS="${FCFLAGS} -fPIC"
+ AM_FCFLAGS="${AM_FCFLAGS} -fPIC"
fi
fi
if (${FC} +version 2>&1 | grep '^HP F90') > /dev/null; then
@@ -1276,7 +1299,7 @@ case "$host_cpu-$host_vendor-$host_os" in
AC_MSG_CHECKING([for large file support mode on Linux])
if test "X$LINUX_LFS" = "Xyes"; then
AC_MSG_RESULT([enabled])
- CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $CPPFLAGS"
+ AM_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $AM_CPPFLAGS"
else
AC_MSG_RESULT([disabled])
fi
@@ -1284,16 +1307,20 @@ case "$host_cpu-$host_vendor-$host_os" in
dnl Add POSIX support on Linux systems, so <features.h> defines
dnl __USE_POSIX, which is required to get the prototype for fdopen
dnl defined correctly in <stdio.h>
- CPPFLAGS="-D_POSIX_SOURCE $CPPFLAGS"
+ AM_CPPFLAGS="-D_POSIX_SOURCE $AM_CPPFLAGS"
dnl Also add BSD support on Linux systems, so <features.h> defines
dnl __USE_BSD, which is required to get the prototype for strdup
dnl defined correctly in <string.h> and snprintf & vsnprintf defined
dnl correctly in <stdio.h>
- CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS"
+ AM_CPPFLAGS="-D_BSD_SOURCE $AM_CPPFLAGS"
;;
esac
+dnl Need to add AM_CPPFLAGS into CPPFLAGS to make them visible for configure checks.
+dnl Note: CPPFLAGS will be restored by the end of configure.
+CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS"
+
AC_TRY_COMPILE([#include <sys/types.h>],
[off64_t n = 0;],
[AC_CHECK_FUNCS([lseek64 fseek64 ftruncate64])],
@@ -1461,19 +1488,23 @@ case $withval in
fi
saved_CPPFLAGS="$CPPFLAGS"
+ saved_AM_CPPFLAGS="$AM_CPPFLAGS"
saved_LDFLAGS="$LDFLAGS"
+ saved_AM_LDFLAGS="$AM_LDFLAGS"
if test -n "$dmalloc_inc"; then
CPPFLAGS="$CPPFLAGS -I$dmalloc_inc"
+ AM_CPPFLAGS="$AM_CPPFLAGS -I$dmalloc_inc"
fi
- AC_CHECK_HEADERS(dmalloc.h,, CPPFLAGS="$saved_CPPFLAGS")
+ AC_CHECK_HEADERS(dmalloc.h,,CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS")
if test -n "$dmalloc_lib"; then
LDFLAGS="$LDFLAGS -L$dmalloc_lib"
+ AM_LDFLAGS="$AM_LDFLAGS -L$dmalloc_lib"
fi
- AC_CHECK_LIB(dmalloc, dmalloc_shutdown,, LDFLAGS="$saved_LDFLAGS"; unset HAVE_DMALLOC)
+ AC_CHECK_LIB(dmalloc, dmalloc_shutdown,, LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_DMALLOC)
if test -z "$HAVE_DMALLOC" -a -n "$HDF5_CONFIG_ABORT"; then
AC_MSG_ERROR(couldn't find dmalloc library)
@@ -1535,22 +1566,26 @@ case $withval in
fi
saved_CPPFLAGS="$CPPFLAGS"
+ saved_AM_CPPFLAGS="$AM_CPPFLAGS"
saved_LDFLAGS="$LDFLAGS"
+ saved_AM_LDFLAGS="$AM_LDFLAGS"
if test -n "$zlib_inc"; then
CPPFLAGS="$CPPFLAGS -I$zlib_inc"
+ AM_CPPFLAGS="$AM_CPPFLAGS -I$zlib_inc"
fi
AC_CHECK_HEADERS([zlib.h],
[HAVE_ZLIB_H="yes"],
- [CPPFLAGS="$saved_CPPFLAGS"])
+ [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"])
if test -n "$zlib_lib"; then
LDFLAGS="$LDFLAGS -L$zlib_lib"
+ AM_LDFLAGS="$AM_LDFLAGS -L$zlib_lib"
fi
AC_CHECK_LIB([z], [compress2],,
- [LDFLAGS="$saved_LDFLAGS"; unset HAVE_ZLIB])
+ [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_ZLIB])
AC_CHECK_FUNC([compress2], [HAVE_COMPRESS2="yes"])
if test -z "$HAVE_ZLIB" -a -n "$HDF5_CONFIG_ABORT"; then
@@ -1624,23 +1659,27 @@ case $withval in
fi
saved_CPPFLAGS="$CPPFLAGS"
+ saved_AM_CPPFLAGS="$AM_CPPFLAGS"
saved_LDFLAGS="$LDFLAGS"
+ saved_AM_LDFLAGS="$AM_LDFLAGS"
if test -n "$szlib_inc"; then
CPPFLAGS="$CPPFLAGS -I$szlib_inc"
+ AM_CPPFLAGS="$AM_CPPFLAGS -I$szlib_inc"
fi
AC_CHECK_HEADERS([szlib.h],
[HAVE_SZLIB_H="yes"],
- [CPPFLAGS="$saved_CPPFLAGS"])
-
+ [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"])
+
if test -n "$szlib_lib"; then
LDFLAGS="$LDFLAGS -L$szlib_lib"
+ AM_LDFLAGS="$AM_LDFLAGS -L$szlib_lib"
fi
AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],,
- [LDFLAGS="$saved_LDFLAGS"; unset HAVE_SZLIB])
-
+ [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_SZLIB])
+
if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then
AC_MSG_ERROR([couldn't find szlib library])
fi
@@ -1756,17 +1795,22 @@ case "$withval" in
if test -n "$pthread_inc"; then
saved_CPPFLAGS="$CPPFLAGS"
+ saved_AM_CPPFLAGS="$AM_CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$pthread_inc"
- AC_CHECK_HEADERS([pthread.h],, [CPPFLAGS="$saved_CPPFLAGS"; unset PTHREAD])
+ AM_CPPFLAGS="$AM_CPPFLAGS -I$pthread_inc"
+ AC_CHECK_HEADERS([pthread.h],, [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"; unset PTHREAD])
else
AC_CHECK_HEADERS([pthread.h],, [unset PTHREAD])
fi
if test -n "$pthread_lib"; then
saved_LDFLAGS="$LDFLAGS"
+ saved_AM_LDFLAGS="$AM_LDFLAGS"
LDFLAGS="$LDFLAGS -L$pthread_lib"
+ AM_LDFLAGS="$AM_LDFLAGS -L$pthread_lib"
AC_CHECK_LIB([pthread], [pthread_create],,
- [LDFLAGS="$saved_LDFLAGS"; unset PTHREAD])
+ [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset PTHREAD])
+
else
AC_CHECK_LIB([pthread], [pthread_create],, [unset PTHREAD])
fi
@@ -2082,7 +2126,7 @@ dnl LD_LIBRARY_PATH along with LDFLAGS or do it with the AC_TRY_RUN macro.
dnl
AC_MSG_CHECKING([how to print long long])
AC_CACHE_VAL([hdf5_cv_printf_ll],
-LD_LIBRARY_PATH="$LD_LIBRARY_PATH`echo $LDFLAGS | sed -e 's/-L/:/g' -e 's/ //g'`"
+LD_LIBRARY_PATH="$LD_LIBRARY_PATH`echo $AM_LDFLAGS $LDFLAGS | sed -e 's/-L/:/g' -e 's/ //g'`"
export LD_LIBRARY_PATH
for hdf5_cv_printf_ll in l ll L q unknown; do
@@ -2622,19 +2666,24 @@ if test -n "$PARALLEL"; then
if test -n "$mpe_inc"; then
saved_CPPFLAGS="$CPPFLAGS"
+ saved_AM_CPPFLAGS="$AM_CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$mpe_inc"
- AC_CHECK_HEADERS([mpe.h],, [CPPFLAGS="$saved_CPPFLAGS"; unset MPE])
+ AM_CPPFLAGS="$AM_CPPFLAGS -I$mpe_inc"
+ AC_CHECK_HEADERS([mpe.h],, [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"; unset MPE])
else
AC_CHECK_HEADERS([mpe.h],, [unset MPE])
fi
if test -n "$mpe_lib"; then
saved_LDFLAGS="$LDFLAGS"
+ saved_AM_LDFLAGS="$AM_LDFLAGS"
LDFLAGS="$LDFLAGS -L$mpe_lib"
+ AM_LDFLAGS="$AM_LDFLAGS -L$mpe_lib"
AC_CHECK_LIB([mpe], [MPE_Init_log],,
- [LDFLAGS="$saved_LDFLAGS"; unset MPE])
+ [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset MPE])
AC_CHECK_LIB([lmpe], [CLOG_Init],,
- [LDFLAGS="$saved_LDFLAGS"; unset MPE])
+ [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset MPE])
+
else
AC_CHECK_LIB([mpe], [MPE_Init_log],, [unset MPE])
AC_CHECK_LIB([lmpe], [CLOG_Init],, [unset MPE])
@@ -3714,8 +3763,8 @@ dnl libraries.
dnl
AC_SUBST([DYNAMIC_DIRS]) DYNAMIC_DIRS=""
-if test -n "$LDFLAGS"; then
- for d in $LDFLAGS ; do
+if test -n "$AM_LDFLAGS $LDFLAGS"; then
+ for d in $AM_LDFLAGS $LDFLAGS ; do
case "$d" in
-L*)
d="`echo $d | sed -e 's/-L//g'`"
@@ -3732,9 +3781,9 @@ if test -n "$LDFLAGS"; then
done
fi
-if test -n "$CPPFLAGS"; then
+if test -n "$AM_CPPFLAGS"; then
TEMP_CPPFLAGS=""
- for d in $CPPFLAGS ; do
+ for d in $AM_CPPFLAGS ; do
case "$d" in
-I.*)
dnl If the path isn't absolute, make it so by prepending
@@ -3745,7 +3794,7 @@ if test -n "$CPPFLAGS"; then
esac
TEMP_CPPFLAGS="$d $TEMP_CPPFLAGS"
done
- CPPFLAGS=$TEMP_CPPFLAGS
+ AM_CPPFLAGS=$TEMP_CPPFLAGS
fi
dnl ----------------------------------------------------------------------
@@ -3945,6 +3994,16 @@ AC_RUN_IFELSE([
AC_MSG_RESULT([unknown, assuming yes])
])
+
+dnl ------------------------------------
+dnl Restore user's CPPFLAGS and LDFLAGS.
+CPPFLAGS="$saved_user_CPPFLAGS"
+LDFLAGS="$saved_user_LDFLAGS"
+FCFLAGS="$saved_user_FCFLAGS"
+CFLAGS="$saved_user_CFLAGS"
+CXXFLAGS="$saved_user_CXXFLAGS"
+
+
dnl ----------------------------------------------------------------------
dnl Create automake conditionals to tell automake makefiles which directories
dnl need to be compiled