configure-enable-warnings-20080228
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Fri, 29 Feb 2008 15:07:08 +0000 (15:07 +0000)
committerDerrick Brashear <shadow@dementia.org>
Fri, 29 Feb 2008 15:07:08 +0000 (15:07 +0000)
LICENSE IPL10

add a switch to turn on warnings when using gcc

acinclude.m4
src/cf/osconf.m4

index 8c6b96b..07c043b 100644 (file)
@@ -88,6 +88,9 @@ AC_ARG_ENABLE(debug-pam,
 AC_ARG_ENABLE(optimize-pam,
 [  --disable-optimize-pam              disable optimization for compilation of the PAM code (defaults to enabled)],, enable_optimize_pam="yes"
 )
+AC_ARG_ENABLE(warnings,
+[  --enable-warnings                   enable compilation warnings when building with gcc (defaults to disabled)],, enable_warnings="no"
+)
 
 
 enable_login="no"
index fc2501b..4352724 100644 (file)
@@ -1087,6 +1087,12 @@ else
   NO_STRIP_BIN=
 fi
 
+if test "x$enable_warnings" = "xyes"; then
+  if test "x$GCC" = "xyes"; then
+    XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition"
+  fi
+fi
+
 INSTALL_PROGRAM="${INSTALL_PROGRAM} ${NO_STRIP_BIN}"
 
 AC_SUBST(CCXPG2)