Only use -flto=auto and -ffat-lto-objects if C compiler supports them.

This commit is contained in:
Dianne Skoll
2022-03-22 10:33:36 -04:00
parent abc4f45fed
commit 92af4e9c3e
2 changed files with 12 additions and 5 deletions

8
configure vendored
View File

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

View File

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