Enable -Wall by default.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 11 Oct 2011 22:04:51 -0400
changeset 5975 516c5c4e7bea
parent 5974 13e67468b846
child 5977 4e09b43f2525
Enable -Wall by default. Fixes Bugzilla #1284. (But probably upsets buildbot. :) )
configure.in
--- a/configure.in	Wed Oct 05 08:08:06 2011 -0700
+++ b/configure.in	Tue Oct 11 22:04:51 2011 -0400
@@ -939,6 +939,28 @@
     fi
 }
 
+dnl See if GCC's -Wall is supported.
+CheckWarnAll()
+{
+    AC_MSG_CHECKING(for GCC -Wall option)
+    have_gcc_Wall=no
+
+    save_CFLAGS="$CFLAGS"
+    CFLAGS="$save_CFLAGS -Wall"
+    AC_TRY_COMPILE([
+    int x = 0;
+    ],[
+    ],[
+    have_gcc_Wall=yes
+    ])
+    AC_MSG_RESULT($have_gcc_Wall)
+    CFLAGS="$save_CFLAGS"
+
+    if test x$have_gcc_Wall = xyes; then
+        EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
+    fi
+}
+
 
 dnl Find the X11 include and library directories
 CheckX11()
@@ -2356,6 +2378,9 @@
         ;;
 esac
 
+dnl Do this on all platforms, after everything else.
+CheckWarnAll
+
 # Verify that we have all the platform specific files we need
 
 if test x$have_joystick != xyes; then