]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
test flto for clang (test #2)
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 11 Dec 2015 13:28:33 +0000 (13:28 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 11 Dec 2015 13:28:33 +0000 (13:28 +0000)
git-svn-id: file:///svn/unbound/trunk@3585 be551aaa-1e26-0410-a405-d3ace91eadb9

acx_nlnetlabs.m4
configure

index 8d889f545f1b3af1035b9b39d1abc7e07d697257..f17c6552d26d511b8db6c425cda36689966b03d7 100644 (file)
@@ -421,13 +421,12 @@ AC_DEFUN([ACX_CHECK_FLTO], [
     AS_IF([test "x$enable_flto" != "xno"], [
         AC_MSG_CHECKING([if $CC supports -flto])
         BAKCFLAGS="$CFLAGS"
-        CFLAGS="$CFLAGS -flto -Werror"
+        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
+            if $CC $CFLAGS -o conftest conftest.c 2>&1 | grep -e "warning: no debug symbols in executable" -e "warning: object" >/dev/null; then
                 CFLAGS="$BAKCFLAGS"
                 AC_MSG_RESULT(no)
             else
-                CFLAGS="$CFLAGS -flto"
                 AC_MSG_RESULT(yes)
             fi
             rm -f conftest conftest.c conftest.o
index 897ac7d070d08f3a6377d2bd91a1e17307da0380..35aa23f75cecd6c4789f8250286568a4c23176f5 100755 (executable)
--- a/configure
+++ b/configure
@@ -5859,7 +5859,7 @@ fi
         { $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 -Werror"
+        CFLAGS="$CFLAGS -flto"
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -5873,12 +5873,11 @@ 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
+            if $CC $CFLAGS -o conftest conftest.c 2>&1 | grep -e "warning: no debug symbols in executable" -e "warning: object" >/dev/null; then
                 CFLAGS="$BAKCFLAGS"
                 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
             else
-                CFLAGS="$CFLAGS -flto"
                 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
             fi