summaryrefslogtreecommitdiffstats
path: root/config/gnu-flags
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2016-02-07 16:38:55 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2016-02-07 16:38:55 (GMT)
commit0461830ee3a7eea419fbb6629c47e40c27aaf6f8 (patch)
treec4955c2febb9606bb68f803276b79503ba3f7a00 /config/gnu-flags
parentc3f08947c1fbca8f6ccd87ca35f0f23b6209b129 (diff)
parent48bebcc39ef565796356c159d16f09bfb0efba4d (diff)
downloadhdf5-0461830ee3a7eea419fbb6629c47e40c27aaf6f8.zip
hdf5-0461830ee3a7eea419fbb6629c47e40c27aaf6f8.tar.gz
hdf5-0461830ee3a7eea419fbb6629c47e40c27aaf6f8.tar.bz2
[svn-r29059] merge from trunk.
Diffstat (limited to 'config/gnu-flags')
-rw-r--r--config/gnu-flags47
1 files changed, 36 insertions, 11 deletions
diff --git a/config/gnu-flags b/config/gnu-flags
index e7f8f14..ecb5859 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
+ SYMBOLS_CFLAGS="-g"
+ SYMBOLS_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
;;