diff options
author | David Cournapeau <cournape@gmail.com> | 2009-09-09 00:45:52 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2009-09-09 00:45:52 +0000 |
commit | 3ecba7e560f3ec458335c01fff509a8942e5391c (patch) | |
tree | ca445c5bd6a8c0b1433d85ea02f3cb8e5a6f4d4d /numpy/distutils/command/scons.py | |
parent | a3c5de2585b44b8b697161dfad2859dd2ffbb536 (diff) | |
download | numpy-3ecba7e560f3ec458335c01fff509a8942e5391c.tar.gz |
Add a bypass option to scons command.
We sometimes want to bypass distutils compiler detection, and the bypass option
tells the scons command to do exactly that. The compiler options are simply
passed directly to scons, which will then try to to detect the compiler from
there.
Diffstat (limited to 'numpy/distutils/command/scons.py')
-rw-r--r-- | numpy/distutils/command/scons.py | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/numpy/distutils/command/scons.py b/numpy/distutils/command/scons.py index fcc4223a4..f02f699a7 100644 --- a/numpy/distutils/command/scons.py +++ b/numpy/distutils/command/scons.py @@ -293,6 +293,7 @@ class scons(old_build_ext): description = "Scons builder" user_options = [('jobs=', 'j', "specify number of worker threads when executing scons"), ('inplace', 'i', 'If specified, build in place.'), + ('bypass', 'b', 'Bypass distutils compiler detection (experimental).'), ('scons-tool-path=', None, 'specify additional path '\ '(absolute) to look for scons tools'), ('silent=', None, 'specify whether scons output should less verbose'\ @@ -335,6 +336,7 @@ class scons(old_build_ext): self.package_list = None self.inplace = 0 + self.bypass = 0 # Only critical things self.log_level = 50 @@ -410,17 +412,22 @@ class scons(old_build_ext): # f2py does not pass compiler information to scons command, and the # compilation setup below can crash in some situation. if len(self.sconscripts) > 0: - # Try to get the same compiler than the ones used by distutils: this is - # non trivial because distutils and scons have totally different - # conventions on this one (distutils uses PATH from user's environment, - # whereas scons uses standard locations). The way we do it is once we - # got the c compiler used, we use numpy.distutils function to get the - # full path, and add the path to the env['PATH'] variable in env - # instance (this is done in numpy.distutils.scons module). - - self._init_ccompiler(self.compiler) - self._init_fcompiler(self.fcompiler) - self._init_cxxcompiler(self.cxxcompiler) + if self.bypass: + self.scons_compiler = self.compiler + self.scons_fcompiler = self.fcompiler + self.scons_cxxcompiler = self.cxxcompiler + else: + # Try to get the same compiler than the ones used by distutils: this is + # non trivial because distutils and scons have totally different + # conventions on this one (distutils uses PATH from user's environment, + # whereas scons uses standard locations). The way we do it is once we + # got the c compiler used, we use numpy.distutils function to get the + # full path, and add the path to the env['PATH'] variable in env + # instance (this is done in numpy.distutils.scons module). + + self._init_ccompiler(self.compiler) + self._init_fcompiler(self.fcompiler) + self._init_cxxcompiler(self.cxxcompiler) if self.package_list: self.package_list = parse_package_list(self.package_list) |