about summary refs log tree commit diff
path: root/configure.ac
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@sourceware.org>2016-12-22 23:07:52 +0530
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2016-12-22 23:07:52 +0530
commit8ce8299f9458c7fee8554ecd4b97cc5eddba4e4c (patch)
tree20532b2c52c1cfd50168be19d396acf12ee89a23 /configure.ac
parenta5ac5676be7b987edfbf800f577dab487fd85e5f (diff)
downloadglibc-8ce8299f9458c7fee8554ecd4b97cc5eddba4e4c.tar.gz
glibc-8ce8299f9458c7fee8554ecd4b97cc5eddba4e4c.tar.xz
glibc-8ce8299f9458c7fee8554ecd4b97cc5eddba4e4c.zip
Add configure check for python program
Add a configure check that looks for python3 and python in that order
since we had agreed in the past to prefer python3 over python in all
our code.  The patch also adjusts invocations through the various
Makefiles to use the set variable.

	* configure.ac: Check for python3 or python.
	* configure: Regenerated.
	* config.make.in (PYTHON): New variable.
	* benchtests/Makefile: Don't define PYTHON.
	(bench): Define target only if PYTHON was defined.
	* Rules: Don't define PYTHON.
	Define pretty printer targets only if PYTHON was defined.
	(tests-printers): Add to tests-unsupported if PYTHON is not
	found.
	(python-flags, python-invoke): Remove.
	(tests-printers-out): Use PYTHON instead of python-invoke.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac16
1 files changed, 15 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index d719fadeef..aa6e2d7e56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1050,13 +1050,27 @@ else
   AUTOCONF=no
 fi
 
+# Check for python3 if available, or else python.
+AC_CHECK_PROGS(PYTHON_PROG, python3 python,no)
+case "x$PYTHON_PROG" in
+xno|x|x:) PYTHON_PROG=no ;;
+*) ;;
+esac
+
+if test "x$PYTHON_PROG" = xno; then
+  aux_missing="$aux_missing python"
+else
+  PYTHON="$PYTHON_PROG -B"
+  AC_SUBST(PYTHON)
+fi
+
 test -n "$critic_missing" && AC_MSG_ERROR([
 *** These critical programs are missing or too old:$critic_missing
 *** Check the INSTALL file for required versions.])
 
 test -n "$aux_missing" && AC_MSG_WARN([
 *** These auxiliary programs are missing or incompatible versions:$aux_missing
-*** some features will be disabled.
+*** some features or tests will be disabled.
 *** Check the INSTALL file for required versions.])
 
 # if using special system headers, find out the compiler's sekrit