From b7e61c869be9ccfa0e65c7abec702ee422a84c7a Mon Sep 17 00:00:00 2001 From: Mike McGreevy Date: Sun, 18 Oct 2009 22:05:25 -0500 Subject: [svn-r17675] Purpose: Configure Cleanup Description: Make all AM_CFLAGS visible in CFLAGS during configure so all checks have full visibility of any set flags. Tested: h5committest --- configure | 75 +++++++++++++++++++++++++++++++++++------------------------- configure.in | 29 ++++++++++++++++++----- 2 files changed, 67 insertions(+), 37 deletions(-) diff --git a/configure b/configure index a9c00d9..c4b8efd 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 17663 2009-10-16 20:16:00Z mamcgree . +# From configure.in Id: configure.in 17670 2009-10-18 16:40:34Z lrknox . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.64 for HDF5 1.9.50. # @@ -4050,6 +4050,12 @@ $as_echo "no" >&6; } test "$hname_tmp" = "$hname" && break done +CFLAGS="${AM_CFLAGS} ${CFLAGS}" +FCFLAGS="${AM_FCFLAGS} ${FCFLAGS}" +CXXFLAGS="${AM_CXXFLAGS} ${CXXFLAGS}" +CPPFLAGS="${AM_CPPFLAGS} ${CPPFLAGS}" +LDFLAGS="${AM_LDFLAGS} ${LDFLAGS}" + if test -z "${enable_dependency_tracking}"; then enable_dependency_tracking="yes" fi @@ -5039,7 +5045,8 @@ if test "X$HDF_FORTRAN" = "Xyes"; then - AM_FCFLAGS="${AM_FCFLAGS} ${AM_FFLAGS}" + AM_FCFLAGS="${AM_FCFLAGS} ${FFLAGS}" + FCFLAGS="${FCFLAGS} ${FFLAGS}" ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' @@ -6950,6 +6957,7 @@ if ac_fn_cxx_try_run "$LINENO"; then : else echo yes + CXXFLAGS="${CXXFLAGS} -DOLD_HEADER_FILENAME" AM_CXXFLAGS="${AM_CXXFLAGS} -DOLD_HEADER_FILENAME" fi @@ -6987,6 +6995,7 @@ if ac_fn_cxx_try_run "$LINENO"; then : else echo no + CXXFLAGS="${CXXFLAGS} -DH5_NO_NAMESPACE" AM_CXXFLAGS="${AM_CXXFLAGS} -DH5_NO_NAMESPACE" fi @@ -7023,6 +7032,7 @@ if ac_fn_cxx_try_run "$LINENO"; then : else echo no + CXXFLAGS="${CXXFLAGS} -DH5_NO_STD" AM_CXXFLAGS="${AM_CXXFLAGS} -DH5_NO_STD" fi @@ -7055,6 +7065,7 @@ if ac_fn_cxx_try_run "$LINENO"; then : else echo no + CXXFLAGS="${CXXFLAGS} -DBOOL_NOTDEFINED" AM_CXXFLAGS="${AM_CXXFLAGS} -DBOOL_NOTDEFINED" fi @@ -7137,6 +7148,7 @@ if ac_fn_cxx_try_run "$LINENO"; then : else echo no + CXXFLAGS="${CXXFLAGS} -DNO_STATIC_CAST" AM_CXXFLAGS="${AM_CXXFLAGS} -DNO_STATIC_CAST" fi @@ -7525,6 +7537,7 @@ if test "X${HDF_FORTRAN}" = "Xyes"; then if (${FC} -v 2>&1 | grep '^Version 8.') > /dev/null; then H5_FORTRAN_SHARED="no" else + FCFLAGS="${FCFLAGS} -fPIC" AM_FCFLAGS="${AM_FCFLAGS} -fPIC" fi fi @@ -8208,13 +8221,13 @@ if test "${lt_cv_nm_interface+set}" = set; then : else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:8211: $ac_compile\"" >&5) + (eval echo "\"\$as_me:8224: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:8214: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:8227: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:8217: output\"" >&5) + (eval echo "\"\$as_me:8230: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -9419,7 +9432,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 9422 "configure"' > conftest.$ac_ext + echo '#line 9435 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -11738,11 +11751,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11741: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11754: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11745: \$? = $ac_status" >&5 + echo "$as_me:11758: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12077,11 +12090,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12080: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12093: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12084: \$? = $ac_status" >&5 + echo "$as_me:12097: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12182,11 +12195,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12185: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12198: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12189: \$? = $ac_status" >&5 + echo "$as_me:12202: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12237,11 +12250,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12240: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12253: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12244: \$? = $ac_status" >&5 + echo "$as_me:12257: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14668,7 +14681,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 14671 "configure" +#line 14684 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14764,7 +14777,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 14767 "configure" +#line 14780 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16736,11 +16749,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16739: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16752: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16743: \$? = $ac_status" >&5 + echo "$as_me:16756: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16835,11 +16848,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16838: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16851: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16842: \$? = $ac_status" >&5 + echo "$as_me:16855: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16887,11 +16900,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16890: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16903: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16894: \$? = $ac_status" >&5 + echo "$as_me:16907: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -18404,11 +18417,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18407: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18420: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18411: \$? = $ac_status" >&5 + echo "$as_me:18424: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -18503,11 +18516,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18506: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18519: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18510: \$? = $ac_status" >&5 + echo "$as_me:18523: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -18555,11 +18568,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18558: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18571: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18562: \$? = $ac_status" >&5 + echo "$as_me:18575: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -28175,11 +28188,11 @@ fi -CPPFLAGS="$saved_user_CPPFLAGS" -LDFLAGS="$saved_user_LDFLAGS" -FCFLAGS="$saved_user_FCFLAGS" CFLAGS="$saved_user_CFLAGS" +FCFLAGS="$saved_user_FCFLAGS" CXXFLAGS="$saved_user_CXXFLAGS" +CPPFLAGS="$saved_user_CPPFLAGS" +LDFLAGS="$saved_user_LDFLAGS" diff --git a/configure.in b/configure.in index f8bc091..d5066ea 100644 --- a/configure.in +++ b/configure.in @@ -317,6 +317,16 @@ while test -n "$hname"; do done dnl ---------------------------------------------------------------------- +dnl Some built-in configure checks can only see CFLAGS (not AM_CFLAGS), so +dnl we need to add this in so configure works as intended. We will need to +dnl reset this value at the end of configure, to preserve the user's settings. +CFLAGS="${AM_CFLAGS} ${CFLAGS}" +FCFLAGS="${AM_FCFLAGS} ${FCFLAGS}" +CXXFLAGS="${AM_CXXFLAGS} ${CXXFLAGS}" +CPPFLAGS="${AM_CPPFLAGS} ${CPPFLAGS}" +LDFLAGS="${AM_LDFLAGS} ${LDFLAGS}" + +dnl ---------------------------------------------------------------------- dnl Enable dependency tracking unless the configure options or a dnl site-specific file told us not to. This prevents configure from dnl silently disabling dependencies for some compilers. @@ -365,7 +375,8 @@ if test "X$HDF_FORTRAN" = "Xyes"; then dnl -------------------------------------------------------------------- dnl General Fortran flags dnl - AM_FCFLAGS="${AM_FCFLAGS} ${AM_FFLAGS}" + AM_FCFLAGS="${AM_FCFLAGS} ${FFLAGS}" + FCFLAGS="${FCFLAGS} ${FFLAGS}" dnl -------------------------------------------------------------------- dnl Fortran source extention @@ -494,6 +505,7 @@ int main(void) { return 0; } echo no ], [ echo yes + CXXFLAGS="${CXXFLAGS} -DOLD_HEADER_FILENAME" AM_CXXFLAGS="${AM_CXXFLAGS} -DOLD_HEADER_FILENAME" ]) @@ -512,6 +524,7 @@ int main(void) { echo yes ], [ echo no + CXXFLAGS="${CXXFLAGS} -DH5_NO_NAMESPACE" AM_CXXFLAGS="${AM_CXXFLAGS} -DH5_NO_NAMESPACE" ]) @@ -529,6 +542,7 @@ int main(void) { echo yes ], [ echo no + CXXFLAGS="${CXXFLAGS} -DH5_NO_STD" AM_CXXFLAGS="${AM_CXXFLAGS} -DH5_NO_STD" ]) @@ -542,6 +556,7 @@ int main(void) { echo yes ], [ echo no + CXXFLAGS="${CXXFLAGS} -DBOOL_NOTDEFINED" AM_CXXFLAGS="${AM_CXXFLAGS} -DBOOL_NOTDEFINED" ]) @@ -579,6 +594,7 @@ int main(void) { echo yes ], [ echo no + CXXFLAGS="${CXXFLAGS} -DNO_STATIC_CAST" AM_CXXFLAGS="${AM_CXXFLAGS} -DNO_STATIC_CAST" ]) else @@ -885,6 +901,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 @@ -3965,13 +3982,13 @@ AC_RUN_IFELSE([ ]) -dnl ------------------------------------ -dnl Restore user's CPPFLAGS and LDFLAGS. -CPPFLAGS="$saved_user_CPPFLAGS" -LDFLAGS="$saved_user_LDFLAGS" -FCFLAGS="$saved_user_FCFLAGS" +dnl ---------------------------------------------------------------------- +dnl Restore user's CFLAGS. CFLAGS="$saved_user_CFLAGS" +FCFLAGS="$saved_user_FCFLAGS" CXXFLAGS="$saved_user_CXXFLAGS" +CPPFLAGS="$saved_user_CPPFLAGS" +LDFLAGS="$saved_user_LDFLAGS" dnl ---------------------------------------------------------------------- -- cgit v0.12