diff options
author | Ray Donnelly <mingw.android@gmail.com> | 2014-03-16 03:00:06 +0000 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2015-03-24 11:56:10 -0700 |
commit | 1c9ec240cfc082366c646c4b15933e06d34a6251 (patch) | |
tree | 0cb1ca34c68b1e11b79c634c22e4d977d121eddc | |
parent | d49a78a72afcb3bf89392dbe00685fb247eb8202 (diff) | |
download | llvm-1c9ec240cfc082366c646c4b15933e06d34a6251.tar.gz |
[ndk][conf] Python: AC_PATH_PROG -> AC_PATH_PROGS and fix search order
.. to python26 python2 python as some distros have python == python3
Change-Id: I2e1fbb6aa23614abc6df1581097400a31b7badac
-rw-r--r-- | autoconf/configure.ac | 4 | ||||
-rwxr-xr-x | configure | 19 |
2 files changed, 14 insertions, 9 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac index dc1324dd458..d5a505e1896 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -1458,8 +1458,8 @@ else AC_MSG_WARN([specified python ($PYTHON) is not usable, searching path]) fi - AC_PATH_PROG([PYTHON], [python python2 python27], - [AC_MSG_RESULT([not found]) + AC_PATH_PROGS([PYTHON], [python27 python2 python], + [AC_MSG_RESULT([not found]) AC_MSG_ERROR([could not find python 2.7 or higher])]) fi diff --git a/configure b/configure index a2d1025df6d..7faf24c837c 100755 --- a/configure +++ b/configure @@ -8302,8 +8302,10 @@ else echo "$as_me: WARNING: specified python ($PYTHON) is not usable, searching path" >&2;} fi - # Extract the first word of "python python2 python27", so it can be a program name with args. -set dummy python python2 python27; ac_word=$2 + for ac_prog in python27 python2 python +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PYTHON+set}" = set; then @@ -8329,11 +8331,6 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_path_PYTHON" && ac_cv_path_PYTHON="{ echo "$as_me:$LINENO: result: not found" >&5 -echo "${ECHO_T}not found" >&6; } - { { echo "$as_me:$LINENO: error: could not find python 2.7 or higher" >&5 -echo "$as_me: error: could not find python 2.7 or higher" >&2;} - { (exit 1); exit 1; }; }" ;; esac fi @@ -8347,6 +8344,14 @@ echo "${ECHO_T}no" >&6; } fi + test -n "$PYTHON" && break +done +test -n "$PYTHON" || PYTHON="{ echo "$as_me:$LINENO: result: not found" >&5 +echo "${ECHO_T}not found" >&6; } + { { echo "$as_me:$LINENO: error: could not find python 2.7 or higher" >&5 +echo "$as_me: error: could not find python 2.7 or higher" >&2;} + { (exit 1); exit 1; }; }" + fi { echo "$as_me:$LINENO: checking for python >= 2.7" >&5 |