diff --git a/configure b/configure index d9b9691f..4a3b6042 100755 --- a/configure +++ b/configure @@ -4231,6 +4231,7 @@ U="`uname -s`" if test "$U" != "SunOS" -a "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes" # Check for link-time optimization support + OLDCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -flto=auto" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -flto=auto" >&5 printf %s "checking whether $CC supports -flto=auto... " >&6; } @@ -4258,10 +4259,11 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lto" >&5 printf "%s\n" "$lto" >&6; } if test "x$lto" != "xyes" ; then - CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes" + CFLAGS="$OLDCFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -ffat-lto-object" >&5 printf %s "checking whether $CC supports -ffat-lto-object... " >&6; } + OLDCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Werror -ffat-lto-objects" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4287,7 +4289,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lto" >&5 printf "%s\n" "$lto" >&6; } if test "x$lto" != "xyes" ; then - CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes -flto=auto" + CFLAGS="$OLDCFLAGS" + else + CFLAGS="$OLDCFLAGS -ffat-lto-objects" fi fi fi diff --git a/configure.ac b/configure.ac index c62522a7..1cf91ff2 100644 --- a/configure.ac +++ b/configure.ac @@ -50,6 +50,7 @@ U="`uname -s`" if test "$U" != "SunOS" -a "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes" # Check for link-time optimization support + OLDCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -flto=auto" AC_MSG_CHECKING([whether $CC supports -flto=auto]) AC_LINK_IFELSE( @@ -61,9 +62,10 @@ if test "$U" != "SunOS" -a "$GCC" = yes; then ) AC_MSG_RESULT([$lto]) if test "x$lto" != "xyes" ; then - CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes" + CFLAGS="$OLDCFLAGS" else AC_MSG_CHECKING([whether $CC supports -ffat-lto-object]) + OLDCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Werror -ffat-lto-objects" AC_LINK_IFELSE( [AC_LANG_PROGRAM( @@ -74,7 +76,9 @@ if test "$U" != "SunOS" -a "$GCC" = yes; then ) AC_MSG_RESULT([$lto]) if test "x$lto" != "xyes" ; then - CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes -flto=auto" + CFLAGS="$OLDCFLAGS" + else + CFLAGS="$OLDCFLAGS -ffat-lto-objects" fi fi fi