summary refs log tree commit diff
path: root/benchtests
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 /benchtests
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 'benchtests')
-rw-r--r--benchtests/Makefile10
1 files changed, 8 insertions, 2 deletions
diff --git a/benchtests/Makefile b/benchtests/Makefile
index f5d6dac6c7..9eef1e1243 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -18,8 +18,6 @@
 # Makefile for benchmark tests.  The only useful target here is `bench`.
 # Add benchmark functions in alphabetical order.
 
-PYTHON := python
-
 subdir := benchtests
 
 include ../Makeconfig
@@ -146,7 +144,15 @@ bench-clean:
 	rm -f $(timing-type) $(addsuffix .o,$(timing-type))
 	rm -f $(addprefix $(objpfx),$(bench-extra-objs))
 
+# Define the bench target only if the target has a usable python installation.
+ifdef PYTHON
 bench: bench-build bench-set bench-func bench-malloc
+else
+bench:
+	@echo "The bench target needs python to run."
+	@exit 1
+endif
+
 # Target to only build the benchmark without running it.  We generate locales
 # only if we're building natively.
 ifeq (no,$(cross-compiling))