[Numpy-svn] r4119 - in branches/numpy.scons: . numpy/distutils/command numpy/distutils/scons numpy/scons_fake

numpy-svn@scip... numpy-svn@scip...
Mon Sep 24 12:13:45 CDT 2007


Author: cdavid
Date: 2007-09-24 12:13:08 -0500 (Mon, 24 Sep 2007)
New Revision: 4119

Modified:
   branches/numpy.scons/
   branches/numpy.scons/numpy/distutils/command/scons.py
   branches/numpy.scons/numpy/distutils/scons/__init__.py
   branches/numpy.scons/numpy/scons_fake/SConstruct
Log:
Clean up a bit NumpyCheckLib checker for scons command


Property changes on: branches/numpy.scons
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2007-09-25 01:46:33.671999931 +0900
committer: david <david@david-laptop>
properties: 
	branch-nick: numpy.scons

   + timestamp: 2007-09-25 02:02:01.427000046 +0900
committer: david <david@david-laptop>
properties: 
	branch-nick: numpy.scons

Name: bzr:file-ids
   - numpy/scons_fake/foo_py.py	foo_py.py-20070924164547-m01dunwfr91x9rg1-1

   + 
Name: bzr:revision-id:v3-trunk0
   - 3737 david@david-laptop-20070920080908-n8pj8vmszdir3zoa
3738 david@david-laptop-20070920081509-58kkojgmml3t7jxs
3739 david@david-laptop-20070920081910-phlk1ujthksgpm0z
3740 david@david-laptop-20070920082641-bdhrt6eafeoli50i
3741 david@ar.media.kyoto-u.ac.jp-20070920130730-satdeppbh1k0bq2p
3743 david@ar.media.kyoto-u.ac.jp-20070921073742-vpv8pwv0j8fbd93m
3744 david@david-laptop-20070922101656-61kfi2faucemr2rl
3745 david@david-laptop-20070922113708-ror18thshang1cpu
3747 david@david-laptop-20070922140534-n9xsl096tjrzmct1
3749 david@david-laptop-20070922154007-usit009fr6vp377j
3750 david@david-laptop-20070923070011-leu2ozc2fy1q5cht
3751 david@david-laptop-20070924015925-dhsiao40jp7zsfp9
3752 david@ar.media.kyoto-u.ac.jp-20070924070657-nbw23j0ayan30cli
3753 david@ar.media.kyoto-u.ac.jp-20070924082918-i1lc1zikywi8czj4
3754 david@ar.media.kyoto-u.ac.jp-20070924083008-c0edtt8zs31yeh1q
3755 david@ar.media.kyoto-u.ac.jp-20070924112351-pnnho638cohz6lj1
3756 david@david-laptop-20070924153247-yftud00bynilxv69
3757 david@david-laptop-20070924163545-pish34x9fq2h66aj
3758 david@david-laptop-20070924164633-iiyygcaw81ji3n34

   + 3737 david@david-laptop-20070920080908-n8pj8vmszdir3zoa
3738 david@david-laptop-20070920081509-58kkojgmml3t7jxs
3739 david@david-laptop-20070920081910-phlk1ujthksgpm0z
3740 david@david-laptop-20070920082641-bdhrt6eafeoli50i
3741 david@ar.media.kyoto-u.ac.jp-20070920130730-satdeppbh1k0bq2p
3743 david@ar.media.kyoto-u.ac.jp-20070921073742-vpv8pwv0j8fbd93m
3744 david@david-laptop-20070922101656-61kfi2faucemr2rl
3745 david@david-laptop-20070922113708-ror18thshang1cpu
3747 david@david-laptop-20070922140534-n9xsl096tjrzmct1
3749 david@david-laptop-20070922154007-usit009fr6vp377j
3750 david@david-laptop-20070923070011-leu2ozc2fy1q5cht
3751 david@david-laptop-20070924015925-dhsiao40jp7zsfp9
3752 david@ar.media.kyoto-u.ac.jp-20070924070657-nbw23j0ayan30cli
3753 david@ar.media.kyoto-u.ac.jp-20070924082918-i1lc1zikywi8czj4
3754 david@ar.media.kyoto-u.ac.jp-20070924083008-c0edtt8zs31yeh1q
3755 david@ar.media.kyoto-u.ac.jp-20070924112351-pnnho638cohz6lj1
3756 david@david-laptop-20070924153247-yftud00bynilxv69
3757 david@david-laptop-20070924163545-pish34x9fq2h66aj
3758 david@david-laptop-20070924164633-iiyygcaw81ji3n34
3759 david@david-laptop-20070924170201-y14v2yzikdpvamfp


