From 33e5a6d5549381b79d1f556d46c396b681aea69a Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 13 Jun 2013 15:39:30 -0700 Subject: [PATCH] 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. --- configure | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) 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 <