diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac index adc862d251..472c47740a 100644 --- a/configure.ac +++ b/configure.ac @@ -323,6 +323,15 @@ AC_ARG_ENABLE([external-signer], AC_LANG_PUSH([C++]) +dnl Always set -g -O2 in our CXXFLAGS. Autoconf will try and set CXXFLAGS to "-g -O2" by default, +dnl so we suppress that (if CXXFLAGS hasn't been overridden by the user), given we are adding it +dnl ourselves. +CORE_CXXFLAGS="$CORE_CXXFLAGS -g -O2" + +if test "$CXXFLAGS_overridden" = "no"; then + CXXFLAGS="" +fi + dnl Check for a flag to turn compiler warnings into errors. This is helpful for checks which may dnl appear to succeed because by default they merely emit warnings when they fail. dnl @@ -347,12 +356,6 @@ case $host in esac if test "$enable_debug" = "yes"; then - dnl If debugging is enabled, and the user hasn't overridden CXXFLAGS, clear - dnl them, to prevent autoconfs "-g -O2" being added. Otherwise we'd end up - dnl with "-O0 -g3 -g -O2". - if test "$CXXFLAGS_overridden" = "no"; then - CXXFLAGS="" - fi dnl Disable all optimizations AX_CHECK_COMPILE_FLAG([-O0], [DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -O0"], [], [$CXXFLAG_WERROR]) @@ -859,12 +862,6 @@ if test "$use_lcov" = "yes"; then [AC_MSG_ERROR([lcov testing requested but --coverage linker flag does not work])]) AX_CHECK_COMPILE_FLAG([--coverage],[CORE_CXXFLAGS="$CORE_CXXFLAGS --coverage"], [AC_MSG_ERROR([lcov testing requested but --coverage flag does not work])]) - dnl If coverage is enabled, and the user hasn't overridden CXXFLAGS, clear - dnl them, to prevent autoconfs "-g -O2" being added. Otherwise we'd end up - dnl with "--coverage -Og -O0 -g -O2". - if test "$CXXFLAGS_overridden" = "no"; then - CXXFLAGS="" - fi CORE_CXXFLAGS="$CORE_CXXFLAGS -Og -O0" fi @@ -1996,7 +1993,7 @@ echo " CC = $CC" echo " CFLAGS = $PTHREAD_CFLAGS $CFLAGS" echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CORE_CPPFLAGS $CPPFLAGS" echo " CXX = $CXX" -echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CORE_CXXFLAGS $CXXFLAGS" +echo " CXXFLAGS = $CORE_CXXFLAGS $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CXXFLAGS" echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $GPROF_LDFLAGS $CORE_LDFLAGS $LDFLAGS" echo " AR = $AR" echo " ARFLAGS = $ARFLAGS" |