[Numpy-svn] r4385 - branches/numpy.scons/numpy/distutils/scons

numpy-svn@scip... numpy-svn@scip...
Mon Nov 5 04:03:02 CST 2007


Author: cdavid
Date: 2007-11-05 04:02:57 -0600 (Mon, 05 Nov 2007)
New Revision: 4385

Modified:
   branches/numpy.scons/numpy/distutils/scons/default.py
Log:
Handle -pthread option with gcc if necessary.

Modified: branches/numpy.scons/numpy/distutils/scons/default.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/default.py	2007-11-05 09:32:43 UTC (rev 4384)
+++ branches/numpy.scons/numpy/distutils/scons/default.py	2007-11-05 10:02:57 UTC (rev 4385)
@@ -1,6 +1,7 @@
 #! /usr/bin/env python
-# Last Change: Fri Nov 02 06:00 PM 2007 J
+# Last Change: Mon Nov 05 06:00 PM 2007 J
 import sys
+import distutils.sysconfig
 
 # This is a copy of scons/Tools/__init__.py, because scons does not offer any
 # public api for this
@@ -120,10 +121,14 @@
 # which breaks command line options. So just don't put space.
 def get_cc_config(name):
     if name == 'gcc':
+        if distutils.sysconfig.get_config_vars('LDFLAGS')[0].find('-pthread'):
+            thread = ['-pthread']
+        else:
+            thread = []
         cfg = CompilerConfig(optim = ['-O2', '-fno-strict-aliasing', '-DNDEBUG'],
                              warn = ['-Wall', '-Wstrict-prototypes'],
                              debug_symbol = ['-g'], 
-                             thread = [])
+                             thread = thread)
     elif name == 'intelc':
         if sys.platform[:5] == 'win32':
             raise NotImplementedError('FIXME: intel compiler on windows not '\



More information about the Numpy-svn mailing list