diff --git a/bindings/python/ns3modulegen-modular.py b/bindings/python/ns3modulegen-modular.py index 2f5f178d1..b949d4d89 100644 --- a/bindings/python/ns3modulegen-modular.py +++ b/bindings/python/ns3modulegen-modular.py @@ -18,7 +18,8 @@ class ErrorHandler(pybindgen.settings.ErrorHandler): pybindgen.settings.error_handler = ErrorHandler() - +#print >> sys.stderr, ">>>>>>>>>>>>>>>>>>>>>>>>>>>> ", bool(eval(os.environ["GCC_RTTI_ABI_COMPLETE"])) +pybindgen.settings.gcc_rtti_abi_complete = bool(eval(os.environ["GCC_RTTI_ABI_COMPLETE"])) class MyMultiSectionFactory(MultiSectionFactory): def __init__(self, main_file_name): diff --git a/bindings/python/wscript b/bindings/python/wscript index 6b185fc2a..08e4a6b7a 100644 --- a/bindings/python/wscript +++ b/bindings/python/wscript @@ -15,7 +15,7 @@ import Build import Utils ## https://launchpad.net/pybindgen/ -REQUIRED_PYBINDGEN_VERSION = (0, 15, 0, 794) +REQUIRED_PYBINDGEN_VERSION = (0, 15, 0, 795) REQUIRED_PYGCCXML_VERSION = (0, 9, 5) @@ -247,6 +247,23 @@ int main () msg = conf.env['BINDINGS_TYPE'] conf.check_message_custom('type of bindings to build', '', msg) + + # check cxxabi stuff (which Mac OS X Lion breaks) + fragment = r""" +# include +int main () +{ + const abi::__si_class_type_info *_typeinfo __attribute__((unused)) = NULL; + return 0; +} +""" + gcc_rtti_abi = conf.check(fragment=fragment, msg="Checking for internal GCC cxxabi", + okmsg="complete", errmsg='incomplete', + mandatory=False) + conf.env["GCC_RTTI_ABI_COMPLETE"] = str(bool(gcc_rtti_abi)) + + + ## Check for pygccxml try: conf.check_python_module('pygccxml') @@ -296,9 +313,6 @@ int main () conf.env['ENABLE_PYTHON_SCANNING'] = True conf.report_optional_feature("pygccxml", "Python API Scanning Support", True, None) - - - # --------------------- def get_headers_map(bld): diff --git a/src/wscript b/src/wscript index 541915dd5..fbd5cfdb6 100644 --- a/src/wscript +++ b/src/wscript @@ -353,7 +353,9 @@ def ns3_python_bindings(bld): #if not debug: # target.append('ns3modulegen.log') - argv = ['NS3_ENABLED_FEATURES=${FEATURES}', '${PYTHON}'] + argv = ['NS3_ENABLED_FEATURES=${FEATURES}', + 'GCC_RTTI_ABI_COMPLETE=${GCC_RTTI_ABI_COMPLETE}', + '${PYTHON}'] #if debug: # argv.extend(["-m", "pdb"]) @@ -368,7 +370,7 @@ def ns3_python_bindings(bld): bindgen = bld.new_task_gen('command', source=source, target=target, command=argv) bindgen.env['FEATURES'] = ','.join(features) - bindgen.dep_vars = ['FEATURES'] + bindgen.dep_vars = ['FEATURES', "GCC_RTTI_ABI_COMPLETE"] bindgen.before = 'cxx' bindgen.after = 'gen_ns3_module_header_task' bindgen.name = "pybindgen(ns3 module %s)" % module