[Numpy-svn] r4380 - trunk/numpy/distutils/command

numpy-svn@scip... numpy-svn@scip...
Sat Nov 3 11:09:08 CDT 2007


Author: cookedm
Date: 2007-11-03 11:09:06 -0500 (Sat, 03 Nov 2007)
New Revision: 4380

Modified:
   trunk/numpy/distutils/command/build_ext.py
Log:
numpy.distutils.command.build_ext: append build C libraries as dependencies of
the extension, to force recompiling if they change. (It should really only force relinking, but adding that is tougher.)


Modified: trunk/numpy/distutils/command/build_ext.py
===================================================================
--- trunk/numpy/distutils/command/build_ext.py	2007-11-03 08:23:56 UTC (rev 4379)
+++ trunk/numpy/distutils/command/build_ext.py	2007-11-03 16:09:06 UTC (rev 4380)
@@ -89,6 +89,7 @@
                              ' overwriting build_info\n%s... \nwith\n%s...' \
                              % (libname, `clibs[libname]`[:300], `build_info`[:300]))
                 clibs[libname] = build_info
+        local_clibs = clibs.copy()
         # .. and distribution libraries:
         for libname,build_info in self.distribution.libraries or []:
             if clibs.has_key(libname):
@@ -105,13 +106,18 @@
             c_lib_dirs = []
             macros = []
             for libname in ext.libraries:
-                if clibs.has_key(libname):
+                if libname in clibs:
                     binfo = clibs[libname]
                     c_libs += binfo.get('libraries',[])
                     c_lib_dirs += binfo.get('library_dirs',[])
                     for m in binfo.get('macros',[]):
                         if m not in macros:
                             macros.append(m)
+                if libname in local_clibs:
+                    c = self.compiler
+                    outname = c.library_filename(libname,
+                                                 output_dir=self.build_temp)
+                    ext.depends.append(outname)
                 for l in clibs.get(libname,{}).get('source_languages',[]):
                     ext_languages.add(l)
             if c_libs:



More information about the Numpy-svn mailing list