diff -r fe173cd3652b src/config-store/wscript --- a/src/config-store/wscript Fri Aug 19 12:46:14 2011 -0400 +++ b/src/config-store/wscript Tue Aug 23 12:33:40 2011 -0700 @@ -2,18 +2,58 @@ 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 have_gtk: + # Check that GTK works on the user's machine. + fragment = r""" +#include +int main () +{ + gtk_init (0, 0); + return 0; +} +""" + gtk_works = conf.check(fragment=fragment, msg="Checking that GTK works", + okmsg="complete", errmsg='incomplete', + mandatory=False, uselib="GTK_CONFIG_STORE") + conf.report_optional_feature("GtkConfigStore", "GtkConfigStore", + gtk_works, + "library 'gtk+-2.0 >= 2.12' found but conf.check failed") + conf.env['ENABLE_GTK_CONFIG_STORE'] = gtk_works + else: + conf.env['ENABLE_GTK_CONFIG_STORE'] = False + 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) - conf.env['ENABLE_LIBXML2'] = have_libxml2 - conf.report_optional_feature("XmlIo", "XmlIo", - conf.env['ENABLE_LIBXML2'], - "library 'libxml-2.0 >= 2.7' not found") + # Check that LIBXML2 works on the user's machine. + fragment = r""" +#include +int main () +{ + int test = xmlUCSIsArabic (0); + test *= 1; + return 0; +} +""" + libxml2_works = conf.check(fragment=fragment, msg="Checking that LIBXML2 works", + okmsg="complete", errmsg='incomplete', + mandatory=False, uselib="LIBXML2") + conf.report_optional_feature("XmlIo", "XmlIo", + libxml2_works, + "library 'libxml-2.0 >= 2.6' found but conf.check failed") + conf.env['ENABLE_LIBXML2'] = libxml2_works + else: + conf.env['ENABLE_LIBXML2'] = False + conf.report_optional_feature("XmlIo", "XmlIo", + conf.env['ENABLE_LIBXML2'], + "library 'libxml-2.0 >= 2.6' not found") + conf.write_config_header('ns3/config-store-config.h', top=True)