diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2011-02-15 19:07:41 -0800 |
---|---|---|
committer | Dan Nicholson <dbn.lists@gmail.com> | 2011-02-15 19:10:25 -0800 |
commit | d9659f2ff1dae07ce935743bec7e0437cdade89b (patch) | |
tree | b43ed49656194a8c6a40d0f4171f5767cbe818ae /configure.ac | |
parent | a7463d1f3c08c8746fbadef573416f5f9af28205 (diff) |
Enable compiler warning flags and use them by default
For GCC, allow the warning flags to enabled. Turn them on by default so
we see things ahead of time.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 5f93b45..ee9baf7 100644 --- a/configure.ac +++ b/configure.ac @@ -21,6 +21,24 @@ AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package]) dnl AM_GLIB_GNU_GETTEXT +dnl Add extra C flags +AC_SUBST([E_CFLAGS]) +AC_ARG_ENABLE([warnings], + [AC_HELP_STRING([--disable-warnings], + [C compiler warnings (default: yes)])], + [warnings=$enableval], + [warnings=yes]) +if test "x$warnings" = xyes && test "x$GCC" = xyes; then + E_CFLAGS="-Wall -Wmissing-prototypes -Wmissing-declarations \ +-Wbad-function-cast" + case `$CC -dumpversion` in + 3.4.* | 4.*) + E_CFLAGS="$E_CFLAGS -Wold-style-definition \ +-Wdeclaration-after-statement" + ;; + esac +fi + AC_CONFIG_FILES([ Makefile previewer/Makefile |