diff --git a/configure b/configure index 557ac101..996d1984 100755 --- a/configure +++ b/configure @@ -3306,7 +3306,6 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5 $as_echo_n "checking for sqrt in -lm... " >&6; } if ${ac_cv_lib_m_sqrt+:} false; then : @@ -3973,7 +3972,12 @@ fi if test "$GCC" = yes; then - CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes -flto=auto -ffat-lto-objects" + CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes" + # Check for link-time optimization support + for f in -flto=auto -ffat-lto-objects; do + echo -n "Checking if C compiler supports $f... " + if $CC -E $f /dev/null > /dev/null 2>&1 ; then echo "yes"; CFLAGS="$CFLAGS $f"; else echo "no"; fi + done fi if test "$ac_cv_perlartifacts" = "yes" ; then diff --git a/configure.in b/configure.in index dfe2d118..2e289dd2 100644 --- a/configure.in +++ b/configure.in @@ -28,8 +28,6 @@ AC_PROG_MAKE_SET AC_PATH_PROG([PERL], [perl]) dnl Checks for libraries. -dnl Replace `main' with a function in -lm: - AC_CHECK_LIB(m, sqrt) dnl Integer sizes @@ -47,7 +45,12 @@ AC_FUNC_UTIME_NULL AC_HEADER_TIME if test "$GCC" = yes; then - CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes -flto=auto -ffat-lto-objects" + CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes" + # Check for link-time optimization support + for f in -flto=auto -ffat-lto-objects; do + echo -n "Checking if C compiler supports $f... " + if $CC -E $f /dev/null > /dev/null 2>&1 ; then echo "yes"; CFLAGS="$CFLAGS $f"; else echo "no"; fi + done fi if test "$ac_cv_perlartifacts" = "yes" ; then