You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by kl...@apache.org on 2018/06/15 13:44:35 UTC

mesos git commit: Improved coverage with configure and `PYTHON` or `PYTHON_VERSION` set.

Repository: mesos
Updated Branches:
  refs/heads/master cab94e6dc -> 57091affe


Improved coverage with configure and `PYTHON` or `PYTHON_VERSION` set.

We set `PYTHON` and `PYTHON_VERSION` when configuring the build.
We now cover all possible cases (both variables set, only one, none).
This ensures that both variables are set after being checked.

Review: https://reviews.apache.org/r/67412/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/57091aff
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/57091aff
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/57091aff

Branch: refs/heads/master
Commit: 57091affe3380a01d516b03be2700db85c328ede
Parents: cab94e6
Author: Armand Grillet <ag...@mesosphere.io>
Authored: Fri Jun 15 15:26:15 2018 +0200
Committer: Kevin Klues <kl...@gmail.com>
Committed: Fri Jun 15 15:43:37 2018 +0200

----------------------------------------------------------------------
 configure.ac | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/57091aff/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 7d4c1ca..2e02284 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2271,7 +2271,18 @@ if test "x$enable_python" = "xyes" || \
     if test -n "$PYTHON"; then
       AC_MSG_ERROR([only specify one of PYTHON or PYTHON_VERSION])
     fi
-    PYTHON=python$PYTHON_VERSION
+    AC_SUBST([PYTHON], [python$PYTHON_VERSION])
+  elif test -n "$PYTHON"; then
+    # PYTHON has been set by user, we set PYTHON_VERSION.
+    AC_CHECK_PROG([PYTHON_CHECK], [$PYTHON], [yes])
+    AS_IF([test "x$PYTHON_CHECK" = "xyes"], [
+      PYTHON_VERSION=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`
+    ], [
+      AC_MSG_ERROR([Cannot find Python executable '$PYTHON' in path.])
+    ])
+  else
+    # PYTHON nor PYTHON_VERSION have been set, we do it.
+    AM_PATH_PYTHON()
   fi
 fi