diff --git a/src/stats/bindings/modulegen_customizations.py b/src/stats/bindings/modulegen_customizations.py index e2e56ed26..cd3297186 100644 --- a/src/stats/bindings/modulegen_customizations.py +++ b/src/stats/bindings/modulegen_customizations.py @@ -3,10 +3,10 @@ import os def post_register_types(root_module): enabled_features = os.environ['NS3_ENABLED_FEATURES'].split(',') - # if no sqlite, the class SqliteDataOutput is disabled - if 'SqliteDataOutput' not in enabled_features: - try: - root_module.classes.remove(root_module['ns3::SqliteDataOutput']) - except KeyError: - pass - + # If no sqlite support, disable bindings for those (optional) features + if 'SQLiteStats' not in enabled_features: + for clsname in ['SimpleRefCount< ns3::SQLiteOutput, ns3::empty, ns3::DefaultDeleter >', 'SQLiteOutput', 'SqliteDataOutput', 'DefaultDeleter< ns3::SQLiteOutput >']: + try: + root_module.classes.remove(root_module['ns3::%s' % clsname]) + except: + pass diff --git a/src/stats/wscript b/src/stats/wscript index c4794ed52..3673e9b97 100644 --- a/src/stats/wscript +++ b/src/stats/wscript @@ -6,11 +6,11 @@ def configure(conf): mandatory=False) conf.env['SQLITE_STATS'] = have_sqlite3 - conf.report_optional_feature("SqliteDataOutput", "SQlite stats data output", - conf.env['SQLITE_STATS'], - "library 'sqlite3' not found") have_sem = conf.check_nonfatal(header_name='semaphore.h', define_name='HAVE_SEMAPHORE_H') conf.env['SEMAPHORE_ENABLED'] = have_sem + conf.report_optional_feature("SQLiteStats", "SQLite stats support", + conf.env['SQLITE_STATS'] and conf.env['SEMAPHORE_ENABLED'], + "library 'sqlite3' and/or semaphore.h not found") conf.write_config_header('ns3/stats-config.h', top=True) def build(bld):