]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Use -flto compiler flag for link time optimization, if supported.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 14 Jun 2011 08:39:53 +0000 (08:39 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 14 Jun 2011 08:39:53 +0000 (08:39 +0000)
git-svn-id: file:///svn/unbound/trunk@2427 be551aaa-1e26-0410-a405-d3ace91eadb9

configure
configure.ac
doc/Changelog

index 96bafefa8b043c6738712a8a57f82c78647b0c72..963df28891429f734449d8763c2a086bfe73f291 100755 (executable)
--- a/configure
+++ b/configure
@@ -5617,6 +5617,37 @@ $as_echo "#define UNBOUND_DEBUG /**/" >>confdefs.h
                ;;
 esac
 
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -flto" >&5
+$as_echo_n "checking whether $CC supports -flto... " >&6; }
+cache=`echo flto | sed 'y%.=/+-%___p_%'`
+if eval "test \"\${cv_prog_cc_flag_$cache+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+echo 'void f(){}' >conftest.c
+if test -z "`$CC $CPPFLAGS $CFLAGS -flto -c conftest.c 2>&1`"; then
+eval "cv_prog_cc_flag_$cache=yes"
+else
+eval "cv_prog_cc_flag_$cache=no"
+fi
+rm -f conftest conftest.o conftest.c
+
+fi
+
+if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+:
+CFLAGS="$CFLAGS -flto"
+else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+:
+
+fi
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
 $as_echo_n "checking for inline... " >&6; }
 if test "${ac_cv_c_inline+set}" = set; then :
index 7d47b637b248f280b378aa455f187d7be75aec29..318042c87b247c432fd18c5650bf0a33cab57c04 100644 (file)
@@ -225,6 +225,7 @@ case "$debug_enabled" in
                # nothing to do.
                ;;
 esac
+ACX_CHECK_COMPILER_FLAG(flto, [CFLAGS="$CFLAGS -flto"])
 
 AC_C_INLINE
 ACX_CHECK_FORMAT_ATTRIBUTE
index e22cb21fa55aabf55e35187959c25e165d92c78c..577d8fa6e4c05e24a4a96aedc69318d2b3aad0eb 100644 (file)
@@ -1,3 +1,6 @@
+14 June 2011: Wouter
+       - Use -flto compiler flag for link time optimization, if supported.
+
 12 June 2011: Wouter
        - IPv6 service address for d.root-servers.net (2001:500:2D::D).