- configure --disable-flto option (from Robert Edmonds).

git-svn-id: file:///svn/unbound/trunk@2916 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2013-06-25 07:25:31 +00:00
parent 18e488ec5d
commit 13f2131a97
3 changed files with 42 additions and 25 deletions

View 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)

34
configure vendored
View file

@ -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; }

View 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