Add a --disable-gtk option, to make it easier to run valgrind

This commit is contained in:
Gustavo J. A. M. Carneiro
2012-03-23 16:05:52 +00:00
parent 8bc5c5294d
commit ccba6ba4f7

View File

@@ -1,13 +1,27 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import wutils
from waflib import Options
def options(opt):
opt.add_option('--disable-gtk',
help=('Disable GTK+ support'),
dest='disable_gtk', default=False, action="store_true")
def configure(conf):
have_gtk = conf.pkg_check_modules('GTK_CONFIG_STORE', 'gtk+-2.0 >= 2.12', mandatory=False)
conf.env['ENABLE_GTK_CONFIG_STORE'] = have_gtk
conf.report_optional_feature("GtkConfigStore", "GtkConfigStore",
conf.env['ENABLE_GTK_CONFIG_STORE'],
"library 'gtk+-2.0 >= 2.12' not found")
if Options.options.disable_gtk:
conf.env['ENABLE_GTK_CONFIG_STORE'] = False
conf.report_optional_feature("GtkConfigStore", "GtkConfigStore",
conf.env['ENABLE_GTK_CONFIG_STORE'],
"--disable-gtk option given")
else:
have_gtk = conf.pkg_check_modules('GTK_CONFIG_STORE', 'gtk+-2.0 >= 2.12', mandatory=False)
conf.env['ENABLE_GTK_CONFIG_STORE'] = have_gtk
conf.report_optional_feature("GtkConfigStore", "GtkConfigStore",
conf.env['ENABLE_GTK_CONFIG_STORE'],
"library 'gtk+-2.0 >= 2.12' not found")
have_libxml2 = conf.pkg_check_modules('LIBXML2', 'libxml-2.0 >= 2.6', mandatory=False)
if have_libxml2:
conf.define('HAVE_LIBXML2', 1)