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."
This commit is contained in:
Erik de Castro Lopo
2014-07-27 10:08:44 +10:00
parent 221bdc409d
commit f73c82a73d

View File

@@ -379,16 +379,18 @@ fi
if test "x$debug" = xtrue; then if test "x$debug" = xtrue; then
CPPFLAGS="-DDEBUG $CPPFLAGS" CPPFLAGS="-DDEBUG $CPPFLAGS"
CFLAGS=$(echo "$CFLAGS" | sed 's/-g//')
CFLAGS="-g $CFLAGS" CFLAGS="-g $CFLAGS"
else else
CPPFLAGS="-DNDEBUG $CPPFLAGS" 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 fi
XIPH_GCC_VERSION XIPH_GCC_VERSION
if test x$ac_cv_c_compiler_gnu = xyes ; then 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 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]) XIPH_ADD_CFLAGS([-Wdeclaration-after-statement])