From: Carl Worth Date: Thu, 13 Jun 2013 22:39:30 +0000 (-0700) Subject: configure: Move the code which detects compiler warning options X-Git-Url: https://git.cworth.org/git?p=fips;a=commitdiff_plain;h=33e5a6d5549381b79d1f556d46c396b681aea69a;hp=cef8e846eb37daa0a03cd57b187c624d3f7d1494 configure: Move the code which detects compiler warning options For no good reason, this code was previously stuck right in the middle of code reporting the final results of previous checks, (after the case reporting that errors were found and before the case reporting that no errors were found). It's more clean to have the warning-option detection happen before any of that reporting. --- diff --git a/configure b/configure index b63103e..679f543 100755 --- a/configure +++ b/configure @@ -331,6 +331,20 @@ if [ $have_gl_winsys -eq 0 ]; then errors=$((errors + 1)) fi +printf "int main(void){return 0;}\n" > minimal.c + +WARN_CFLAGS="" +printf "Checking for available C compiler warning flags:\n" +for flag in -Wall -Wextra -Wmissing-declarations; do + if ${CC} $flag -o minimal minimal.c > /dev/null 2>&1 + then + WARN_CFLAGS="${WARN_CFLAGS}${WARN_CFLAGS:+ }${flag}" + fi +done +printf "\t${WARN_CFLAGS}\n" + +rm -f minimal minimal.c + if [ $errors -gt 0 ]; then cat < minimal.c - -WARN_CFLAGS="" -printf "Checking for available C compiler warning flags... " -for flag in -Wall -Wextra -Wmissing-declarations; do - if ${CC} $flag -o minimal minimal.c > /dev/null 2>&1 - then - WARN_CFLAGS="${WARN_CFLAGS}${WARN_CFLAGS:+ }${flag}" - fi -done -printf "\n\t${WARN_CFLAGS}\n" - -rm -f minimal minimal.c - cat <