wscript
changeset 4438 8d9f6e489f94
parent 4436 56fc927210c6
child 4439 e2fc73a10bad
--- a/wscript	Mon May 04 20:22:08 2009 +0200
+++ b/wscript	Tue May 05 12:00:29 2009 +0200
@@ -295,8 +295,7 @@
         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")
+                conf.report_optional_feature("static", "Static build", True, '')
                 env['ENABLE_STATIC_NS3'] = True
             elif os.uname()[4] == 'x86_64':
                 if env['ENABLE_PYTHON_BINDINGS'] and \
@@ -307,11 +306,12 @@
                                                      "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
-                    
+                    conf.report_optional_feature("static", "Static build", True, '')
+                    env['ENABLE_STATIC_NS3'] = True                    
+        elif env['PLATFORM'].startswith('darwin') and \
+                env['CXX_NAME'] == 'gcc':
+                conf.report_optional_feature("static", "Static build", True, '')
+                env['ENABLE_STATIC_NS3'] = True
         else:
             conf.report_optional_feature("static", "Static build", False,
                                          "Unsupported platform")
@@ -387,9 +387,13 @@
     program.uselib_local = 'ns3'
     program.ns3_module_dependencies = ['ns3-'+dep for dep in dependencies]
     if program.env['ENABLE_STATIC_NS3']:
-        program.env.append_value('LINKFLAGS', '-Wl,--whole-archive,-Bstatic')
-        program.env.append_value('LINKFLAGS', '-lns3')
-        program.env.append_value('LINKFLAGS', '-Wl,-Bdynamic,--no-whole-archive')
+        if sys.platform == 'darwin':
+            program.env.append_value('LINKFLAGS', '-Wl,-all_load')
+            program.env.append_value('LINKFLAGS', '-lns3')
+        else:
+            program.env.append_value('LINKFLAGS', '-Wl,--whole-archive,-Bstatic')
+            program.env.append_value('LINKFLAGS', '-lns3')
+            program.env.append_value('LINKFLAGS', '-Wl,-Bdynamic,--no-whole-archive')
     return program
 
 def add_scratch_programs(bld):