summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorCraig Silverstein <csilvers@khanacademy.org>2008-05-01 23:02:01 +0000
committerCraig Silverstein <csilvers@khanacademy.org>2008-05-01 23:02:01 +0000
commita3a8bab46dd99e6d0a06a2b74e482d9016171a78 (patch)
treeb2d96eda99aca03b367d7d69417559c92a53f0de /configure.ac
parenta735d2454c1f8263eddfd3c1b5a18b06b7a56f56 (diff)
downloaddistcc-git-a3a8bab46dd99e6d0a06a2b74e482d9016171a78.tar.gz
Include-server requires python 2.4 or higher, but the test framework
only requires python 2.2. Check for both, so for folks with python 2.2 or python 2.3, they can at least run the tests, even if they can't install the include-server.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac33
1 files changed, 27 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index bbe5747..bffd201 100644
--- a/configure.ac
+++ b/configure.ac
@@ -204,14 +204,35 @@ CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
AC_PROG_MAKE_SET
AC_PROG_INSTALL
-# We prefer to use the latest Python, but try to find an explicit version
-# to make sure we don't get a really old one.
-# The include server requires python 2.4 or later.
-# TODO(csilvers): check via python -V (and use AC_PATH_PROGS below)
-AC_CHECK_PROGS(PYTHON, [python2.4 python-2.4 python])
-AC_ARG_VAR(PYTHON, [Python interpreter (must be >= Python 2.4)])
+# We prefer to use the latest Python, but try to find an explicit
+# version to make sure we don't get a really old one.
+#
+# The include server requires python 2.4 or later, but the 'make test'
+# routines only require python 2.2. Thus we have two separate
+# variables. Each variable is the empty string if the python that we
+# haven't isn't recent enough for that use, or the path to a python
+# executable if it is recent enough.
+#
# NB: Cannot use AC_CONFIG_LIBOBJ_DIR here, because it's not present
# in autoconf 2.53.
+AC_PATH_PROGS(PYTHON, [python2.4 python-2.4 python])
+AC_ARG_VAR(PYTHON, [Python interpreter])
+# Python 1 doesn't even support -V
+if ! "$PYTHON" -V 2>&1 | grep -q "^Python"; then
+ TEST_PYTHON=""
+ INCLUDESERVER_PYTHON=""
+elif "$PYTHON" -V 2>&1 | grep -q "^Python 2.1"; then
+ TEST_PYTHON=""
+ INCLUDESERVER_PYTHON=""
+elif "$PYTHON" -V 2>&1 | grep -q "^Python 2.[23]"; then
+ TEST_PYTHON="$PYTHON"
+ INCLUDESERVER_PYTHON=""
+else
+ TEST_PYTHON="$PYTHON"
+ INCLUDESERVER_PYTHON="$PYTHON"
+fi
+AC_SUBST(TEST_PYTHON)
+AC_SUBST(INCLUDESERVER_PYTHON)
AC_C_INLINE
AC_C_BIGENDIAN