diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2016-01-27 21:45:23 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2016-01-27 21:45:23 (GMT) |
commit | 1454a458262dd012c94f56ccc55ccbbe57b63399 (patch) | |
tree | 3924efe3b45657d02b8dcc394df30626591a6610 /config/gnu-flags | |
parent | 7afa7bb6afd1cf4daee58010e4f9411262abeab9 (diff) | |
download | hdf5-1454a458262dd012c94f56ccc55ccbbe57b63399.zip hdf5-1454a458262dd012c94f56ccc55ccbbe57b63399.tar.gz hdf5-1454a458262dd012c94f56ccc55ccbbe57b63399.tar.bz2 |
[svn-r28996] Autotools configure updates to allow separation of build type, debug
symbols, asserts, profiling, and optimization.
Also much refactoring, improved help, and --enable-<foo> options will
now emit errors on nonsense (e.g.: --enable-foo="asdfasdf").
The libhdf5.settings.in file was also reformatted.
Tested on: 64-bit Ubuntu 15.10 (Linux 4.2.0 x86_64) gcc 5.2.1
serial and parallel autotools w/ various options
Diffstat (limited to 'config/gnu-flags')
-rw-r--r-- | config/gnu-flags | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/config/gnu-flags b/config/gnu-flags index e7f8f14..232bf05 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -97,39 +97,64 @@ case "$cc_vendor-$cc_version" in H5_CFLAGS="$H5_CFLAGS $arch -std=c99 -pedantic -Wall -W -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline" # Production + # NDEBUG is handled explicitly by the configure script case "$cc_vendor-$cc_version" in gcc-[34].*) - PROD_CFLAGS="-O3" + PROD_CFLAGS= ;; gcc-5.*) - PROD_CFLAGS="-O3 -fstdarg-opt" + PROD_CFLAGS="-fstdarg-opt" ;; *) - PROD_CFLAGS="-O -finline-functions" + # gcc automatically inlines based on the optimization level + # this is just a failsafe + PROD_CFLAGS="-finline-functions" ;; esac - PROD_CPPFLAGS= # Debug + # NDEBUG is handled explicitly by the configure script + # -g is hanled by the symbols flags case "$cc_vendor-$cc_version" in gcc-5.*) - DEBUG_CFLAGS="-Og -g -ftrapv -fno-common" + DEBUG_CFLAGS="-ftrapv -fno-common" ;; *) - DEBUG_CFLAGS="-g" + DEBUG_CFLAGS= ;; esac - #DEBUG_CFLAGS="$DEBUG_CFLAGS -fsanitize=undefined" + #DEBUG_CFLAGS="-fsanitize=undefined" DEBUG_CPPFLAGS= - # Try out the new "stack protector" feature introduced in gcc 4.1 - # (We should also think about adding some of the other memory protection options) - #DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all" + # Symbols + SYMBOL_CFLAGS="-g" + SYMBOL_CPPFLAGS= # Profile - PROFILE_CFLAGS="-Og -g -pg" + PROFILE_CFLAGS="-pg" PROFILE_CPPFLAGS= + # Optimization (only CFLAGS at this time) + case "$cc_vendor-$cc_version" in + gcc-[34].*) + HIGH_OPT_CFLAGS="-O3" + DEBUG_OPT_CFLAGS= + ;; + gcc-5.*) + HIGH_OPT_CFLAGS="-O3" + DEBUG_OPT_CFLAGS="-Og" + ;; + *) + HIGH_OPT_CFLAGS="-O" + DEBUG_OPT_CFLAGS= + ;; + esac + NO_OPT_CFLAGS="-O0" + + # Try out the new "stack protector" feature introduced in gcc 4.1 + # (We should also think about adding some of the other memory protection options) + #DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all" + # Flags are set cc_flags_set=yes ;; |