Don't use the flag -pthread on darwin to avoid warning message
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Sun, 25 Jan 2009 15:39:36 +0000
changeset 4124 d2ec423e4576
parent 4123 383d47fa7444
child 4125 b5e1f3870314
Don't use the flag -pthread on darwin to avoid warning message
src/core/wscript
--- a/src/core/wscript	Sun Jan 25 14:52:09 2009 +0000
+++ b/src/core/wscript	Sun Jan 25 15:39:36 2009 +0000
@@ -1,6 +1,6 @@
 ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
 import sys
-
+import Options
 
 def configure(conf):
     if conf.check(header_name='stdlib.h'):
@@ -11,9 +11,10 @@
 
     # Check for POSIX threads
     test_env = conf.env.copy()
-    test_env.append_value('LINKFLAGS', '-pthread')
-    test_env.append_value('CXXFLAGS', '-pthread')
-    test_env.append_value('CCFLAGS', '-pthread')
+    if Options.platform != 'darwin':
+        test_env.append_value('LINKFLAGS', '-pthread')
+        test_env.append_value('CXXFLAGS', '-pthread')
+        test_env.append_value('CCFLAGS', '-pthread')
     fragment = r"""
 #include <pthread.h>
 int main ()
@@ -28,9 +29,11 @@
                               errmsg='Could not find pthread support (build/config.log for details)',
                               mandatory=False)
     if have_pthread:
-        conf.env['CXXFLAGS_PTHREAD'] = '-pthread'
-        conf.env['CCFLAGS_PTHREAD'] = '-pthread'
-        conf.env['LINKFLAGS_PTHREAD'] = '-pthread'
+        # darwin accepts -pthread but prints a warning saying it is ignored
+        if Options.platform != 'darwin':
+            conf.env['CXXFLAGS_PTHREAD'] = '-pthread'
+            conf.env['CCFLAGS_PTHREAD'] = '-pthread'
+            conf.env['LINKFLAGS_PTHREAD'] = '-pthread'
 
     conf.env['ENABLE_THREADING'] = have_pthread