Modified: branches/numpy.scons/numpy/distutils/command/scons.py
===================================================================
--- branches/numpy.scons/numpy/distutils/command/scons.py	2007-09-24 16:47:09 UTC (rev 4118)
+++ branches/numpy.scons/numpy/distutils/command/scons.py	2007-09-24 17:13:08 UTC (rev 4119)
@@ -82,7 +82,8 @@
         # there is a size limitation ? What is the standard solution in thise
         # case ?
         for i in self.scons_scripts:
-            cmd = "scons -f " + i + ' -I. '
+            cmd = "PYTHONPATH=$PYTHONPATH "
+            cmd += "scons -f " + i + ' -I. '
             cmd += ' src_dir=%s ' % pdirname(i)
             cmd += ' distutils_libdir=%s ' % pjoin(self.build_lib, pdirname(i))
             cmd += ' cc_opt=%s ' % dist2sconscc(self.compiler)

Modified: branches/numpy.scons/numpy/distutils/scons/__init__.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/__init__.py	2007-09-24 16:47:09 UTC (rev 4118)
+++ branches/numpy.scons/numpy/distutils/scons/__init__.py	2007-09-24 17:13:08 UTC (rev 4119)
@@ -6,7 +6,7 @@
 from SCons.Tool import Tool
 from SCons.Environment import Environment
 from SCons.Script import BuildDir, Help
-#from SCons.Util import BuildDir, Help
+from SCons.Util import is_List
 
 # XXX: all this should be put in another files eventually once it is getting in
 # shape
@@ -121,6 +121,11 @@
     except KeyError, e:
         return []
 
+def cfgentry2list(entry):
+    """This convert one entry in a section of .cfg file to something usable in
+    scons."""
+    pass
+
 def NumpyCheckLib(context, section, libs, symbol = None):
     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     # This is really preliminary, and needs a lot of love before being in good
@@ -135,6 +140,11 @@
 {
     return 0;
 }"""
+
+    # Make sure libs is a list of libs:
+    if not is_List(libs):
+        libs = [libs]
+
     config = context.env['NUMPYCONFIG']
     context.Message('Checking for library %s...' % libs)
     if config.has_section(section):
@@ -145,12 +155,9 @@
             newLIBPATH = config.get(section, 'library_dirs') 
             newCPPPATH = config.get(section, 'include_dirs') 
             newLIBS = config.get(section, 'libraries') 
-            lastLIBPATH = _get_empty(context.env, 'LIBPATH')
-            lastLIBS = _get_empty(context.env, 'LIBS')
-            lastCPPPATH = _get_empty(context.env, 'CPPPATH')
-            # TODO: convert newLIBS to a list of libraries
-            # TODO: is library always a string, or can be a list ?
-            context.env.Append(LIBS = [libs], LIBPATH = [newLIBPATH])
+            lastLIBPATH = _get_empty(context.env,'LIBPATH')
+            lastLIBS = _get_empty(context.env,'LIBS')
+            lastCPPPATH = _get_empty(context.env,'CPPPATH')
             res = context.TryLink(src, extension)
             if not res:
                 context.env.Replace(LIBS = lastLIBS, 
@@ -162,14 +169,10 @@
             print "+++++++++++++++++++++++++++++++"
             res = 0
     else:
-        lastLIBPATH = _get_empty(context.env, 'LIBPATH')
-        lastCPPPATH = _get_empty(context.env, 'CPPPATH')
-        lastLIBS = context.AppendLIBS([libs])
+        lastLIBS = context.AppendLIBS(libs)
         res = context.TryLink(src, extension)
         if not res:
-            context.env.Replace(LIBS = lastLIBS, 
-                                LIBPATH = lastLIBPATH, 
-                                CPPPATH = lastCPPPATH)
+            context.env.Replace(LIBS = lastLIBS) 
     return context.Result(res)
 
 def get_config():

Modified: branches/numpy.scons/numpy/scons_fake/SConstruct
===================================================================
--- branches/numpy.scons/numpy/scons_fake/SConstruct	2007-09-24 16:47:09 UTC (rev 4118)
+++ branches/numpy.scons/numpy/scons_fake/SConstruct	2007-09-24 17:13:08 UTC (rev 4119)
@@ -8,6 +8,7 @@
 config.CheckLib('c', 'printf')
 #config.NumpyCheckLib('sndfile', 'sndfile', 'sf_open')
 config.NumpyCheckLib('bmeps', 'bmeps')
+config.NumpyCheckLib('atlas', ['atlas', 'f77blas', 'cblas'])
 config.Finish()
 
 source = ['foo.c']



More information about the Numpy-svn mailing list