@@ -323,6 +323,15 @@ AC_ARG_ENABLE([external-signer],
323
323
324
324
AC_LANG_PUSH ( [ C++] )
325
325
326
+ dnl Always set -g -O2 in our CXXFLAGS. Autoconf will try and set CXXFLAGS to "-g -O2" by default,
327
+ dnl so we suppress that (if CXXFLAGS hasn't been overridden by the user), given we are adding it
328
+ dnl ourselves.
329
+ CORE_CXXFLAGS="$CORE_CXXFLAGS -g -O2"
330
+
331
+ if test "$CXXFLAGS_overridden" = "no"; then
332
+ CXXFLAGS=""
333
+ fi
334
+
326
335
dnl Check for a flag to turn compiler warnings into errors. This is helpful for checks which may
327
336
dnl appear to succeed because by default they merely emit warnings when they fail.
328
337
dnl
@@ -347,12 +356,6 @@ case $host in
347
356
esac
348
357
349
358
if test "$enable_debug" = "yes"; then
350
- dnl If debugging is enabled, and the user hasn't overridden CXXFLAGS, clear
351
- dnl them, to prevent autoconfs "-g -O2" being added. Otherwise we'd end up
352
- dnl with "-O0 -g3 -g -O2".
353
- if test "$CXXFLAGS_overridden" = "no"; then
354
- CXXFLAGS=""
355
- fi
356
359
357
360
dnl Disable all optimizations
358
361
AX_CHECK_COMPILE_FLAG ( [ -O0] , [ DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -O0"] , [ ] , [ $CXXFLAG_WERROR] )
@@ -859,12 +862,6 @@ if test "$use_lcov" = "yes"; then
859
862
[ AC_MSG_ERROR ( [ lcov testing requested but --coverage linker flag does not work] ) ] )
860
863
AX_CHECK_COMPILE_FLAG ( [ --coverage] ,[ CORE_CXXFLAGS="$CORE_CXXFLAGS --coverage"] ,
861
864
[ AC_MSG_ERROR ( [ lcov testing requested but --coverage flag does not work] ) ] )
862
- dnl If coverage is enabled, and the user hasn't overridden CXXFLAGS, clear
863
- dnl them, to prevent autoconfs "-g -O2" being added. Otherwise we'd end up
864
- dnl with "--coverage -Og -O0 -g -O2".
865
- if test "$CXXFLAGS_overridden" = "no"; then
866
- CXXFLAGS=""
867
- fi
868
865
CORE_CXXFLAGS="$CORE_CXXFLAGS -Og -O0"
869
866
fi
870
867
@@ -1996,7 +1993,7 @@ echo " CC = $CC"
1996
1993
echo " CFLAGS = $PTHREAD_CFLAGS $CFLAGS"
1997
1994
echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CORE_CPPFLAGS $CPPFLAGS"
1998
1995
echo " CXX = $CXX"
1999
- echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CORE_CXXFLAGS $CXXFLAGS"
1996
+ echo " CXXFLAGS = $CORE_CXXFLAGS $ DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CXXFLAGS"
2000
1997
echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $GPROF_LDFLAGS $CORE_LDFLAGS $LDFLAGS"
2001
1998
echo " AR = $AR"
2002
1999
echo " ARFLAGS = $ARFLAGS"
0 commit comments