From 3fa0a88c0540f6cd68807d5dfe092fec09d1181a Mon Sep 17 00:00:00 2001 From: "Malte S. Stretz" Date: Tue, 14 Jun 2011 11:00:43 +0200 Subject: [PATCH] Enable link-time optimization. Results in a 15% smaller (and probably quicker) binary. --- configure.ac | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/configure.ac b/configure.ac index ce7e3e5..df12f16 100644 --- a/configure.ac +++ b/configure.ac @@ -68,6 +68,20 @@ else CFLAGS="$save_cflags" fi +AC_MSG_CHECKING(if your C compiler has a link-time optimizer) +if test x$GCC = xyes; then + save_cflags="$CFLAGS" + CFLAGS="-flto $CFLAGS" + if (eval $ac_link) 2>/dev/null; then + AC_MSG_RESULT(sure does) + else + AC_MSG_RESULT(no) + CFLAGS="$save_cflags" + fi +else + AC_MSG_RESULT(skipped) +fi + AC_ARG_ENABLE(mad-warnings, AS_HELP_STRING([--enable-mad-warnings], [turn on lots of compile-time warnings, this needs GCC and is only really useful for development]), -- 2.17.1