From 84ff1a680aa7652bb37e11f4ed1325be8f242700 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 30 Oct 2013 18:22:35 +0100 Subject: 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. --- configure.ac | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index a16d80e87..fd2d884a0 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) -- cgit v1.2.3