[Xfce4-commits] <midori:master> Revisit full/ debug warning flags
Christian Dywan
noreply at xfce.org
Sat Nov 3 18:18:03 CET 2012
Updating branch refs/heads/master
to 46d39ce21204c72d55c69608bc0eeadc985f66bf (commit)
from 713928329f5c5e7a66af2b1d4284a49692f8e208 (commit)
commit 46d39ce21204c72d55c69608bc0eeadc985f66bf
Author: Christian Dywan <christian at twotoasts.de>
Date: Sat Nov 3 14:18:22 2012 +0100
Revisit full/ debug warning flags
extensions/wscript_build | 24 ++++++++++++------------
tests/wscript_build | 18 +++++++++---------
wscript | 46 +++++++++++++---------------------------------
3 files changed, 34 insertions(+), 54 deletions(-)
diff --git a/extensions/wscript_build b/extensions/wscript_build
index 5e2b41e..8bb4cdd 100644
--- a/extensions/wscript_build
+++ b/extensions/wscript_build
@@ -12,9 +12,7 @@ for extension in extensions:
target = extension
source = ''
for fila in files:
- if fila[-2:] == '.c':
- source += ' ' + extension + os.sep + fila
- elif 'VALAC' in bld.env and fila[-5:] == '.vala':
+ if fila[-2:] == '.c' or fila[-5:] == '.vala':
source += ' ' + extension + os.sep + fila
if not source:
Utils.pprint ('RED', folder + ': No source files found')
@@ -22,7 +20,7 @@ for extension in extensions:
else:
if extension[-2:] == '.c':
target = extension[:-2]
- elif 'VALAC' in bld.env and extension[-5:] == '.vala':
+ elif extension[-5:] == '.vala':
target = extension[:-5]
else:
continue
@@ -33,14 +31,16 @@ for extension in extensions:
obj.includes = '.. ../katze ../midori'
obj.source = source
obj.uselib = 'UNIQUE LIBSOUP GIO GTK SQLITE WEBKIT LIBXML HILDON CLUTTER GRANITE'
- obj.vapi_dirs = '../midori ../katze'
- obj.packages = 'glib-2.0 gio-2.0 libsoup-2.4 sqlite3 midori midori-core katze'
- if bld.env['HAVE_GTK3']:
- obj.packages += ' gtk+-3.0 webkitgtk-3.0'
- else:
- obj.packages += ' gtk+-2.0 webkit-1.0 unique-1.0'
- if bld.env['HAVE_GRANITE']:
- obj.packages += ' clutter-gtk-1.0 granite'
+ if 'vala' in source:
+ obj.env.append_value ('CCFLAGS', '-w')
+ obj.vapi_dirs = '../midori ../katze'
+ obj.packages = 'glib-2.0 gio-2.0 libsoup-2.4 sqlite3 midori midori-core katze'
+ if bld.env['HAVE_GTK3']:
+ obj.packages += ' gtk+-3.0 webkitgtk-3.0'
+ else:
+ obj.packages += ' gtk+-2.0 webkit-1.0 unique-1.0'
+ if bld.env['HAVE_GRANITE']:
+ obj.packages += ' clutter-gtk-1.0 granite'
obj.install_path = '${LIBDIR}/midori'
if bld.env['platform'] == 'win32':
obj.uselib_local = 'midori'
diff --git a/tests/wscript_build b/tests/wscript_build
index 85b0016..96780c8 100644
--- a/tests/wscript_build
+++ b/tests/wscript_build
@@ -12,9 +12,7 @@ for test in tests:
target = test
source = ''
for fila in files:
- if fila[-2:] == '.c':
- source += ' ' + test + os.sep + fila
- elif file[-5:] == '.vala':
+ if fila[-2:] == '.c' or fila[-5:] == '.vala':
source += ' ' + test + os.sep + fila
if not source:
Utils.pprint ('RED', folder + ': No source files found')
@@ -33,12 +31,14 @@ for test in tests:
obj.includes = '.. ../midori ../panels'
obj.cflags = ['-DEXTENSION_PATH="' + os.path.abspath ('_build/default/extensions') + '"']
obj.source = source
- obj.vapi_dirs = '../midori ../katze'
- obj.packages = 'glib-2.0 gio-2.0 libsoup-2.4 sqlite3 katze midori midori-core'
- if bld.env['HAVE_GTK3']:
- obj.packages += ' gtk+-3.0 webkitgtk-3.0'
- else:
- obj.packages += ' gtk+-2.0 webkit-1.0'
+ if 'vala' in source:
+ obj.env.append_value ('CCFLAGS', '-w')
+ obj.vapi_dirs = '../midori ../katze'
+ obj.packages = 'glib-2.0 gio-2.0 libsoup-2.4 sqlite3 katze midori midori-core'
+ if bld.env['HAVE_GTK3']:
+ obj.packages += ' gtk+-3.0 webkitgtk-3.0'
+ else:
+ obj.packages += ' gtk+-2.0 webkit-1.0'
obj.uselib = 'UNIQUE LIBSOUP GIO GTK SQLITE WEBKIT LIBXML GRANITE ZEITGEIST'
obj.uselib_local = 'midori-core'
obj.unit_test = 1
diff --git a/wscript b/wscript
index 3faf519..65ee3fe 100644
--- a/wscript
+++ b/wscript
@@ -339,11 +339,6 @@ def configure (conf):
conf.env.append_value ('CCFLAGS', '-DHAVE_CONFIG_H -include config.h'.split ())
debug_level = Options.options.debug_level
compiler = conf.env['CC_NAME']
- if debug_level != '' and compiler != 'gcc':
- Utils.pprint ('RED', 'No debugging level support for ' + compiler)
- sys.exit (1)
- elif debug_level == '':
- debug_level = 'debug'
if debug_level == 'full':
conf.define ('PACKAGE_VERSION', '%s (debug)' % VERSION_FULL)
@@ -353,39 +348,24 @@ def configure (conf):
conf.env.append_value ('CCFLAGS', '-DMIDORI_VERSION_SUFFIX="%s"' % VERSION_SUFFIX)
conf.write_config_header ('config.h')
- if compiler == 'gcc':
- if debug_level == 'none':
- if 'CCFLAGS' in os.environ:
- conf.env.append_value ('CCFLAGS', os.environ['CCFLAGS'].split ())
- else:
- conf.env.append_value ('CCFLAGS', '-DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT'.split ())
- elif 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 -Wunsafe-loop-optimizations -Wmissing-include-dirs
+ if debug_level == 'debug':
+ conf.env.append_value ('VALAFLAGS', '--debug --enable-deprecated'.split ())
+ if compiler == 'gcc':
+ conf.env.append_value ('CCFLAGS', '-O2 -g -Wall -Wno-deprecated-declarations'.split ())
+ elif debug_level == 'full':
+ conf.env.append_value ('VALAFLAGS', '--debug --enable-checking'.split ())
+ if compiler == 'gcc':
conf.env.append_value ('CCFLAGS',
- '-Wall -Wextra -O1 -g '
+ '-O2 -g -Wall -Wextra -DG_ENABLE_DEBUG '
'-Waggregate-return -Wno-unused-parameter '
'-Wno-missing-field-initializers '
'-Wredundant-decls -Wmissing-noreturn '
'-Wshadow -Wpointer-arith -Wcast-align '
'-Winline -Wformat-security -fno-common '
'-Winit-self -Wundef -Wdeclaration-after-statement '
- '-Wmissing-format-attribute -Wnested-externs '
- # -DGSEAL_ENABLE
- '-DG_ENABLE_DEBUG -DG_DISABLE_DEPRECATED '
- '-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED '
- '-DGTK_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED '
- '-DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE'.split ())
- if debug_level == 'full':
- conf.env.append_value ('VALAFLAGS', '--debug --enable-checking'.split ())
- elif debug_level == 'debug':
- conf.env.append_value ('VALAFLAGS', '--debug'.split ())
- elif debug_level == 'none':
- conf.env.append_value ('VALAFLAGS', '--disable-assert')
- conf.env.append_value ('VALAFLAGS', '--enable-deprecated')
+ '-Wmissing-format-attribute -Wnested-externs'.split ())
+ conf.env.append_value ('CCFLAGS', '-Wno-unused-but-set-variable -Wno-unused-variable -Wno-comment'.split ())
+
print ('''
Localization: %(nls)s (intltool)
Icon optimizations: %(icons)s (rsvg-convert)
@@ -420,9 +400,9 @@ def set_options (opt):
opt.tool_options ('compiler_cc')
opt.get_option_group ('--check-c-compiler').add_option('-d', '--debug-level',
- action = 'store', default = '',
+ action = 'store', default = 'debug',
help = 'Specify the debugging level. [\'none\', \'debug\', \'full\']',
- choices = ['', 'none', 'debug', 'full'], dest = 'debug_level')
+ choices = ['none', 'debug', 'full'], dest = 'debug_level')
opt.tool_options ('gnu_dirs')
opt.parser.remove_option ('--oldincludedir')
opt.parser.remove_option ('--htmldir')
More information about the Xfce4-commits
mailing list