summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-04-05 14:39:24 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-04-05 14:39:24 -0400
commite45136852e9444db9e3214ee2dd0fae09d1f24ba (patch)
treeb22e79c588e4fc75f586b3bc3a455b9a0595334d
parent4b364228766a4a7b90ea3a2b80bbebc79d63b81e (diff)
downloadgpsd-e45136852e9444db9e3214ee2dd0fae09d1f24ba.tar.gz
Compute absolute Python path for scons substiutitions.
-rw-r--r--SConstruct12
1 files changed, 10 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct
index d1e412e4..6d55819a 100644
--- a/SConstruct
+++ b/SConstruct
@@ -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