From ccba6ba4f7a6e828f9445730e573b467b8097abd Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Fri, 23 Mar 2012 16:05:52 +0000 Subject: [PATCH] Add a --disable-gtk option, to make it easier to run valgrind --- src/config-store/wscript | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/config-store/wscript b/src/config-store/wscript index 55aa89719..7e614c2cb 100644 --- a/src/config-store/wscript +++ b/src/config-store/wscript @@ -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)