diff options
author | David Cournapeau <cournape@gmail.com> | 2009-07-26 11:04:24 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2009-07-26 11:04:24 +0000 |
commit | bfbb9dd7c06d85e29983fc741679761c9b769137 (patch) | |
tree | 42b3e647c6e2db6df8aabb2324da8727fde1e0c9 /numpy/distutils/command/install_clib.py | |
parent | 78de166d5bd2a41f90defd899abb9fb6c14c6c79 (diff) | |
download | numpy-bfbb9dd7c06d85e29983fc741679761c9b769137.tar.gz |
Installing a clib now works.
Installable libraries are built exactly like conventional clib (they are
added to the NumpyDistribution instance libraries member, and build_clib
is not aware of the libraries/installable libraries distinction).
Everything is done in the install_clib. The library cannot be used yet
by external code, though.
Diffstat (limited to 'numpy/distutils/command/install_clib.py')
-rw-r--r-- | numpy/distutils/command/install_clib.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/numpy/distutils/command/install_clib.py b/numpy/distutils/command/install_clib.py index c6934e6f8..ddb10a162 100644 --- a/numpy/distutils/command/install_clib.py +++ b/numpy/distutils/command/install_clib.py @@ -1,5 +1,6 @@ import os from distutils.core import Command +from numpy.distutils.misc_util import get_cmd class install_clib(Command): description = "Command to install installable C libraries" @@ -7,13 +8,26 @@ class install_clib(Command): user_options = [] def initialize_options(self): - pass + self.install_dir = None + self.outfiles = [] def finalize_options(self): - pass + self.set_undefined_options('install', ('install_lib', 'install_dir')) def run (self): - pass + # We need the compiler to get the library name -> filename association + from distutils.ccompiler import new_compiler + compiler = new_compiler(compiler=None) + compiler.customize(self.distribution) + + build_dir = get_cmd("build_clib").build_clib + + for l in self.distribution.installed_libraries: + target_dir = os.path.join(self.install_dir, l.target_dir) + name = compiler.library_filename(l.name) + source = os.path.join(build_dir, name) + self.mkpath(target_dir) + self.outfiles.append(self.copy_file(source, target_dir)[0]) def get_outputs(self): - return [] + return self.outfiles |