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

numpy-svn@scip... numpy-svn@scip...
Fri Oct 12 05:42:50 CDT 2007


Author: cdavid
Date: 2007-10-12 05:42:27 -0500 (Fri, 12 Oct 2007)
New Revision: 4181

Modified:
   branches/numpy.scons/
   branches/numpy.scons/numpy/distutils/command/scons.py
   branches/numpy.scons/numpy/distutils/scons/numpyenv.py
   branches/numpy.scons/numpy/distutils/scons/utils.py
   branches/numpy.scons/numpy/scons_fake/checklib/SConstruct
Log:
Merge back from main numpy.scons branch


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

   + timestamp: 2007-10-12 16:41:03.905999899 +0900
committer: David Cournapeau <david@ar.media.kyoto-u.ac.jp>
properties: 
	branch-nick: numpy.sconsified

Name: bzr:ancestry:v3-trunk0
   - svn-v3-trunk0:94b884b6-d6fd-0310-90d3-974f1d3f35e1:branches%2Fnumpy.scons:4112

   + svn-v3-trunk0:94b884b6-d6fd-0310-90d3-974f1d3f35e1:branches%2Fnumpy.scons:4112
david@ar.media.kyoto-u.ac.jp-20071012063527-x9tlkbs04vw0iyxg

Name: bzr:file-ids
   - setupscons.py	setupscons.py-20071012073152-5cjw0f21wjrronpp-1
numpy/setupscons.py	setupscons.py-20071012073156-2q41hv4160unzvgu-1
numpy/distutils/setupscons.py	setupscons.py-20071012073225-2siuy69nudxygxhf-1
numpy/random/setupscons.py	setupscons.py-20071012073345-rdz48sxmx4l5z104-1
numpy/scons_fake/setupscons.py	setupscons.py-20071012073348-qsdmbjgvmo8v4vfa-1
numpy/lib/setupscons.py	setupscons.py-20071012073400-jj4s0c8bf3tdyk8u-1
numpy/numarray/setupscons.py	setupscons.py-20071012073332-ozzndtqjcck51weo-1
numpy/f2py/setupscons.py	setupscons.py-20071012073214-nfy7furt0j408jxj-1
numpy/core/setupscons.py	setupscons.py-20071012073209-yf3ikofbaleurqt0-1
numpy/fft/setupscons.py	setupscons.py-20071012073214-nfy7furt0j408jxj-2
numpy/linalg/setupscons.py	setupscons.py-20071012073400-jj4s0c8bf3tdyk8u-2
numpy/oldnumeric/setupscons.py	setupscons.py-20071012073341-cyophs8ex8ot7u1c-1
numpy/testing/setupscons.py	setupscons.py-20071012073353-ti1uodrc1u4hzipy-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
3759 david@david-laptop-20070924170201-y14v2yzikdpvamfp
3760 david@david-laptop-20070924171208-5bmitorzf49d1aa2
3761 david@david-laptop-20070925014444-ns9v90gotnxt39mq
3769 david@david-laptop-20070925145952-4osi81tvch7v6luj
3773 david@ar.media.kyoto-u.ac.jp-20070926073429-2kdc6yf1o210aer0
3774 david@ar.media.kyoto-u.ac.jp-20070926084356-938djoytjap90rmo
3775 david@ar.media.kyoto-u.ac.jp-20070926085329-3gquq3gu2k8rgzb0
3776 david@ar.media.kyoto-u.ac.jp-20071009084906-9kradhwpu7su633x
3777 david@ar.media.kyoto-u.ac.jp-20071009093339-q5nf5me6ikdi48k6
3778 david@david-laptop-20071009152108-xh5cltii0h6zjk9b
3779 david@david-laptop-20071009154954-v5se05gbq60opo1z
3780 david@david-laptop-20071009223102-vz2sgf5i6pncxsd8
3781 david@david-laptop-20071009225259-13m6enwqk4w9uihe
3782 david@ar.media.kyoto-u.ac.jp-20071010021710-liz2jvw0ggbxrtgi
3783 david@ar.media.kyoto-u.ac.jp-20071010032218-8qzxvdmith85a056
3784 david@ar.media.kyoto-u.ac.jp-20071010032323-lgbxfd788h402kn0
3792 david@ar.media.kyoto-u.ac.jp-20071011033223-s14976refgeaw00h
3793 david@ar.media.kyoto-u.ac.jp-20071011033241-rrzlo2vu6w0tkdwf
3794 david@ar.media.kyoto-u.ac.jp-20071011071251-c5pxigyynpck262d
3795 david@ar.media.kyoto-u.ac.jp-20071012040323-8ka0mgkx1t8r9fcl
3796 david@ar.media.kyoto-u.ac.jp-20071012042801-44pmvc5o1u6p6wi7
3797 david@ar.media.kyoto-u.ac.jp-20071012071207-nfpsuyfoq0ooy7xf
3798 david@ar.media.kyoto-u.ac.jp-20071012073426-8o9tejzovgk7qzi4

   + 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
