summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2014-07-27 10:08:44 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2014-07-27 10:24:44 +1000
commitf73c82a73d47770283270692901987c509b8266e (patch)
tree1a834c4bfa6a036fbe879ed8c1e655615f477251 /configure.ac
parent221bdc409d811b7b432c41e9800149c4cdc446ad (diff)
downloadflac-f73c82a73d47770283270692901987c509b8266e.tar.gz
configure.ac : Erase default -O2 when setting -O3.
Previously CFLAGS had a -O3 at the start and a -O2 at the end. According to the GCC docs: https://gcc.gnu.org/onlinedocs/gcc-4.9.1/gcc/Optimize-Options.html "If you use multiple -O options, with or without level numbers, the last such option is the one that is effective" which means that GCC doesn't try to use SIMD to vectorize the code, etc."
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac6
1 files changed, 4 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index c81c4d38..7d58f025 100644
--- a/configure.ac
+++ b/configure.ac
@@ -379,16 +379,18 @@ fi
if test "x$debug" = xtrue; then
CPPFLAGS="-DDEBUG $CPPFLAGS"
+ CFLAGS=$(echo "$CFLAGS" | sed 's/-g//')
CFLAGS="-g $CFLAGS"
else
CPPFLAGS="-DNDEBUG $CPPFLAGS"
- CFLAGS="-O3 -funroll-loops -Wall -W -Winline $CFLAGS"
+ CFLAGS=$(echo "$CFLAGS" | sed 's/-O2//;s/-g//')
+ CFLAGS="-O3 -funroll-loops $CFLAGS"
fi
XIPH_GCC_VERSION
if test x$ac_cv_c_compiler_gnu = xyes ; then
- CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wnested-externs -Wshadow -Wundef -Wmissing-declarations -Wunreachable-code " # -Wcast-qual -Wbad-function-cast -Wwrite-strings -Winline -Wconversion
+ CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wnested-externs -Wshadow -Wundef -Wmissing-declarations -Wunreachable-code -Winline " # -Wcast-qual -Wbad-function-cast -Wwrite-strings -Wconversion
CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wsign-promo -Wundef -Wunreachable-code " # -Wcast-qual -Wbad-function-cast -Wwrite-strings -Woverloaded-virtual -Wmissing-declarations
XIPH_ADD_CFLAGS([-Wdeclaration-after-statement])