diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-04-05 14:39:24 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-04-05 14:39:24 -0400 |
commit | e45136852e9444db9e3214ee2dd0fae09d1f24ba (patch) | |
tree | b22e79c588e4fc75f586b3bc3a455b9a0595334d | |
parent | 4b364228766a4a7b90ea3a2b80bbebc79d63b81e (diff) | |
download | gpsd-e45136852e9444db9e3214ee2dd0fae09d1f24ba.tar.gz |
Compute absolute Python path for scons substiutitions.
-rw-r--r-- | SConstruct | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -163,10 +163,18 @@ env['VERSION'] = gpsd_version env.Append(LIBPATH=['.']) # Placeholder so we can kluge together something like VPATH builds +# $SRCDIR replaces occurrences for $(srcdir) in the autotools build. env['SRCDIR'] = '.' -# TO-DO: We probably need to be cleverer about this -env["PYTHON"] = 'python' +# Because absolute paths are safer +for variant in ['python2.7', 'python2.6', 'python2.5', 'python2.4', "python"]: + python = WhereIs(variant) + if python: + env["PYTHON"] = python + break +else: + print "No Python - how are you running this script?" + Exit(1) if env['CC'] == 'gcc': # Enable all GCC warnings except uninitialized and |