Use the information provided by conf.report_optional_feature() to enable/disable python bindings for optional APIs
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Sat, 06 Sep 2008 19:24:32 +0100
changeset 36398e69ebf086f1
parent 3637 a6d8bf62a61d
child 3640 f21114ef31de
Use the information provided by conf.report_optional_feature() to enable/disable python bindings for optional APIs
bindings/python/ns3modulegen.py
bindings/python/wscript
     1.1 --- a/bindings/python/ns3modulegen.py	Sat Sep 06 14:46:01 2008 +0100
     1.2 +++ b/bindings/python/ns3modulegen.py	Sat Sep 06 19:24:32 2008 +0100
     1.3 @@ -110,16 +110,17 @@
     1.4          mod = __import__(local_module)
     1.5          mod.register_functions(root_module)
     1.6  
     1.7 +    enabled_features = os.environ['NS3_ENABLED_FEATURES'].split(',')
     1.8  
     1.9      # if GtkConfigStore support is disabled, disable the class wrapper
    1.10 -    if 'DISABLE_GTK_CONFIG_STORE' in os.environ:
    1.11 +    if 'GtkConfigStore' not in enabled_features:
    1.12          try:
    1.13              root_module.classes.remove(root_module['ns3::GtkConfigStore'])
    1.14          except KeyError:
    1.15              pass
    1.16  
    1.17      # if no sqlite, the class SqliteDataOutput is disabled
    1.18 -    if 'SQLITE_STATS' in os.environ:
    1.19 +    if 'SqliteDataOutput' not in enabled_features:
    1.20          try:
    1.21              root_module.classes.remove(root_module['ns3::SqliteDataOutput'])
    1.22          except KeyError:
     2.1 --- a/bindings/python/wscript	Sat Sep 06 14:46:01 2008 +0100
     2.2 +++ b/bindings/python/wscript	Sat Sep 06 19:24:32 2008 +0100
     2.3 @@ -404,10 +404,11 @@
     2.4          bindgen.prio = 50
     2.5  
     2.6          bindgen.os_env = dict(os.environ)
     2.7 -        if not env['ENABLE_GTK_CONFIG_STORE']:
     2.8 -            bindgen.os_env['DISABLE_GTK_CONFIG_STORE'] = "1"
     2.9 -        if not env['SQLITE_STATS']:
    2.10 -            bindgen.os_env['SQLITE_STATS'] = "1"
    2.11 +        features = []
    2.12 +        for (name, caption, was_enabled, reason_not_enabled) in env['NS3_OPTIONAL_FEATURES']:
    2.13 +            if was_enabled:
    2.14 +                features.append(name)
    2.15 +        bindgen.os_env['NS3_ENABLED_FEATURES'] = ','.join(features)
    2.16  
    2.17  
    2.18      ## we build python bindings if either we have the tools to