Skip to content

Commit d6ac25b

Browse files
committed
autoconf: Sane --enable-debug defaults.
Don't optimize at all when --enable-debug is supplied. This makes sure that nothing is optimized out.
1 parent 51a6e2c commit d6ac25b

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

configure.ac

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no)
239239
# Enable debug
240240
AC_ARG_ENABLE([debug],
241241
[AS_HELP_STRING([--enable-debug],
242-
[use debug compiler flags and macros (default is no)])],
242+
[use compiler flags and macros suited for debugging (default is no)])],
243243
[enable_debug=$enableval],
244244
[enable_debug=no])
245245

@@ -271,12 +271,9 @@ if test "x$enable_debug" = xyes; then
271271
if test "x$CXXFLAGS_overridden" = xno; then
272272
CXXFLAGS=""
273273
fi
274-
# Prefer -Og, fall back to -O0 if that is unavailable.
275-
AX_CHECK_COMPILE_FLAG(
276-
[-Og],
277-
[[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -Og"]],
278-
[AX_CHECK_COMPILE_FLAG([-O0],[[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -O0"]],,[[$CXXFLAG_WERROR]])],
279-
[[$CXXFLAG_WERROR]])
274+
275+
# Disable all optimizations
276+
AX_CHECK_COMPILE_FLAG([-O0], [[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -O0"]],,[[$CXXFLAG_WERROR]])
280277

281278
# Prefer -g3, fall back to -g if that is unavailable.
282279
AX_CHECK_COMPILE_FLAG(

0 commit comments

Comments
 (0)