Commit dff55f05 authored by Geoff Simmons's avatar Geoff Simmons

configure --enable-debugging works with C++ sources as well

parent a102c852
......@@ -136,16 +136,24 @@ AC_ARG_ENABLE(debugging,
[],
[enable_debugging=no])
# AC_PROG_CC sets CFLAGS to '-g -O2' unless it is already set, so
# there's no need to add -g. Disable or change by explicitly setting
# CFLAGS. If this option is enabled, then -Og or -O0 becomes the last
# optimization option, and hence takes precedence.
# AC_PROG_CC and AC_PROG_CXX set CFLAGS and CXXFLAGS to '-g -O2'
# unless already set, so there's no need to add -g. Disable or change
# by explicitly setting CFLAGS and/or CXXFLAGS. If this option is
# enabled, then -Og or -O0 becomes the last optimization option, and
# hence takes precedence.
if test "x$enable_debugging" != "xno"; then
CFLAGS="${CFLAGS} -fno-inline"
AX_CHECK_COMPILE_FLAG([-Og],
[CFLAGS="${CFLAGS} -Og"],
[CFLAGS="${CFLAGS} -O0"],
[])
AC_LANG_PUSH(C++)
CXXFLAGS="${CXXFLAGS} -fno-inline"
AX_CHECK_COMPILE_FLAG([-Og],
[CXXFLAGS="${CXXFLAGS} -Og"],
[CXXFLAGS="${CXXFLAGS} -O0"],
[])
AC_LANG_POP()
fi
AC_CONFIG_FILES([
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment