Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/mingw32/Python27/Lib/site-packages/numpy/distutils/command/install_clib.py @ 87:2a2c65a20a8b
Add Python libs and headers
author | Chris Cannam |
---|---|
date | Wed, 25 Feb 2015 14:05:22 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
86:413a9d26189e | 87:2a2c65a20a8b |
---|---|
1 from __future__ import division, absolute_import, print_function | |
2 | |
3 import os | |
4 from distutils.core import Command | |
5 from distutils.ccompiler import new_compiler | |
6 from numpy.distutils.misc_util import get_cmd | |
7 | |
8 class install_clib(Command): | |
9 description = "Command to install installable C libraries" | |
10 | |
11 user_options = [] | |
12 | |
13 def initialize_options(self): | |
14 self.install_dir = None | |
15 self.outfiles = [] | |
16 | |
17 def finalize_options(self): | |
18 self.set_undefined_options('install', ('install_lib', 'install_dir')) | |
19 | |
20 def run (self): | |
21 build_clib_cmd = get_cmd("build_clib") | |
22 build_dir = build_clib_cmd.build_clib | |
23 | |
24 # We need the compiler to get the library name -> filename association | |
25 if not build_clib_cmd.compiler: | |
26 compiler = new_compiler(compiler=None) | |
27 compiler.customize(self.distribution) | |
28 else: | |
29 compiler = build_clib_cmd.compiler | |
30 | |
31 for l in self.distribution.installed_libraries: | |
32 target_dir = os.path.join(self.install_dir, l.target_dir) | |
33 name = compiler.library_filename(l.name) | |
34 source = os.path.join(build_dir, name) | |
35 self.mkpath(target_dir) | |
36 self.outfiles.append(self.copy_file(source, target_dir)[0]) | |
37 | |
38 def get_outputs(self): | |
39 return self.outfiles |