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
Vendored
+6 -2
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