build: added --picky-developer and --fatal-errors
authorAndrew Tridgell <tridge@samba.org>
Fri, 9 Apr 2010 09:54:40 +0000 (19:54 +1000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 9 Apr 2010 10:31:06 +0000 (20:31 +1000)
Added configure options for --fatal-errors and --picky-developer. This
removes -Wfatal-errors from the --enable-developer flags.

buildtools/wafsamba/samba_autoconf.py
buildtools/wafsamba/wscript

index 32c7463981723ce4b11c77acc2dc509175bd0723..4731a4e13d5db52b9946442796dd4aafc6fd04ac 100644 (file)
@@ -541,9 +541,15 @@ def SAMBA_CONFIG_H(conf, path=None):
 
     if Options.options.developer:
         # we add these here to ensure that -Wstrict-prototypes is not set during configure
-        conf.ADD_CFLAGS('-Wall -g -Wfatal-errors -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k',
+        conf.ADD_CFLAGS('-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k',
                         testflags=True)
 
+    if Options.options.picky_developer:
+        conf.ADD_CFLAGS('-Werror', testflags=True)
+
+    if Options.options.fatal_errors:
+        conf.ADD_CFLAGS('-Wfatal-errors', testflags=True)
+
     if Options.options.pedantic:
         conf.ADD_CFLAGS('-W', testflags=True)
 
index 9bef9b63b01531c089c25819243feea0369738a5..1ae6b976403b547f60d366a43ee668a22798fc73 100644 (file)
@@ -45,6 +45,12 @@ def set_options(opt):
     opt.add_option('--enable-developer',
                    help=("Turn on developer warnings and debugging"),
                    action="store_true", dest='developer', default=False)
+    opt.add_option('--picky-developer',
+                   help=("Treat all warnings as errors (enable -Werror)"),
+                   action="store_true", dest='picky_developer', default=False)
+    opt.add_option('--fatal-errors',
+                   help=("Stop compilation on first error (enable -Wfatal-errors)"),
+                   action="store_true", dest='fatal_errors', default=False)
     opt.add_option('--enable-gccdeps',
                    help=("Enable use gcc -MD dependency module"),
                    action="store_true", dest='enable_gccdeps', default=False)