3760 david@david-laptop-20070924171208-5bmitorzf49d1aa2
3761 david@david-laptop-20070925014444-ns9v90gotnxt39mq
3769 david@david-laptop-20070925145952-4osi81tvch7v6luj
3773 david@ar.media.kyoto-u.ac.jp-20070926073429-2kdc6yf1o210aer0
3774 david@ar.media.kyoto-u.ac.jp-20070926084356-938djoytjap90rmo
3775 david@ar.media.kyoto-u.ac.jp-20070926085329-3gquq3gu2k8rgzb0
3776 david@ar.media.kyoto-u.ac.jp-20071009084906-9kradhwpu7su633x
3777 david@ar.media.kyoto-u.ac.jp-20071009093339-q5nf5me6ikdi48k6
3778 david@david-laptop-20071009152108-xh5cltii0h6zjk9b
3779 david@david-laptop-20071009154954-v5se05gbq60opo1z
3780 david@david-laptop-20071009223102-vz2sgf5i6pncxsd8
3781 david@david-laptop-20071009225259-13m6enwqk4w9uihe
3782 david@ar.media.kyoto-u.ac.jp-20071010021710-liz2jvw0ggbxrtgi
3783 david@ar.media.kyoto-u.ac.jp-20071010032218-8qzxvdmith85a056
3784 david@ar.media.kyoto-u.ac.jp-20071010032323-lgbxfd788h402kn0
3792 david@ar.media.kyoto-u.ac.jp-20071011033223-s14976refgeaw00h
3793 david@ar.media.kyoto-u.ac.jp-20071011033241-rrzlo2vu6w0tkdwf
3794 david@ar.media.kyoto-u.ac.jp-20071011071251-c5pxigyynpck262d
3795 david@ar.media.kyoto-u.ac.jp-20071012040323-8ka0mgkx1t8r9fcl
3796 david@ar.media.kyoto-u.ac.jp-20071012042801-44pmvc5o1u6p6wi7
3797 david@ar.media.kyoto-u.ac.jp-20071012071207-nfpsuyfoq0ooy7xf
3798 david@ar.media.kyoto-u.ac.jp-20071012073426-8o9tejzovgk7qzi4
3799 david@ar.media.kyoto-u.ac.jp-20071012074103-1fzviuk1sunv0b9n


Modified: branches/numpy.scons/numpy/distutils/command/scons.py
===================================================================
--- branches/numpy.scons/numpy/distutils/command/scons.py	2007-10-12 10:41:08 UTC (rev 4180)
+++ branches/numpy.scons/numpy/distutils/command/scons.py	2007-10-12 10:42:27 UTC (rev 4181)
@@ -128,7 +128,6 @@
             # XXX: This is inefficient... (use join instead)
             cmd = scons_exec + " -Q -f " + i + ' -I. '
             cmd += ' src_dir="%s" ' % pdirname(i)
