in maintainer mode, build with -Werror
authorMartin Pitt <martin.pitt@ubuntu.com>
Wed, 3 Mar 2010 21:06:09 +0000 (22:06 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Wed, 3 Mar 2010 21:25:41 +0000 (22:25 +0100)
With --enable-maintainer-mode, or with --enable-strict, build with -Werror.

configure.ac

index be9562c..d4c46a7 100644 (file)
@@ -23,6 +23,7 @@ AC_ARG_ENABLE(ansi,             [  --enable-ansi           enable -ansi -pedanti
 AC_ARG_ENABLE(verbose-mode,     [  --enable-verbose-mode   support verbose debug mode],enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
 AC_ARG_ENABLE(man-pages,        [  --enable-man-pages      build manual pages],enable_man_pages=$enableval,enable_man_pages=yes)
 AC_ARG_ENABLE(profiling,        [  --enable-profiling      add tracing instrumentation for plot-timeline.py], enable_profiling=$enableval,enable_profiling=$USE_MAINTAINER_MODE)
++AC_ARG_ENABLE(strict,           [  --enable-strict         Enable strict compilation options], enable_strict=$enableval,enable_strict=$USE_MAINTAINER_MODE)
 
 if test "x$enable_profiling" = "xyes"; then
   AC_DEFINE(PROFILING, 1, [Define to 1 if profiling is enabled ])
@@ -111,6 +112,11 @@ if test "x$GCC" = "xyes"; then
     *) CFLAGS="$CFLAGS -pedantic" ;;
     esac
   fi
+
+  if test "x$enable_strict" = "xyes"; then
+    CFLAGS="$CFLAGS -Werror"
+  fi
+
   changequote([,])dnl
 fi