diff --git a/acinclude.m4 b/acinclude.m4 index 64699d632b..f80df55a31 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -90,6 +90,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 1a5197dac9..0161f1f0df 100644 --- a/src/cf/osconf.m4 +++ b/src/cf/osconf.m4 @@ -1114,6 +1114,12 @@ else NO_STRIP_KRB=-ns fi +if test "x$enable_warnings" = "xyes"; then + if test "x$GCC" = "xyes"; then + XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition" + fi +fi + AC_SUBST(CCXPG2) AC_SUBST(CCOBJ) AC_SUBST(AFSD_LIBS)