diff --git a/bindings/python/ns3modulegen.py b/bindings/python/ns3modulegen.py index e974d3c6a..e2e261b5b 100755 --- a/bindings/python/ns3modulegen.py +++ b/bindings/python/ns3modulegen.py @@ -110,16 +110,17 @@ def main(): mod = __import__(local_module) mod.register_functions(root_module) + enabled_features = os.environ['NS3_ENABLED_FEATURES'].split(',') # if GtkConfigStore support is disabled, disable the class wrapper - if 'DISABLE_GTK_CONFIG_STORE' in os.environ: + if 'GtkConfigStore' not in enabled_features: try: root_module.classes.remove(root_module['ns3::GtkConfigStore']) except KeyError: pass # if no sqlite, the class SqliteDataOutput is disabled - if 'SQLITE_STATS' in os.environ: + if 'SqliteDataOutput' not in enabled_features: try: root_module.classes.remove(root_module['ns3::SqliteDataOutput']) except KeyError: diff --git a/bindings/python/wscript b/bindings/python/wscript index 582fe6d49..27c5b4275 100644 --- a/bindings/python/wscript +++ b/bindings/python/wscript @@ -404,10 +404,11 @@ def build(bld): bindgen.prio = 50 bindgen.os_env = dict(os.environ) - if not env['ENABLE_GTK_CONFIG_STORE']: - bindgen.os_env['DISABLE_GTK_CONFIG_STORE'] = "1" - if not env['SQLITE_STATS']: - bindgen.os_env['SQLITE_STATS'] = "1" + features = [] + for (name, caption, was_enabled, reason_not_enabled) in env['NS3_OPTIONAL_FEATURES']: + if was_enabled: + features.append(name) + bindgen.os_env['NS3_ENABLED_FEATURES'] = ','.join(features) ## we build python bindings if either we have the tools to