-            #cmd += ' pkg_name="%s" ' % pdirname(i)
             cmd += ' distutils_libdir=%s ' % protect_path(pjoin(self.build_lib,
                                                                 pdirname(i)))
             cmd += ' cc_opt=%s ' % dist2sconscc(self.compiler)

Modified: branches/numpy.scons/numpy/distutils/scons/numpyenv.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/numpyenv.py	2007-10-12 10:41:08 UTC (rev 4180)
+++ branches/numpy.scons/numpy/distutils/scons/numpyenv.py	2007-10-12 10:42:27 UTC (rev 4181)
@@ -1,6 +1,6 @@
 # Last Changed: .
 import os.path
-from os.path import join as pjoin
+from os.path import join as pjoin, dirname as pdirname
 import sys
 
 from distutils.sysconfig import get_config_vars
@@ -118,6 +118,24 @@
         t = Tool(FindTool(DEF_C_COMPILERS))
         t(env)
 
+    # XXX: Really, we should use our own subclass of Environment, instead of
+    # adding Numpy* functions !
+
+    # Put config code in separate dir for each subpackage
+    from utils import curry
+    NumpyConfigure = curry(env.Configure, conf_dir = pjoin(env['build_dir'], '.sconf'))
+    env.NumpyConfigure = NumpyConfigure
+    # XXX: Huge, ungly hack ! SConsign needs an absolute path or a path
+    # relative to where the SConstruct file is. We have to find the path of
+    # the build dir relative to the src_dir: we add n .., where n is the number
+    # of occureant of the path separator in the src dir.
+    def get_build_relative_src(srcdir, builddir):
+        n = srcdir.count(os.sep) + 1
+        return pjoin(os.sep.join([r'..' for i in range(n)]), builddir)
+    env.SConsignFile(pjoin(get_build_relative_src(env['src_dir'], 
+                                                  env['build_dir']),
+                           '.sconsign.dblite'))
+
     # ========================================================================
     # Adding default tools for the one we do not customize: mingw is special
     # according to scons, don't ask me why, but this does not work as expected

Modified: branches/numpy.scons/numpy/distutils/scons/utils.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/utils.py	2007-10-12 10:41:08 UTC (rev 4180)
+++ branches/numpy.scons/numpy/distutils/scons/utils.py	2007-10-12 10:42:27 UTC (rev 4181)
@@ -42,3 +42,17 @@
     except KeyError, e:
         return []
 
+class curry:
+    def __init__(self, fun, *args, **kwargs):
+        self.fun = fun
+        self.pending = args[:]
+        self.kwargs = kwargs.copy()
+
+    def __call__(self, *args, **kwargs):
+        if kwargs and self.kwargs:
+            kw = self.kwargs.copy()
+            kw.update(kwargs)
+        else:
+            kw = kwargs or self.kwargs
+
+        return self.fun(*(self.pending + args), **kw)

Modified: branches/numpy.scons/numpy/scons_fake/checklib/SConstruct
===================================================================
--- branches/numpy.scons/numpy/scons_fake/checklib/SConstruct	2007-10-12 10:41:08 UTC (rev 4180)
+++ branches/numpy.scons/numpy/scons_fake/checklib/SConstruct	2007-10-12 10:42:27 UTC (rev 4181)
@@ -3,7 +3,7 @@
 
 env = GetNumpyEnvironment(ARGUMENTS)
 
-config = env.Configure(custom_tests = {'NumpyCheckLib' : NumpyCheckLib})
+config = env.NumpyConfigure(custom_tests = {'NumpyCheckLib' : NumpyCheckLib})
 if not config.NumpyCheckLib('sndfile', 'sf_open', section = 'sndfile'):
     print "sndfile not found, this package cannot work without sndfile !"
 config.Finish()



More information about the Numpy-svn mailing list