]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #2034 - Autoconf and -flto.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 3 Nov 2017 10:52:25 +0000 (10:52 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 3 Nov 2017 10:52:25 +0000 (10:52 +0000)
git-svn-id: file:///svn/unbound/trunk@4397 be551aaa-1e26-0410-a405-d3ace91eadb9

configure
configure.ac
doc/Changelog

index 96fb7eb19babacb388f2907e74d96c54e71b3771..1c57b61ed664e2139825221ad643b57d67385a86 100755 (executable)
--- a/configure
+++ b/configure
@@ -4429,6 +4429,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 # allow user to override the -g -O2 flags.
+default_cflags=no
 if test "x$CFLAGS" = "x" ; then
 
 
@@ -4492,6 +4493,7 @@ $as_echo "no" >&6; }
 
 fi
 
+default_cflags=yes
 fi
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -5945,6 +5947,10 @@ $as_echo "#define UNBOUND_DEBUG /**/" >>confdefs.h
                # nothing to do.
                ;;
 esac
+if test "$default_cflags" = "yes"; then
+       # only when CFLAGS was "" at the start, if the users wants to
+       # override we shouldn't add default cflags, because they wouldn't
+       # be able to turn off these options and set the CFLAGS wanted.
 
     # Check whether --enable-flto was given.
 if test "${enable_flto+set}" = set; then :
@@ -6079,6 +6085,7 @@ rm -f core conftest.err conftest.$ac_objext \
 
 fi
 
+fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
 $as_echo_n "checking for inline... " >&6; }
index 5c2059ed793f5d95660cb0e997171984fbbf8eb7..f5093a3eb90066ddde11f75b3e8cfea0b5c1e3d4 100644 (file)
@@ -246,9 +246,11 @@ AC_DEFINE_UNQUOTED(RSRC_PACKAGE_VERSION, [$wnvs], [version number for resource f
 AC_C_CONST
 AC_LANG_C
 # allow user to override the -g -O2 flags.
+default_cflags=no
 if test "x$CFLAGS" = "x" ; then
 ACX_CHECK_COMPILER_FLAG(g, [CFLAGS="$CFLAGS -g"])
 ACX_CHECK_COMPILER_FLAG(O2, [CFLAGS="$CFLAGS -O2"])
+default_cflags=yes
 fi
 AC_PROG_CC
 ACX_DEPFLAG
@@ -272,9 +274,14 @@ case "$debug_enabled" in
                # nothing to do.
                ;;
 esac
-ACX_CHECK_FLTO
-ACX_CHECK_PIE
-ACX_CHECK_RELRO_NOW
+if test "$default_cflags" = "yes"; then
+       # only when CFLAGS was "" at the start, if the users wants to
+       # override we shouldn't add default cflags, because they wouldn't
+       # be able to turn off these options and set the CFLAGS wanted.
+       ACX_CHECK_FLTO
+       ACX_CHECK_PIE
+       ACX_CHECK_RELRO_NOW
+fi
 
 AC_C_INLINE
 ACX_CHECK_FORMAT_ATTRIBUTE
index 5e9b0a8cb98e099a30d1af13499100c11d69dd4a..69442680311d3d8da8831ba5e73b8d9c01a6e06c 100644 (file)
@@ -1,5 +1,6 @@
 3 November 2017: Wouter 
        - Fix #2362: TLS1.3/openssl-1.1.1 not working.
+       - Fix #2034 - Autoconf and -flto.
 
 2 November 2017: Wouter 
        - Fix #1913: ub_ctx_config is under circumstances thread-safe.