chiark / gitweb /
build-sys: use full path to python in scripts
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 5 Jan 2013 18:15:50 +0000 (13:15 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 5 Jan 2013 18:19:38 +0000 (13:19 -0500)
Commit c4eb236a2c didn't take into account the situation when the user
sets e.g. PYTHON=python3 (without the full path).  This value would
then be used verbatim for PYTHON_BINARY and in she-bang lines in
scripts, which is incorrect. To fix this, $PYTHON is passed through
which, which expands the path.  If $PYTHON_BINARY is desired which is
not installed on the build system, then PYTHON_BINARY must be set
separately.

configure.ac

index 535b71f6628ae1be55394014dfe986b58f0d9cc5..a8d48871dab1b8ef116e1658f2c1bfbbdac5bf68 100644 (file)
@@ -107,7 +107,7 @@ AS_IF([test "x$with_python" != "xno"], [
 AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
 AS_IF([test "x$PYTHON_BINARY" = "x"],
       [AS_IF([test "x$have_python" = "xyes"],
-             [PYTHON_BINARY="$PYTHON"],
+             [PYTHON_BINARY="`which "$PYTHON"`"],
              [PYTHON_BINARY=/usr/bin/python])])
 AC_ARG_VAR(PYTHON_BINARY, [Python binary used to launch installed scripts])