diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2016-02-18 15:44:39 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2016-02-18 15:44:39 (GMT) |
commit | 26e52066be1a09d4fb8cf041a1cfacfc09edc6d3 (patch) | |
tree | d68d361894fd21fca23e51ad96fbb70e71b111cd | |
parent | c4ef0b65a0499e33e88ef51129f2376e0ac8a072 (diff) | |
download | hdf5-26e52066be1a09d4fb8cf041a1cfacfc09edc6d3.zip hdf5-26e52066be1a09d4fb8cf041a1cfacfc09edc6d3.tar.gz hdf5-26e52066be1a09d4fb8cf041a1cfacfc09edc6d3.tar.bz2 |
[svn-r29146] Merged autotools changes from the trunk:
r29050, 29090, 29127, 29129, 29131, 29134, 29139, 29142
Tested on: 64-bit Ubuntu 15.10 (Linux 4.2.0 x86_64) gcc 5.2.1
autotools serial (debug/release w/ C++ & Fortran)
autotools parallel (MPICH 3.1.2, debug w/ Fortran)
-rw-r--r-- | config/cce-fflags | 6 | ||||
-rw-r--r-- | config/cce-flags | 10 | ||||
-rw-r--r-- | config/gnu-cxxflags | 36 | ||||
-rw-r--r-- | config/gnu-fflags | 3 | ||||
-rw-r--r-- | config/gnu-flags | 6 | ||||
-rw-r--r-- | config/i686-pc-cygwin | 22 | ||||
-rw-r--r-- | config/ibm-aix | 49 | ||||
-rw-r--r-- | config/ibm-flags | 6 | ||||
-rw-r--r-- | config/intel-fflags | 1 | ||||
-rw-r--r-- | config/intel-flags | 7 | ||||
-rw-r--r-- | config/linux-gnulibc1 | 24 | ||||
-rw-r--r-- | config/pgi-fflags | 3 | ||||
-rw-r--r-- | config/pgi-flags | 12 | ||||
-rw-r--r-- | config/solaris | 91 | ||||
-rw-r--r-- | config/x86_64-pc-cygwin | 23 | ||||
-rw-r--r-- | configure.ac | 114 |
16 files changed, 283 insertions, 130 deletions
diff --git a/config/cce-fflags b/config/cce-fflags index b96551d..233f9ff 100644 --- a/config/cce-fflags +++ b/config/cce-fflags @@ -52,15 +52,15 @@ if test "X-cce" = "X-$f9x_vendor"; then H5_FCFLAGS="${H5_FCFLAGS} -hnocaf" # Production - # -Wl,-s to remove all symbols for smaller file - # Note that this will likely override the symbols flag - PROD_FCFLAGS="-Wl,-s" + PROD_FCFLAGS= # Debug DEBUG_FCFLAGS= # Symbols + # -Wl,-s to remove all symbols for smaller file SYMBOLS_FCFLAGS="-g" + NO_SYMBOLS_FCFLAGS="-Wl,-s" # Profiling # Use this for profiling with gprof diff --git a/config/cce-flags b/config/cce-flags index e479363..8f3b2dc 100644 --- a/config/cce-flags +++ b/config/cce-flags @@ -54,23 +54,20 @@ if test "X-cce" = "X-$cc_vendor"; then H5_CFLAGS="${H5_CFLAGS:--hc99 $arch}" # Production - # -Wl,-s to remove all symbols for smaller file - PROD_CFLAGS="-Wl,-s" - PROD_CPPFLAGS= + PROD_CFLAGS= # Debug # NDEBUG is handled explicitly in configure DEBUG_CFLAGS= - DEBUG_CPPFLAGS= # Symbols + # -Wl,-s to remove all symbols for smaller file SYMBOLS_CFLAGS="-g" - SYMBOLS_CPPFLAGS= + NO_SYMBOLS_CFLAGS="-Wl,-s" # Profiling # Use this for profiling with gprof PROFILE_CFLAGS="-p" - PROFILE_CPPFLAGS= # Optimization HIGH_OPT_CFLAGS="-O3" @@ -87,3 +84,4 @@ if test "X-$cc_flags_set" = "X-"; then cc_vendor= cc_version= fi + diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags index ee690db..8d1ca67 100644 --- a/config/gnu-cxxflags +++ b/config/gnu-cxxflags @@ -100,30 +100,54 @@ case "$cxx_vendor-$cxx_version" in H5_CXXFLAGS="$H5_CXXFLAGS -Wsign-promo -Woverloaded-virtual -Wold-style-cast -Weffc++ -Wreorder -Wnon-virtual-dtor -Wctor-dtor-privacy -Wabi" # Production + # NDEBUG is handled explicitly by the configure script case "$cxx_vendor-$cxx_version" in g++-[34].*) - PROD_CXXFLAGS="-O3" + PROD_CXXFLAGS= ;; g++-5.*) - PROD_CXXFLAGS="-O3 -fstdarg-opt" + PROD_CXXFLAGS="-fstdarg-opt" ;; *) - PROD_CXXFLAGS="-O -finline-functions" + PROD_CXXFLAGS="-finline-functions" ;; esac # Debug + # NDEBUG is handled explicitly by the configure script + # -g is hanled by the symbols flags case "$cxx_vendor-$cxx_version" in g++-5.*) - DEBUG_CXXFLAGS="-Og -g -ftrapv -fno-common" + DEBUG_CXXFLAGS="-ftrapv -fno-common" ;; *) - DEBUG_CXXFLAGS="-g" + DEBUG_CXXFLAGS= ;; esac + # Symbols + NO_SYMBOLS_CXXFLAGS="-s" + SYMBOLS_CXXFLAGS="-g" + # Profile - PROFILE_CXXFLAGS="-Og -g -pg" + PROFILE_CXXFLAGS="-pg" + + # Optimization + case "$cxx_vendor-$cxx_version" in + g++-[34].*) + HIGH_OPT_CXXFLAGS="-O3" + DEBUG_OPT_CXXFLAGS= + ;; + g++-5.*) + HIGH_OPT_CXXFLAGS="-O3" + DEBUG_OPT_CXXFLAGS="-Og" + ;; + *) + HIGH_OPT_CXXFLAGS="-O" + DEBUG_OPT_CXXFLAGS= + ;; + esac + NO_OPT_CXXFLAGS="-O0" # Flags are set cxx_flags_set=yes diff --git a/config/gnu-fflags b/config/gnu-fflags index 3a90c10..62498a9 100644 --- a/config/gnu-fflags +++ b/config/gnu-fflags @@ -83,13 +83,14 @@ if test "X-gfortran" = "X-$f9x_vendor"; then H5_FCFLAGS="$H5_FCFLAGS -Wno-c-binding-type" # Production - PROD_FCFLAGS="-s" + PROD_FCFLAGS= # Debug DEBUG_FCFLAGS="-fbounds-check" # Symbols SYMBOLS_FCFLAGS="-g" + NO_SYMBOLS_FCFLAGS="-s" # Profiling PROFILE_FCFLAGS="-pg" diff --git a/config/gnu-flags b/config/gnu-flags index ecb5859..87aef3a 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -124,17 +124,15 @@ case "$cc_vendor-$cc_version" in ;; esac #DEBUG_CFLAGS="-fsanitize=undefined" - DEBUG_CPPFLAGS= # Symbols + NO_SYMBOLS_CFLAGS="-s" SYMBOLS_CFLAGS="-g" - SYMBOLS_CPPFLAGS= # Profile PROFILE_CFLAGS="-pg" - PROFILE_CPPFLAGS= - # Optimization (only CFLAGS at this time) + # Optimization case "$cc_vendor-$cc_version" in gcc-[34].*) HIGH_OPT_CFLAGS="-O3" diff --git a/config/i686-pc-cygwin b/config/i686-pc-cygwin index 9b1ab74..7355e4a 100644 --- a/config/i686-pc-cygwin +++ b/config/i686-pc-cygwin @@ -104,9 +104,25 @@ case $FC_BASENAME in # (just in case since this should be a default EIP) H5_FCFLAGS="$H5_FCFLAGS -YEXT_NAMES=UCS" FSEARCH_DIRS="" - DEBUG_FCFLAGS="-g" - PROD_FCFLAGS="-O" - PROFILE_FCFLAGS="-g -pg" + + # Production + PROD_FCFLAGS= + + # Debug + DEBUG_FCFLAGS= + + # Symbols + SYMBOLS_FCFLAGS="-g" + NO_SYMBOLS_FCFLAGS="-s" + + # Profiling + PROFILE_FCFLAGS="-pg" + + # Optimization + HIGH_OPT_FCFLAGS="-O" + DEBUG_OPT_FCFLAGS= + NO_OPT_FCFLAGS= + f9x_flags_set=yes ;; diff --git a/config/ibm-aix b/config/ibm-aix index 28498e2..ef052fb 100644 --- a/config/ibm-aix +++ b/config/ibm-aix @@ -59,9 +59,25 @@ if test "X-" = "X-$f9x_flags_set"; then FCFLAGS="$FCFLAGS ${F9XSUFFIXFLAG}" H5_FCFLAGS="$H5_FCFLAGS ${F9XSUFFIXFLAG}" FSEARCH_DIRS="-I./ -I../src" - DEBUG_FCFLAGS="-g" - PROD_FCFLAGS="-O" - PROFILE_FCFLAGS="-g -pg" + + # Produciton + PROD_FCFLAGS= + + # Debug + DEBUG_FCFLAGS= + + # Symbols + SYMBOLS_FCFLAGS="-g" + NO_SYMBOLS_FCFLAGS= + + # Profiling + PROFILE_FCFLAGS="-pg" + + # Optimization + HIGH_OPT_FCFLAGS="-O" + DEBUG_OPT_FCFLAGS= + NO_OPT_FCFLAGS= + f9x_flags_set=yes fi @@ -91,13 +107,30 @@ case $CC_BASENAME in ;; *) + # Undetermined compiler + # Use very generic flags H5_CFLAGS="$H5_CFLAGS -ansi" - DEBUG_CFLAGS="-g" - DEBUG_CPPFLAGS= - PROD_CFLAGS="-O" - PROD_CPPFLAGS= + + # Produciton + PROD_CFLAGS= + + # Debug + DEBUG_CFLAGS= + + # Symbols + SYMBOLS_CFLAGS="-g" + NO_SYMBOLS_CFLAGS= + + # Profiling PROFILE_CFLAGS="-pg" - PROFILE_CPPFLAGS= + + # Optimization + HIGH_OPT_CFLAGS="-O" + DEBUG_OPT_CFLAGS= + NO_OPT_CFLAGS= + + # Flags are set + cc_flags_set=yes ;; esac diff --git a/config/ibm-flags b/config/ibm-flags index 60a7af9..412817c 100644 --- a/config/ibm-flags +++ b/config/ibm-flags @@ -66,20 +66,17 @@ if test "XL" = "$cc_vendor"; then # Produciton PROD_CFLAGS= - PROD_CPPFLAGS= # Debug # NDEBUG is handled explicitly in configure DEBUG_CFLAGS="-qfullpath" - DEBUG_CPPFLAGS= # Symbols SYMBOLS_CFLAGS="-g" - SYMBOLS_CPPFLAGS= + NO_SYMBOLS_CFLAGS= # Profiling PROFILE_CFLAGS="-pg" - PROFILE_CPPFLAGS= # Optimization # -O causes test/dtypes to fail badly. Turn it off for now. @@ -125,3 +122,4 @@ if test X != X$CXX; then fi fi + diff --git a/config/intel-fflags b/config/intel-fflags index 1f7cf78..db9543e 100644 --- a/config/intel-fflags +++ b/config/intel-fflags @@ -80,6 +80,7 @@ if test "X-ifort" = "X-$f9x_vendor"; then # Symbols SYMBOLS_FCFLAGS="-g" + NO_SYMBOLS_FCFLAGS= # Profiling # Use this for profiling with gprof diff --git a/config/intel-flags b/config/intel-flags index 060e78a..fe7b06d 100644 --- a/config/intel-flags +++ b/config/intel-flags @@ -70,23 +70,20 @@ if test "X-icc" = "X-$cc_vendor"; then # Default to C99 standard. H5_CFLAGS="${H5_CFLAGS:--std=c99 $arch} -Wcheck -Wall" - # Production is set to default; see settings for specific version further down + # Production PROD_CFLAGS= - PROD_CPPFLAGS= # Debug # NDEBUG is handled explicitly in configure DEBUG_CFLAGS= - DEBUG_CPPFLAGS= # Symbols SYMBOLS_CFLAGS="-g" - SYMBOLS_CPPFLAGS= + NO_SYMBOLS_CFLAGS= # Profiling # Use this for profiling with gprof PROFILE_CFLAGS="-p" - PROFILE_CPPFLAGS= # Optimization HIGH_OPT_CFLAGS="-O" diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 46771dc..5bea816 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -117,9 +117,25 @@ case $FC_BASENAME in # (just in case since this should be a default EIP) H5_FCFLAGS="$H5_FCFLAGS" FSEARCH_DIRS="" - DEBUG_FCFLAGS="-g" - PROD_FCFLAGS="-O" - PROFILE_FCFLAGS="-g -pg" + + # Production + PROD_FCFLAGS= + + # Debug + DEBUG_FCFLAGS= + + # Symbols + SYMBOLS_FCFLAGS="-g" + NO_SYMBOLS_FCFLAGS="-s" + + # Profiling + PROFILE_FCFLAGS="-pg" + + # Optimization + HIGH_OPT_FCFLAGS="-O" + DEBUG_OPT_FCFLAGS= + NO_OPT_FCFLAGS= + f9x_flags_set=yes ;; @@ -183,7 +199,7 @@ case $FC in *mpif90*) fc_version_info=`$FC $FCFLAGS $H5_FCFLAGS -v 2>&1 | grep 'version' |\ sed 's/^[a-z0-9]* for //' |\ - sed ās/\ā/\\\ā/gā |\ + sed 's/\"/\\\"/g' |\ sed 's/^\([a-z]* \)/ built with \1/1'` fc_version_info=`echo $fc_version_info` ;; diff --git a/config/pgi-fflags b/config/pgi-fflags index fbcba52..08dfe6e 100644 --- a/config/pgi-fflags +++ b/config/pgi-fflags @@ -84,13 +84,14 @@ if test "X-pgf90" = "X-$f9x_vendor"; then #else # PROD_FCFLAGS="-O2 -s" #fi - PROD_FCFLAGS="-fast -s -Mnoframe" + PROD_FCFLAGS="-fast -Mnoframe" # Debug DEBUG_FCFLAGS="-Mbounds -Mchkptr -Mdclchk" # Symbols SYMBOLS_FCFLAGS="-g" + NO_SYMBOLS_FCFLAGS="-s" # Profiling PROFILE_FCFLAGS="-Mprof=func,line" diff --git a/config/pgi-flags b/config/pgi-flags index a6dcba3..f6878e6 100644 --- a/config/pgi-flags +++ b/config/pgi-flags @@ -73,31 +73,28 @@ if test "X-pgcc" = "X-$cc_vendor"; then # Production case "$cc_vendor-$cc_version" in pgcc-10.6*) - PROD_CFLAGS="-s" + PROD_CFLAGS= ;; pgcc-9.*) - PROD_CFLAGS="-s" + PROD_CFLAGS= ;; *) - PROD_CFLAGS="-fast -s" + PROD_CFLAGS="-fast" ;; esac - PROD_CPPFLAGS= # Debug # NDEBUG is handled explicitly by the configure script DEBUG_CFLAGS="-Mbounds" - DEBUG_CPPFLAGS= # Symbols SYMBOLS_CFLAGS="-g" - SYMBOLS_CPPFLAGS= + NO_SYMBOLS_CFLAGS="-s" # Profiling PROFILE_CFLAGS="-Mprof=func,line" # Use this for profiling with gprof #PROFILE_CFLAGS="-pg" - PROFILE_CPPFLAGS= # Optimization case "$cc_vendor-$cc_version" in @@ -118,7 +115,6 @@ if test "X-pgcc" = "X-$cc_vendor"; then # Flags are set cc_flags_set=yes - fi # Clear cc info if no flags set diff --git a/config/solaris b/config/solaris index 310c373..72d7423 100644 --- a/config/solaris +++ b/config/solaris @@ -32,16 +32,32 @@ fi # Try solaris native compiler flags if test "X-" = "X-$cc_flags_set"; then H5_CFLAGS="$H5_CFLAGS -erroff=%none -DBSD_COMP" + + # Production + # NDEBUG is handled explicitly by the configure script + PROD_CFLAGS= + + # Debug + # NDEBUG is handled explicitly by the configure script + # -g is hanled by the symbols flags + DEBUG_CFLAGS= + + # Symbols + NO_SYMBOLS_CFLAGS="-s" + SYMBOLS_CFLAGS="-g" + + # Profile + PROFILE_CFLAGS="-xpg" + + # Optimization # -g produces rather slow code. "-g -O" produces much faster code with some # loss of debugger functions such as not able to print local variables. - DEBUG_CFLAGS="-g -O" - DEBUG_CPPFLAGS= - PROD_CFLAGS="-O -s" - PROD_CPPFLAGS= - PROFILE_CFLAGS=-xpg - PROFILE_CPPFLAGS= + HIGH_OPT_CFLAGS="-O" + DEBUG_OPT_CFLAGS="-O" + NO_OPT_CFLAGS= + cc_flags_set=yes -# Special linking flag is needed to build with Fortran on Solaris 5.9 + # Special linking flag is needed to build with Fortran on Solaris 5.9 system_version="`uname -r`" case "$system_version" in 5.9*) @@ -52,10 +68,6 @@ if test "X-" = "X-$cc_flags_set"; then ;; esac - # Turn off optimization flag for SUNpro compiler versions 4.x which - # have an optimization bug. Version 5.0 works. - ($CC -V 2>&1) | grep -s 'cc: .* C 4\.' >/dev/null 2>&1 \ - && PROD_CFLAGS="`echo $PROD_CFLAGS | sed -e 's/-O//'`" fi LIBS="$LIBS" @@ -69,12 +81,34 @@ fi if test "X-" = "X-$f9x_flags_set"; then F9XSUFFIXFLAG="" FSEARCH_DIRS="" + H5_FCFLAGS="$H5_FCFLAGS" + + # TODO: Revisit these flags. + + # Production + # NDEBUG is handled explicitly by the configure script + PROD_FCFLAGS= + + # Debug + # NDEBUG is handled explicitly by the configure script + # -g is hanled by the symbols flags + DEBUG_FCFLAGS= + + # Symbols + NO_SYMBOLS_FCFLAGS= + SYMBOLS_FCFLAGS="-g" + + # Profile + PROFILE_FCFLAGS= + + # Optimization # -g produces rather slow code. "-g -O" produces much faster code with some # loss of debugger functions such as not able to print local variables. - DEBUG_FCFLAGS="-g -O" - PROD_FCFLAGS="-O2" - PROFILE_FCFLAGS="" + HIGH_OPT_FCFLAGS="-O2" + DEBUG_OPT_FCFLAGS="-O" + NO_OPT_FCFLAGS= + f9x_flags_set=yes fi @@ -107,14 +141,30 @@ fi if test -z "$cxx_flags_set"; then H5_CXXFLAGS="$H5_CXXFLAGS -instances=static" H5_CPPFLAGS="$H5_CPPFLAGS -LANG:std" + + # Production + # NDEBUG is handled explicitly by the configure script + PROD_CXXFLAGS= + + # Debug + # NDEBUG is handled explicitly by the configure script + # -g is hanled by the symbols flags + DEBUG_CXXFLAGS= + + # Symbols + NO_SYMBOLS_CXXFLAGS="-s" + SYMBOLS_CXXFLAGS="-g" + + # Profile + PROFILE_CXXFLAGS="-xpg" + + # Optimization # -g produces rather slow code. "-g -O" produces much faster code with some # loss of debugger functions such as not able to print local variables. - DEBUG_CXXFLAGS="-g -O" - DEBUG_CPPFLAGS= - PROD_CXXFLAGS="-O -s" - PROD_CPPFLAGS= - PROFILE_CXXFLAGS=-xpg - PROFILE_CPPFLAGS= + HIGH_OPT_CXXFLAGS="-O" + DEBUG_OPT_CXXFLAGS="-O" + NO_OPT_CXXFLAGS= + cxx_flags_set=yes fi @@ -156,4 +206,3 @@ case $CXX in ;; esac - diff --git a/config/x86_64-pc-cygwin b/config/x86_64-pc-cygwin index 9b1ab74..210aa2b 100644 --- a/config/x86_64-pc-cygwin +++ b/config/x86_64-pc-cygwin @@ -104,9 +104,25 @@ case $FC_BASENAME in # (just in case since this should be a default EIP) H5_FCFLAGS="$H5_FCFLAGS -YEXT_NAMES=UCS" FSEARCH_DIRS="" - DEBUG_FCFLAGS="-g" - PROD_FCFLAGS="-O" - PROFILE_FCFLAGS="-g -pg" + + # Production + PROD_FCFLAGS= + + # Debug + DEBUG_FCFLAGS= + + # Symbols + SYMBOLS_FCFLAGS="-g" + NO_SYMBOLS_FCFLAGS="-s" + + # Profiling + PROFILE_FCFLAGS="-pg" + + # Optimization + HIGH_OPT_FCFLAGS="-O" + DEBUG_OPT_FCFLAGS= + NO_OPT_FCFLAGS= + f9x_flags_set=yes ;; @@ -119,3 +135,4 @@ if test -z "$CXX"; then CXX=g++ CXX_BASENAME=g++ fi + diff --git a/configure.ac b/configure.ac index a85b0fe..8787262 100644 --- a/configure.ac +++ b/configure.ac @@ -158,59 +158,6 @@ AC_SUBST([UNAME_INFO]) UNAME_INFO=`uname -a` ## ---------------------------------------------------------------------- -## Determine build mode (debug, production, clean). -## This has to be done early since the build mode is referred to -## frequently. -## -AC_MSG_CHECKING([build mode]) -AC_ARG_ENABLE([build-mode], - [AS_HELP_STRING([--enable-build-mode=(debug|production|clean)], - [Sets the build mode. Debug turns on symbols, API - tracing, asserts, and debug optimization, - as well as several other minor configure options - that aid in debugging. - Production turns high optimizations on. - Clean turns nothing on and disables optimization - (i.e.: a 'clean slate' configuration). - All these settings can be overridden by using - specific configure flags. - [default=debug] - ])], - [BUILD_MODE=$enableval]) - -## Set the default -## Depends on branch, set via script at branch creation time -if test "X-$BUILD_MODE" = X- ; then - BUILD_MODE=debug -fi - -## Allow this variable to be substituted in -## other files (src/libhdf5.settings.in, etc.) -AC_SUBST([BUILD_MODE]) - -case "X-$BUILD_MODE" in - X-clean) - AC_MSG_RESULT([clean]) - ;; - X-debug) - H5_CFLAGS="$H5_CFLAGS $DEBUG_CFLAGS" - H5_CPPFLAGS="$H5_CPPFLAGS $DEBUG_CPPFLAGS" - H5_CXXFLAGS="$H5_CXXFLAGS $DEBUG_CXXFLAGS" - H5_FCFLAGS="$H5_FCFLAGS $DEBUG_FCFLAGS" - AC_MSG_RESULT([debug]) - ;; - X-production) - H5_CFLAGS="$H5_CFLAGS $PROD_CFLAGS" - H5_CPPFLAGS="$H5_CPPFLAGS $PROD_CPPFLAGS" - H5_CXXFLAGS="$H5_CXXFLAGS $PROD_CXXFLAGS" - H5_FCFLAGS="$H5_FCFLAGS $PROD_FCFLAGS" - AC_MSG_RESULT([production]) - ;; - *) - AC_MSG_ERROR([Unrecognized build mode: $BUILD_MODE. Use debug, production, or clean.]) -esac - -## ---------------------------------------------------------------------- ## Some platforms have broken basename, and/or xargs programs. Check ## that it actually does what it's supposed to do. Catch this early ## since configure and scripts relies upon them heavily and there's @@ -320,6 +267,60 @@ while test -n "$hname"; do done ## ---------------------------------------------------------------------- +## Determine build mode (debug, production, clean). +## This has to be done early since the build mode is referred to +## frequently. +## +AC_MSG_CHECKING([build mode]) +AC_ARG_ENABLE([build-mode], + [AS_HELP_STRING([--enable-build-mode=(debug|production|clean)], + [Sets the build mode. Debug turns on symbols, API + tracing, asserts, and debug optimization, + as well as several other minor configure options + that aid in debugging. + Production turns high optimizations on. + Clean turns nothing on and disables optimization + (i.e.: a 'clean slate' configuration). + All these settings can be overridden by using + specific configure flags. + [default=debug] + ])], + [BUILD_MODE=$enableval]) + +## Set the default +## Depends on branch, set via script at branch creation time +if test "X-$BUILD_MODE" = X- ; then + BUILD_MODE=debug +fi + +## Allow this variable to be substituted in +## other files (src/libhdf5.settings.in, etc.) +AC_SUBST([BUILD_MODE]) + +case "X-$BUILD_MODE" in + X-clean) + AC_MSG_RESULT([clean]) + ;; + X-debug) + AC_DEFINE([DEBUG_BUILD], [1], [Define if this is a debug build.]) + H5_CFLAGS="$H5_CFLAGS $DEBUG_CFLAGS" + H5_CPPFLAGS="$H5_CPPFLAGS $DEBUG_CPPFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $DEBUG_CXXFLAGS" + H5_FCFLAGS="$H5_FCFLAGS $DEBUG_FCFLAGS" + AC_MSG_RESULT([debug]) + ;; + X-production) + H5_CFLAGS="$H5_CFLAGS $PROD_CFLAGS" + H5_CPPFLAGS="$H5_CPPFLAGS $PROD_CPPFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $PROD_CXXFLAGS" + H5_FCFLAGS="$H5_FCFLAGS $PROD_FCFLAGS" + AC_MSG_RESULT([production]) + ;; + *) + AC_MSG_ERROR([Unrecognized build mode: $BUILD_MODE. Use debug, production, or clean.]) +esac + +## ---------------------------------------------------------------------- ## Some built-in configure checks can only see CFLAGS (not AM_CFLAGS), so ## we need to add this in so configure works as intended. We will need to ## reset this value at the end of configure, to preserve the user's settings. @@ -1934,6 +1935,9 @@ case "X-$SYMBOLS" in AC_MSG_RESULT([yes]) ;; X-no) + H5_CFLAGS="$H5_CFLAGS $NO_SYMBOLS_CFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $NO_SYMBOLS_CXXFLAGS" + H5_FCFLAGS="$H5_FCFLAGS $NO_SYMBOLS_FCFLAGS" AC_MSG_RESULT([no]) ;; *) @@ -2074,21 +2078,25 @@ AC_SUBST([OPTIMIZATION]) case "X-$OPTIMIZATION" in X-high) H5_CFLAGS="$H5_CFLAGS $HIGH_OPT_CFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $HIGH_OPT_CXXFLAGS" H5_FCFLAGS="$H5_FCFLAGS $HIGH_OPT_FCFLAGS" AC_MSG_RESULT([high]) ;; X-debug) H5_CFLAGS="$H5_CFLAGS $DEBUG_OPT_CFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $DEBUG_OPT_CXXFLAGS" H5_FCFLAGS="$H5_FCFLAGS $DEBUG_OPT_FCFLAGS" AC_MSG_RESULT([debug]) ;; X-none) H5_CFLAGS="$H5_CFLAGS $NO_OPT_CFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $NO_OPT_CXXFLAGS" H5_FCFLAGS="$H5_FCFLAGS $NO_OPT_FCFLAGS" AC_MSG_RESULT([none]) ;; *) H5_CFLAGS="$H5_CFLAGS $OPTIMIZATION" + H5_CXXFLAGS="$H5_CXXFLAGS $OPTIMIZATION" H5_FCFLAGS="$H5_FCFLAGS $OPTIMIZATION" OPTIMIZATION="custom ($OPTIMIZATION)" AC_MSG_RESULT([$OPTIMIZATION]) |