attempt to detect broken --enable-static invocations.
--- a/wscript Fri May 01 09:07:04 2009 -0700
+++ b/wscript Mon May 04 20:21:37 2009 +0200
@@ -290,9 +290,36 @@
conf.find_program('valgrind', var='VALGRIND')
- if Options.options.enable_static and \
- env['PLATFORM'].startswith('linux'):
- conf.env['ENABLE_STATIC_NS3'] = Options.options.enable_static
+ env['ENABLE_STATIC_NS3'] = False
+ if Options.options.enable_static:
+ if env['PLATFORM'].startswith('linux') and \
+ env['CXX_NAME'] == 'gcc':
+ if os.uname()[4] == 'i386':
+ conf.report_optional_feature("static", "Static build", True,
+ "Enabled by user request")
+ env['ENABLE_STATIC_NS3'] = True
+ elif os.uname()[4] == 'x86_64':
+ if env['ENABLE_PYTHON_BINDINGS'] and \
+ not conf.check_compilation_flag('-mcmodel=large'):
+ conf.report_optional_feature("static", "Static build", False,
+ "Can't enable static builds because " + \
+ "of python and no -mcmodel=large compiler " \
+ "option. Try --disable-python or upgrade your " \
+ "compiler.")
+ else:
+ conf.report_optional_feature("static", "Static build", True,
+ "Enabled by user request. Try --disable-python " \
+ "to get higher performance.")
+ env['ENABLE_STATIC_NS3'] = True
+
+ else:
+ conf.report_optional_feature("static", "Static build", False,
+ "Unsupported platform")
+ else:
+ conf.report_optional_feature("static", "Static build", False,
+ "option --enable-static not selected")
+
+
# Write a summary of optional features status
print "---- Summary of optional NS-3 features:"