buildtools: Add --enable-debug option
authorAndrew Bartlett <abartlet@samba.org>
Tue, 10 Apr 2012 22:08:44 +0000 (08:08 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 11 Apr 2012 00:30:39 +0000 (02:30 +0200)
buildtools/wafsamba/samba_autoconf.py
buildtools/wafsamba/wscript

index 2bb86c786c2ee2275bb3d0a7a71533d6dbeb6f26..08df2b3c2f26a1eaa55e803622b824703db34ce9 100644 (file)
@@ -599,6 +599,10 @@ def SAMBA_CONFIG_H(conf, path=None):
     if not IN_LAUNCH_DIR(conf):
         return
 
+    if Options.options.debug:
+        conf.ADD_CFLAGS('-g',
+                        testflags=True)
+
     if Options.options.developer:
         # we add these here to ensure that -Wstrict-prototypes is not set during configure
         conf.ADD_CFLAGS('-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k -Wmissing-prototypes -fno-common',
index a302280038aa62d829f420553bcfb241f88ee8e3..ff18777575cdfe121541cad973f11afe9d55b5cc 100755 (executable)
@@ -81,6 +81,9 @@ def set_options(opt):
     gr.add_option('--enable-auto-reconfigure',
                    help='enable automatic reconfigure on build',
                    action='store_true', dest='enable_auto_reconfigure')
+    gr.add_option('--enable-debug',
+                   help=("Turn on debugging symbols"),
+                   action="store_true", dest='debug', default=False)
     gr.add_option('--enable-developer',
                    help=("Turn on developer warnings and debugging"),
                    action="store_true", dest='developer', default=False)