Tweak configure script to use autoconf macros

This commit is contained in:
Dianne Skoll
2022-03-22 10:40:41 -04:00
parent 92af4e9c3e
commit a303fb9cba
2 changed files with 17 additions and 4 deletions

12
configure vendored
View File

@@ -3975,8 +3975,16 @@ if test "$GCC" = yes; then
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $f" >&5
$as_echo_n "checking whether $CC supports $f... " >&6; }
if $CC -E $f /dev/null > /dev/null 2>&1 ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
CFLAGS="$CFLAGS $f"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
done
fi

View File

@@ -48,8 +48,13 @@ if test "$GCC" = yes; then
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
AC_MSG_CHECKING([whether $CC supports $f])
if $CC -E $f /dev/null > /dev/null 2>&1 ; then
AC_MSG_RESULT([yes])
CFLAGS="$CFLAGS $f"
else
AC_MSG_RESULT([no])
fi
done
fi