From ab27e4c68b8a5cf89e8534f3a5011083c558139a Mon Sep 17 00:00:00 2001 From: rofl0r Date: Sun, 6 Sep 2020 16:58:28 +0100 Subject: configure.ac: check for all "desired" CFLAGS at once in case they're all accepted, which would be the case with any halfways recent GCC, we save a lot of time over testing each flag sequentially. --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index a0503a4..782ee06 100644 --- a/configure.ac +++ b/configure.ac @@ -150,9 +150,15 @@ if test -n "${MAINTAINER_MODE_FALSE}"; then DESIRED_FLAGS="-Werror $DESIRED_FLAGS" fi +all_desired_work=false +AS_COMPILER_FLAG([$DESIRED_FLAGS], [all_desired_work=true]) +if $all_desired_work ; then + CFLAGS="$CFLAGS $DESIRED_FLAGS" +else for flag in $DESIRED_FLAGS; do AS_COMPILER_FLAG([$flag], [CFLAGS="$CFLAGS $flag"]) done +fi dnl Disable debugging if it's not specified if test x"$debug_enabled" != x"yes" ; then -- cgit v1.2.3