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

numpy-svn@scip... numpy-svn@scip...
Sat Sep 22 06:54:56 CDT 2007


Author: cdavid
Date: 2007-09-22 06:54:36 -0500 (Sat, 22 Sep 2007)
New Revision: 4076

Modified:
   branches/numpy.scons/
   branches/numpy.scons/numpy/distutils/command/scons.py
   branches/numpy.scons/numpy/scons_fake/SConstruct
   branches/numpy.scons/numpy/scons_fake/setup.py
Log:
More improvements on passing dir from distutils to scons


Property changes on: branches/numpy.scons
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2007-09-21 16:37:42.802000046 +0900
committer: David Cournapeau <david@ar.media.kyoto-u.ac.jp>
properties: 
	branch-nick: numpy.scons

   + timestamp: 2007-09-22 19:16:56.497999907 +0900
committer: david <david@david-laptop>
properties: 
	branch-nick: numpy.scons

Name: bzr:file-ids
   - numpy/distutils/scons	scons-20070921045716-02vll2lwyv36uchw-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

   + 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


Modified: branches/numpy.scons/numpy/distutils/command/scons.py
===================================================================
--- branches/numpy.scons/numpy/distutils/command/scons.py	2007-09-22 07:28:45 UTC (rev 4075)
+++ branches/numpy.scons/numpy/distutils/command/scons.py	2007-09-22 11:54:36 UTC (rev 4076)
@@ -1,5 +1,6 @@
 import os
 import os.path
+from os.path import join as pjoin, dirname as pdirname
 
 #from distutils.core import build_py as old_build_py
 from distutils.command.build_ext import build_ext as old_build_py
@@ -32,17 +33,10 @@
         # does not return a failure (status is 0). We have to detect this from
         # distutils (this cannot work for recursive scons builds...)
         for i in self.scons_scripts:
-            #print "For sconscript %s" % i
-            #print "\tbuild dir (object files) is %s" % \
-            #    os.path.join(self.build_temp, os.path.dirname(i))
-            #print "\ttarget dir (.so files) is %s" % \
-            #    os.path.join(self.build_lib, os.path.dirname(i))
-            #print "Basename for %s is %s" % (i, os.path.dirname(i))
             cmd = "scons -f " + i + ' -I. '
-            cmd += ' src_prefix=%s ' % os.path.dirname(i)
-            cmd += ' obj_prefix=%s ' % os.path.join(self.build_temp, os.path.dirname(i))
-            cmd += ' lib_prefix=%s ' % os.path.join(self.build_lib, os.path.dirname(i))
-            print cmd
+            cmd += ' src_dir=%s ' % pdirname(i)
+            cmd += ' distutils_libdir=%s ' % pjoin(self.build_lib, pdirname(i))
+            #print cmd
             st = os.system(cmd)
             if st:
                 print "status is %d" % st

Modified: branches/numpy.scons/numpy/scons_fake/SConstruct
===================================================================
--- branches/numpy.scons/numpy/scons_fake/SConstruct	2007-09-22 07:28:45 UTC (rev 4075)
+++ branches/numpy.scons/numpy/scons_fake/SConstruct	2007-09-22 11:54:36 UTC (rev 4076)
@@ -4,12 +4,10 @@
 
 opts = Options()
 opts.Add('pkg_name', 'name of the package (including parent package if any)', '')
+opts.Add('src_dir', 'src dir relative to top called', '.')
 opts.Add('build_prefix', 'build prefix (NOT including the package name)', pjoin('build', 'scons'))
 opts.Add('distutils_libdir', 'build dir for libraries of distutils (NOT including the package name)', pjoin('build', 'lib'))
 
-#pkg_name = 'scons_fake'
-#build_prefix = pjoin('build', 'scons')
-#build_dir = pjoin(build_prefix, pkg_name)
 env = Environment(options = opts)
 env.AppendUnique(build_dir = pjoin(env['build_prefix'], env['pkg_name'].replace('.', os.path.sep)))
 env.AppendUnique(distutils_installdir = pjoin(env['distutils_libdir'], env['pkg_name'].replace('.', os.path.sep)))
@@ -23,15 +21,10 @@
     return lib, inst_lib
 
 env['BUILDERS']['NumpySharedLibrary'] = NumpySharedLibrary
-BuildDir(env['build_dir'], '.')
+if len(env['src_dir']) > 0:
+    BuildDir(env['build_dir'], env['src_dir'])
+else:
+    BuildDir(env['build_dir'], '.')
 
 source = ['foo.c']
-#if len(build_dir) > 0:
-#    source = [pjoin(build_dir, i) for i in source]
-#if len(src_prefix):
-#    object = [pjoin(obj_prefix, i) for i in object]
-#
-#onodes = []
-#for i in range(len(source)):
-#    onodes.append(env.SharedObject(object[i], source = [source[i]]))
 env.NumpySharedLibrary('foo', source)

Modified: branches/numpy.scons/numpy/scons_fake/setup.py
===================================================================
--- branches/numpy.scons/numpy/scons_fake/setup.py	2007-09-22 07:28:45 UTC (rev 4075)
+++ branches/numpy.scons/numpy/scons_fake/setup.py	2007-09-22 11:54:36 UTC (rev 4076)
@@ -33,10 +33,10 @@
     from numpy.distutils.system_info import get_info
     config = Configuration('scons_fake',parent_package,top_path)
 
-    print "==================================================="
-    print "parent package is %s, top path %s" % (parent_package, top_path)
-    print "THIS package is %s" % config.name
-    print "THIS package path is %s" % config.package_path
+    ## print "==================================================="
+    ## print "parent package is %s, top path %s" % (parent_package, top_path)
+    ## print "THIS package is %s" % config.name
+    ## print "THIS package path is %s" % config.package_path
     #print get_object_names(['foo.c'])
 
     #config.add_library('_fortran_foo',



More information about the Numpy-svn mailing list