diff --git a/configure.ac b/configure.ac index 4c1a3e5f8..57f824dd0 100644 --- a/configure.ac +++ b/configure.ac @@ -235,37 +235,49 @@ WZ_WARNINGS_GCC_CXX="${WZ_Wno_}enum-compare ${WZ_WARNINGS_GCC}" if test "x$enable_debug" = "xyes" ; then if test "x$cc_icc" = "xyes" ; then # "-fp-model precise -fp-model source -ftz -no-fma" was here - WZ_CFLAGS="${WZ_CFLAGS} -O0 -g -Wcheck -Werror" - WZ_CXXFLAGS="${WZ_CXXFLAGS} -O0 -g -Wcheck -Werror" + WZ_CFLAGS="${WZ_CFLAGS} -g -Wcheck -Werror" + WZ_CXXFLAGS="${WZ_CXXFLAGS} -g -Wcheck -Werror" WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG" + # Override automatic -O2 added by autohell + CFLAGS="${CFLAGS} -O0" + CXXFLAGS="${CXXFLAGS} -O0" else - WZ_CFLAGS="${WZ_CFLAGS} -O0 -g -Werror ${WZ_WARNINGS_GCC_C}" - WZ_CXXFLAGS="${WZ_CXXFLAGS} -O0 -g -Werror ${WZ_WARNINGS_GCC_CXX}" + WZ_CFLAGS="${WZ_CFLAGS} -g -Werror ${WZ_WARNINGS_GCC_C}" + WZ_CXXFLAGS="${WZ_CXXFLAGS} -g -Werror ${WZ_WARNINGS_GCC_CXX}" WZ_C99FLAGS="${WZ_C99FLAGS} -Wno-declaration-after-statement" WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG" + # Override automatic -O2 added by autohell + CFLAGS="${CFLAGS} -O0" + CXXFLAGS="${CXXFLAGS} -O0" fi elif test "x$enable_debug" = "xoptimised" ; then - WZ_CFLAGS="${WZ_CFLAGS} -O2 -g -Werror ${WZ_WARNINGS_GCC_C}" - WZ_CXXFLAGS="${WZ_CXXFLAGS} -O2 -g -Werror ${WZ_WARNINGS_GCC_CXX}" + WZ_CFLAGS="${WZ_CFLAGS} -g -Werror ${WZ_WARNINGS_GCC_C}" + WZ_CXXFLAGS="${WZ_CXXFLAGS} -g -Werror ${WZ_WARNINGS_GCC_CXX}" WZ_C99FLAGS="${WZ_C99FLAGS} -Wno-declaration-after-statement" WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG" elif test "x$enable_debug" = "xrelaxed" ; then WZ_CFLAGS="${WZ_CFLAGS} -g -O0 ${WZ_WARNINGS_GCC_C}" - WZ_CXXFLAGS="${WZ_CXXFLAGS} -g -O0 ${WZ_WARNINGS_GCC_CXX}" + WZ_CXXFLAGS="${WZ_CXXFLAGS} -g ${WZ_WARNINGS_GCC_CXX}" WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG" + # Override automatic -O2 added by autohell + CFLAGS="${CFLAGS} -O0" + CXXFLAGS="${CXXFLAGS} -O0" elif test "x$enable_debug" = "xdebugprofile" ; then - WZ_CFLAGS="${WZ_CFLAGS} -g -O0 -pg ${WZ_WARNINGS_GCC_C}" - WZ_CXXFLAGS="${WZ_CXXFLAGS} -g -O0 -pg ${WZ_WARNINGS_GCC_CXX}" + WZ_CFLAGS="${WZ_CFLAGS} -g -pg ${WZ_WARNINGS_GCC_C}" + WZ_CXXFLAGS="${WZ_CXXFLAGS} -g -pg ${WZ_WARNINGS_GCC_CXX}" WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG" LDFLAGS="-pg ${LDFLAGS}" + # Override automatic -O2 added by autohell + CFLAGS="${CFLAGS} -O0" + CXXFLAGS="${CXXFLAGS} -O0" elif test "x$enable_debug" = "xprofile" ; then WZ_CFLAGS="${WZ_CFLAGS} -g -Os -pg ${WZ_WARNINGS_GCC_C}" WZ_CXXFLAGS="${WZ_CXXFLAGS} -g -Os -pg ${WZ_WARNINGS_GCC_CXX}" WZ_CPPFLAGS="${WZ_CPPFLAGS} -DNDEBUG" LDFLAGS="-pg ${LDFLAGS}" elif test "x$enable_debug" = "xg++" ; then - WZ_CFLAGS="${WZ_CXXFLAGS} -g -O2 ${WZ_WARNINGS_GCC_CXX}" - WZ_CXXFLAGS="${WZ_CXXFLAGS} -g -O2 ${WZ_WARNINGS_GCC_CXX}" + WZ_CFLAGS="${WZ_CXXFLAGS} -g ${WZ_WARNINGS_GCC_CXX}" + WZ_CXXFLAGS="${WZ_CXXFLAGS} -g ${WZ_WARNINGS_GCC_CXX}" WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG" CC="g++" else