From 737c03a75c62b3cd0ec92b33aea84d33dc39c2e7 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Fri, 29 Feb 2008 15:07:08 +0000 Subject: [PATCH] configure-enable-warnings-20080228 LICENSE IPL10 add a switch to turn on warnings when using gcc --- acinclude.m4 | 3 +++ src/cf/osconf.m4 | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index 8c6b96b..07c043b 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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" diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 index fc2501b..4352724 100644 --- a/src/cf/osconf.m4 +++ b/src/cf/osconf.m4 @@ -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) -- 1.9.4