]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- configure --disable-flto option (from Robert Edmonds).
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 25 Jun 2013 07:25:31 +0000 (07:25 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 25 Jun 2013 07:25:31 +0000 (07:25 +0000)
git-svn-id: file:///svn/unbound/trunk@2916 be551aaa-1e26-0410-a405-d3ace91eadb9

acx_nlnetlabs.m4
configure
doc/Changelog

index e393817efb7e728a10be25a837959f9e054c8a92..719112645aa0685a0d1273818bc72aaad5557a7c 100644 (file)
@@ -2,7 +2,8 @@
 # Copyright 2009, Wouter Wijngaards, NLnet Labs.   
 # BSD licensed.
 #
-# Version 23
+# Version 24
+# 2013-06-25 FLTO has --disable-flto option.
 # 2013-05-03 Update W32_SLEEP for newer mingw that links but not defines it.
 # 2013-03-22 Fix ACX_RSRC_VERSION for long version numbers.
 # 2012-02-09 Fix AHX_MEMCMP_BROKEN with undef in compat/memcmp.h.
@@ -407,19 +408,22 @@ int test() {
 dnl Check if CC supports -flto.
 dnl in a way that supports clang and suncc (that flag does something else,
 dnl but fails to link).  It sets it in CFLAGS if it works.
-AC_DEFUN([ACX_CHECK_FLTO],
-[AC_MSG_CHECKING([if $CC supports -flto])
-BAKCFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -flto"
-AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
-    if $CC $CFLAGS -o conftest conftest.c 2>&1 | grep "warning: no debug symbols in executable" >/dev/null; then
-       CFLAGS="$BAKCFLAGS"
-       AC_MSG_RESULT(no)
-    else
-       AC_MSG_RESULT(yes)
-    fi
-    rm -f conftest conftest.c conftest.o
-], [CFLAGS="$BAKCFLAGS" ; AC_MSG_RESULT(no)])
+AC_DEFUN([ACX_CHECK_FLTO], [
+    AC_ARG_ENABLE([flto], AS_HELP_STRING([--disable-flto], [Disable link-time optimization]))
+    AS_IF([test "x$enable_flto" != "xno"], [
+        AC_MSG_CHECKING([if $CC supports -flto])
+        BAKCFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS -flto"
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
+            if $CC $CFLAGS -o conftest conftest.c 2>&1 | grep "warning: no debug symbols in executable" >/dev/null; then
+                CFLAGS="$BAKCFLAGS"
+                AC_MSG_RESULT(no)
+            else
+                AC_MSG_RESULT(yes)
+            fi
+            rm -f conftest conftest.c conftest.o
+        ], [CFLAGS="$BAKCFLAGS" ; AC_MSG_RESULT(no)])
+    ])
 ])
 
 dnl Check the printf-format attribute (if any)
index 7b5d11709ced8d35ffcd684aa1a5120f1d23c485..9dd79a2e72b2891ddb79639cc2c455a44bdeb106 100755 (executable)
--- a/configure
+++ b/configure
@@ -797,6 +797,7 @@ with_rootcert_file
 with_username
 enable_checking
 enable_debug
+enable_flto
 enable_shared
 enable_static
 with_pic
@@ -1454,6 +1455,7 @@ Optional Features:
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --enable-checking       Enable warnings, asserts, makefile-dependencies
   --enable-debug          same as enable-checking
+  --disable-flto          Disable link-time optimization
   --enable-shared[=PKGS]  build shared libraries [default=yes]
   --enable-static[=PKGS]  build static libraries [default=yes]
   --enable-fast-install[=PKGS]
@@ -5762,11 +5764,19 @@ $as_echo "#define UNBOUND_DEBUG /**/" >>confdefs.h
                # nothing to do.
                ;;
 esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -flto" >&5
+
+    # Check whether --enable-flto was given.
+if test "${enable_flto+set}" = set; then :
+  enableval=$enable_flto;
+fi
+
+    if test "x$enable_flto" != "xno"; then :
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -flto" >&5
 $as_echo_n "checking if $CC supports -flto... " >&6; }
-BAKCFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -flto"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+        BAKCFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS -flto"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -5779,15 +5789,15 @@ main ()
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
 
-    if $CC $CFLAGS -o conftest conftest.c 2>&1 | grep "warning: no debug symbols in executable" >/dev/null; then
-       CFLAGS="$BAKCFLAGS"
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+            if $CC $CFLAGS -o conftest conftest.c 2>&1 | grep "warning: no debug symbols in executable" >/dev/null; then
+                CFLAGS="$BAKCFLAGS"
+                { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-    else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+            else
+                { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-    fi
-    rm -f conftest conftest.c conftest.o
+            fi
+            rm -f conftest conftest.c conftest.o
 
 else
   CFLAGS="$BAKCFLAGS" ; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -5796,6 +5806,8 @@ fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 
+fi
+
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
 $as_echo_n "checking for inline... " >&6; }
index b97bfb720fad8c28c043946a1aeab0c052113d4d..16016ba8bea029b7a3ce9170ad2b26c0846185d7 100644 (file)
@@ -1,6 +1,7 @@
 25 Jun 2013: Wouter
        - Squelch sendto-permission denied errors when the network is
          not connected, to avoid spamming syslog.
+       - configure --disable-flto option (from Robert Edmonds).
 
 18 Jun 2013: Wouter
        - Fix for const string literals in C++ for libunbound, from Karel