From b25b7693baa8be5ab7f0fc727f17fb560b6208ae Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 2 Aug 2012 19:09:29 +0200 Subject: configure.ac: enable --gc-sections Produce a smaller binary by removing all unused functions. --- configure.ac | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 35135628..3c3add12 100644 --- a/configure.ac +++ b/configure.ac @@ -1485,6 +1485,16 @@ dnl --------------------------------------------------------------------------- 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]) + + AC_LANG_PUSH([C++]) + AX_APPEND_COMPILE_FLAGS([-ffunction-sections]) + AX_APPEND_COMPILE_FLAGS([-fdata-sections]) + AC_LANG_POP + + AX_APPEND_LINK_FLAGS([-Wl,--gc-sections]) fi dnl ----------------------------------- GCC ----------------------------------- -- cgit v1.2.3