]> git.cworth.org Git - fips/commitdiff
configure: Move the code which detects compiler warning options
authorCarl Worth <cworth@cworth.org>
Thu, 13 Jun 2013 22:39:30 +0000 (15:39 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 13 Jun 2013 22:46:07 +0000 (15:46 -0700)
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

index b63103eaa697a25822d7a481b8629991af77b8e9..679f543ed2f93cea6f4feb2fd37409be134f7c5f 100755 (executable)
--- 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 <<EOF
 
@@ -385,20 +399,6 @@ EOF
     exit 1
 fi
 
-printf "int main(void){return 0;}\n" > 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 <<EOF
 
 All required packages were found.