[Numpy-svn] r4110 - in branches/numpy.scons: . numpy/distutils/scons

numpy-svn@scip... numpy-svn@scip...
Mon Sep 24 00:56:12 CDT 2007


Author: cdavid
Date: 2007-09-24 00:56:00 -0500 (Mon, 24 Sep 2007)
New Revision: 4110

Modified:
   branches/numpy.scons/
   branches/numpy.scons/numpy/distutils/scons/__init__.py
Log:
Some cleanup in scons support library


Property changes on: branches/numpy.scons
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2007-09-23 16:00:11.173000097 +0900
committer: david <david@david-laptop>
properties: 
	branch-nick: numpy.scons

   + timestamp: 2007-09-24 10:59:25.736999989 +0900
committer: david <david@david-laptop>
properties: 
	branch-nick: numpy.scons

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

   + 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


Modified: branches/numpy.scons/numpy/distutils/scons/__init__.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/__init__.py	2007-09-24 05:55:27 UTC (rev 4109)
+++ branches/numpy.scons/numpy/distutils/scons/__init__.py	2007-09-24 05:56:00 UTC (rev 4110)
@@ -9,6 +9,9 @@
 from SCons.Errors import EnvironmentError
 
 def NumpySharedLibrary(env, target, source, *args, **kw):
+    """This builder is the same than SharedLibrary, except for the fact that it
+    takes into account build dir info passed by distutils, and put the target at
+    the right location in distutils build directory for correct installation."""
     source = [pjoin(env['build_dir'], i) for i in source]
     # XXX: why target is a list ? It is always true ?
     lib = env.SharedLibrary("$build_dir/%s" % target[0], source, *args, **kw)
@@ -18,10 +21,18 @@
 	
 	
 def NumpyCTypes(env, target, source, *args, **kw):
+    """This builder is essentially the same than SharedLibrary, but should be
+    used for libraries which will only be used through ctypes.
+
+    In particular, it does not install .exp/.lib files on windows. """
     source = [pjoin(env['build_dir'], i) for i in source]
     # XXX: why target is a list ? It is always true ?
     # XXX: handle cases where SHLIBPREFIX is in args
-    lib = env.SharedLibrary("$build_dir/%s" % target[0], source, SHLIBPREFIX = '', *args, **kw)
+    lib = env.SharedLibrary("$build_dir/%s" % target[0], 
+                            source, 
+                            SHLIBPREFIX = '', 
+                            *args, 
+                            **kw)
     lib = [i for i in lib if not (str(i).endswith('.exp') or str(i).endswith('.lib')) ]
     inst_lib = env.Install("$distutils_installdir", lib)
     return lib, inst_lib
@@ -46,10 +57,13 @@
     """Call this with args = ARGUMENTS."""
     opts = GetNumpyOptions(args)
     env = Environment(options = opts)
+
+    # Setting dirs according to command line options
     env.AppendUnique(build_dir = pjoin(env['build_prefix']))
     env.AppendUnique(distutils_installdir = pjoin(env['distutils_libdir'], 
                                                   env['pkg_name']))
 
+    # Setting tools according to command line options
     if len(env['cc_opt']) > 0:
         try:
             t = Tool(env['cc_opt'])
@@ -57,14 +71,22 @@
         except EnvironmentError, e:
             # scons could not understand cc_opt (bad name ?)
             raise AssertionError(e)
+
+    # Adding custom builder
     env['BUILDERS']['NumpySharedLibrary'] = NumpySharedLibrary
     env['BUILDERS']['NumpyCTypes'] = NumpyCTypes
-    print env['src_dir']
+
+    # Setting build directory according to command line option
     if len(env['src_dir']) > 0:
         BuildDir(env['build_dir'], env['src_dir'])
     else:
         BuildDir(env['build_dir'], '.')
 
+    # Generate help (if calling scons directly during debugging, this could be useful)
     Help(opts.GenerateHelpText(env))
 
+    print "setup.cfg abspath is %s" % pjoin(env['src_dir'], 'setup.cfg')
     return env
+
+def find_config_file(name = 'site.cfg'):
+    # According to system_info in 



More information about the Numpy-svn mailing list