diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-11-16 06:58:30 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-11-16 06:58:30 +0100 |
commit | dcffe49265eb5d1255b96fcbdba58a50db879fee (patch) | |
tree | 498cf4db1a14292430c9fc19a572419b1dac866d /src/engine/SCons/Tool/swig.py | |
parent | 8f2056eedecb0c2a7d794b78343d82cae50ffc38 (diff) | |
parent | e20c9557371eacec533588d33b4bebd543ba178f (diff) |
Merge tag 'upstream/2.4.1'
Upstream version 2.4.1
Diffstat (limited to 'src/engine/SCons/Tool/swig.py')
-rw-r--r-- | src/engine/SCons/Tool/swig.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/engine/SCons/Tool/swig.py b/src/engine/SCons/Tool/swig.py index 83cd315..74c5a8e 100644 --- a/src/engine/SCons/Tool/swig.py +++ b/src/engine/SCons/Tool/swig.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/swig.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog" +__revision__ = "src/engine/SCons/Tool/swig.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog" import os.path import re @@ -44,6 +44,8 @@ import SCons.Tool import SCons.Util import SCons.Node +swigs = [ 'swig', 'swig3.0', 'swig2.0' ] + SwigAction = SCons.Action.Action('$SWIGCOM', '$SWIGCOMSTR') def swigSuffixEmitter(env, source): @@ -128,9 +130,10 @@ def _swigEmitter(target, source, env): target.extend(java_files) return (target, source) -def _get_swig_version(env): +def _get_swig_version(env, swig): """Run the SWIG command line tool to get and return the version number""" - pipe = SCons.Action._subproc(env, [env['SWIG'], '-version'], + swig = env.subst(swig) + pipe = SCons.Action._subproc(env, SCons.Util.CLVar(swig) + ['-version'], stdin = 'devnull', stderr = 'devnull', stdout = subprocess.PIPE) @@ -160,8 +163,9 @@ def generate(env): java_file.add_action('.i', SwigAction) java_file.add_emitter('.i', _swigEmitter) - env['SWIG'] = 'swig' - env['SWIGVERSION'] = _get_swig_version(env) + if 'SWIG' not in env: + env['SWIG'] = env.Detect(swigs) or swigs[0] + env['SWIGVERSION'] = _get_swig_version(env, env['SWIG']) env['SWIGFLAGS'] = SCons.Util.CLVar('') env['SWIGDIRECTORSUFFIX'] = '_wrap.h' env['SWIGCFILESUFFIX'] = '_wrap$CFILESUFFIX' |