]> spindle.queued.net Git - midori/commitdiff
Shift selection of debug-level
authorSebastian Andrzej Siewior <sebastian@breakpoint.cc>
Sat, 28 Mar 2009 22:00:32 +0000 (23:00 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sat, 28 Mar 2009 22:00:32 +0000 (23:00 +0100)
Currently configure switches on gcc to debug mode what means -O0. Adding
-d none does not help because it is filtered out earlier. -d bla would
help if bla were an allowed keyword.
This patch simply shifts the "compiler is gcc" block to the left so -O2 is
selected if the user selected -d none on the command line. Other compilers
remain with no extra switches.

wscript

diff --git a/wscript b/wscript
index c55554124e0a7537eb7abef3f06b3ef87a673c83..4ee9d820ba4d559c2e7a10ee76a8889bf4f4659b 100644 (file)
--- a/wscript
+++ b/wscript
@@ -181,28 +181,27 @@ def configure (conf):
             debug_level = 'debug'
         else:
             debug_level = 'none'
-    if debug_level != 'none':
-        if compiler == 'gcc':
-            if debug_level == 'debug':
-                conf.env.append_value ('CCFLAGS', '-Wall -O0 -g'.split ())
-            elif debug_level == 'full':
-                # -Wdeclaration-after-statement
-                # -Wmissing-declarations -Wmissing-prototypes
-                # -Wwrite-strings
-                conf.env.append_value ('CCFLAGS',
-                    '-Wall -Wextra -O1 -g '
-                    '-Waggregate-return -Wno-unused-parameter '
-                    '-Wno-missing-field-initializers '
-                    '-Wunsafe-loop-optimizations '
-                    '-Wredundant-decls -Wmissing-noreturn '
-                    '-Wshadow -Wpointer-arith -Wcast-align '
-                    '-Winline -Wformat-security '
-                    '-Winit-self -Wmissing-include-dirs -Wundef '
-                    '-Wmissing-format-attribute -Wnested-externs '
-                    '-DG_ENABLE_DEBUG'.split ())
-            else:
-                conf.env.append_value ('CCFLAGS', '-O2')
+    if compiler == 'gcc':
+        if debug_level == 'debug':
+            conf.env.append_value ('CCFLAGS', '-Wall -O0 -g'.split ())
+        elif debug_level == 'full':
+            # -Wdeclaration-after-statement
+            # -Wmissing-declarations -Wmissing-prototypes
+            # -Wwrite-strings
+            conf.env.append_value ('CCFLAGS',
+                '-Wall -Wextra -O1 -g '
+                '-Waggregate-return -Wno-unused-parameter '
+                '-Wno-missing-field-initializers '
+                '-Wunsafe-loop-optimizations '
+                '-Wredundant-decls -Wmissing-noreturn '
+                '-Wshadow -Wpointer-arith -Wcast-align '
+                '-Winline -Wformat-security '
+                '-Winit-self -Wmissing-include-dirs -Wundef '
+                '-Wmissing-format-attribute -Wnested-externs '
+                '-DG_ENABLE_DEBUG'.split ())
         else:
+            conf.env.append_value ('CCFLAGS', '-O2')
+    elif debug_level != 'none':
             Utils.pprint ('RED', 'No debugging level support for ' + compiler)
             sys.exit (1)