configure.ac: enable some gcc options even in debug mode

Most importantly: always disable C++ exceptions.  It was surprising to
see MPD terminate due to an unexpected exception.
This commit is contained in:
Max Kellermann 2013-10-30 18:22:35 +01:00
parent 90c899407a
commit 84ff1a680a

View File

@ -1459,22 +1459,26 @@ dnl ---------------------------------------------------------------------------
dnl CFLAGS
dnl ---------------------------------------------------------------------------
AX_APPEND_COMPILE_FLAGS([-fvisibility=hidden])
AC_LANG_PUSH([C++])
AX_APPEND_COMPILE_FLAGS([-fvisibility=hidden])
AX_APPEND_COMPILE_FLAGS([-fno-threadsafe-statics])
AX_APPEND_COMPILE_FLAGS([-fmerge-all-constants])
AX_APPEND_COMPILE_FLAGS([-fno-exceptions])
AX_APPEND_COMPILE_FLAGS([-fno-rtti])
AC_LANG_POP
dnl ---------------------------------- debug ----------------------------------
if test "x$enable_debug" = xno; then
AM_CPPFLAGS="$AM_CPPFLAGS -DNDEBUG"
AX_APPEND_COMPILE_FLAGS([-ffunction-sections])
AX_APPEND_COMPILE_FLAGS([-fdata-sections])
AX_APPEND_COMPILE_FLAGS([-fvisibility=hidden])
AC_LANG_PUSH([C++])
AX_APPEND_COMPILE_FLAGS([-ffunction-sections])
AX_APPEND_COMPILE_FLAGS([-fdata-sections])
AX_APPEND_COMPILE_FLAGS([-fvisibility=hidden])
AX_APPEND_COMPILE_FLAGS([-fno-threadsafe-statics])
AX_APPEND_COMPILE_FLAGS([-fmerge-all-constants])
AX_APPEND_COMPILE_FLAGS([-fno-exceptions])
AX_APPEND_COMPILE_FLAGS([-fno-rtti])
AC_LANG_POP
AX_APPEND_LINK_FLAGS([-Wl,--gc-sections])