[Numpy-svn] r5061 - trunk/numpy/core

numpy-svn@scip... numpy-svn@scip...
Mon Apr 21 05:57:15 CDT 2008


Author: cdavid
Date: 2008-04-21 05:57:11 -0500 (Mon, 21 Apr 2008)
New Revision: 5061

Modified:
   trunk/numpy/core/SConstruct
   trunk/numpy/core/scons_support.py
Log:
Scons build: put builders creation into scons_support, and add action strings for silent modes.

Modified: trunk/numpy/core/SConstruct
===================================================================
--- trunk/numpy/core/SConstruct	2008-04-21 10:54:01 UTC (rev 5060)
+++ trunk/numpy/core/SConstruct	2008-04-21 10:57:11 UTC (rev 5061)
@@ -9,14 +9,13 @@
 from numscons import GetNumpyEnvironment
 from numscons import CheckCBLAS 
 from numscons import write_info
-try:
-    from numscons import distutils_dirs_emitter
-except ImportError:
-    raise ImportError("You need numscons >= 0.5.2")
 
 from scons_support import CheckBrokenMathlib, define_no_smp, \
     check_mlib, check_mlibs, is_npy_no_signal
+from scons_support import array_api_gen_bld, ufunc_api_gen_bld, template_bld, \
+                          umath_bld
 
+
 env = GetNumpyEnvironment(ARGUMENTS)
 env.Append(CPPPATH = [get_python_inc()])
 if os.name == 'nt':
@@ -212,26 +211,6 @@
 #---------------------------
 # Builder for generated code
 #---------------------------
-from scons_support import do_generate_array_api, do_generate_ufunc_api, \
-                        generate_api_emitter,\
-                        generate_from_template, generate_from_template_emitter, \
-                        generate_umath, generate_umath_emitter
-
-array_api_gen_bld = Builder(action = do_generate_array_api, 
-                            emitter = [generate_api_emitter,
-                                       distutils_dirs_emitter])
-
-ufunc_api_gen_bld = Builder(action = do_generate_ufunc_api, 
-                            emitter = [generate_api_emitter,
-                                       distutils_dirs_emitter])
-
-template_bld = Builder(action = generate_from_template, 
-                       emitter = [generate_from_template_emitter,
-                                  distutils_dirs_emitter])
-
-umath_bld = Builder(action = generate_umath, 
-                    emitter = [generate_umath_emitter, distutils_dirs_emitter])
-
 env.Append(BUILDERS = {'GenerateMultiarrayApi' : array_api_gen_bld,
                        'GenerateUfuncApi' : ufunc_api_gen_bld,
                        'GenerateFromTemplate' : template_bld,
@@ -240,18 +219,13 @@
 #------------------------
 # Generate generated code
 #------------------------
-from os.path import join as pjoin
-
 scalartypes_src = env.GenerateFromTemplate(pjoin('src', 'scalartypes.inc.src'))
-
 arraytypes_src = env.GenerateFromTemplate(pjoin('src', 'arraytypes.inc.src'))
-
 sortmodule_src = env.GenerateFromTemplate(pjoin('src', '_sortmodule.c.src'))
-
 umathmodule_src = env.GenerateFromTemplate(pjoin('src', 'umathmodule.c.src'))
+scalarmathmodule_src = env.GenerateFromTemplate(
+                            pjoin('src', 'scalarmathmodule.c.src'))
 
-scalarmathmodule_src = env.GenerateFromTemplate(pjoin('src', 'scalarmathmodule.c.src'))
-
 umath = env.GenerateUmath('__umath_generated',
                           pjoin('code_generators', 'generate_umath.py'))
 

Modified: trunk/numpy/core/scons_support.py
===================================================================
--- trunk/numpy/core/scons_support.py	2008-04-21 10:54:01 UTC (rev 5060)
+++ trunk/numpy/core/scons_support.py	2008-04-21 10:57:11 UTC (rev 5061)
@@ -1,4 +1,4 @@
-#! Last Change: Tue Jan 08 10:00 PM 2008 J
+#! Last Change: Mon Apr 21 07:00 PM 2008 J
 
 """Code to support special facilities to scons which are only useful for
 numpy.core, hence not put into numpy.distutils.scons"""
@@ -16,9 +16,15 @@
 
 from numscons.numdist import process_c_str as process_str
 from numscons.core.utils import rsplit, isstring
+try:
+    from numscons import distutils_dirs_emitter
+except ImportError:
+    raise ImportError("You need numscons >= 0.5.2")
 
 import SCons.Node
 import SCons
+from SCons.Builder import Builder
+from SCons.Action import Action
 
 def split_ext(string):
     sp = rsplit(string, '.', 1)
@@ -181,3 +187,18 @@
         except KeyError:
             nosmp = 0
     return nosmp == 1
+
+array_api_gen_bld = Builder(action = Action(do_generate_array_api, '$ARRAPIGENCOMSTR'), 
+                            emitter = [generate_api_emitter,
+                                       distutils_dirs_emitter])
+
+ufunc_api_gen_bld = Builder(action = Action(do_generate_ufunc_api, '$UFUNCAPIGENCOMSTR'), 
+                            emitter = [generate_api_emitter,
+                                       distutils_dirs_emitter])
+
+template_bld = Builder(action = Action(generate_from_template, '$TEMPLATECOMSTR'), 
+                       emitter = [generate_from_template_emitter,
+                                  distutils_dirs_emitter])
+
+umath_bld = Builder(action = Action(generate_umath, '$UMATHCOMSTR'), 
+                    emitter = [generate_umath_emitter, distutils_dirs_emitter])



More information about the Numpy-svn mailing list