[Numpy-svn] r6160 - branches/numpy-mingw-w64/numpy/distutils

numpy-svn@scip... numpy-svn@scip...
Fri Dec 19 03:02:28 CST 2008


Author: cdavid
Date: 2008-12-19 03:02:24 -0600 (Fri, 19 Dec 2008)
New Revision: 6160

Modified:
   branches/numpy-mingw-w64/numpy/distutils/mingw32ccompiler.py
Log:
Refactor build_import_library to take into account multi arch.

Modified: branches/numpy-mingw-w64/numpy/distutils/mingw32ccompiler.py
===================================================================
--- branches/numpy-mingw-w64/numpy/distutils/mingw32ccompiler.py	2008-12-19 08:56:54 UTC (rev 6159)
+++ branches/numpy-mingw-w64/numpy/distutils/mingw32ccompiler.py	2008-12-19 09:02:24 UTC (rev 6160)
@@ -30,7 +30,7 @@
 
 from distutils.unixccompiler import UnixCCompiler
 from distutils.msvccompiler import get_build_version as get_build_msvc_version
-from numpy.distutils.misc_util import msvc_runtime_library
+from numpy.distutils.misc_util import msvc_runtime_library, get_build_architecture
 
 # Useful to generate table of symbols from a dll
 _START = re.compile(r'\[Ordinal/Name Pointer\] Table')
@@ -256,10 +256,23 @@
     d.close()
 
 def build_import_library():
+    if os.name != 'nt':
+        return
+
+    arch = get_build_architecture()
+    if arch == 'AMD64':
+        return _build_import_library_amd64()
+    elif arch == 'Intel':
+        return _build_import_library_x86()
+    else:
+        raise ValueError("Unhandled arch %s" % arch)
+
+def _build_import_library_amd64():
+    pass
+
+def _build_import_library_x86():
     """ Build the import libraries for Mingw32-gcc on Windows
     """
-    if os.name != 'nt':
-        return
     lib_name = "python%d%d.lib" % tuple(sys.version_info[:2])
     lib_file = os.path.join(sys.prefix,'libs',lib_name)
     out_name = "libpython%d%d.a" % tuple(sys.version_info[:2])



More information about the Numpy-svn mailing list