summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2018-10-29 15:28:05 +0000
committerJoseph Myers <joseph@codesourcery.com>2018-10-29 15:28:05 +0000
commitc6982f7efc1c70fe2d6160a87ee44d871ac85ab0 (patch)
tree1b1badfdc9453d1d32ca0bd207501253f7de92d5 /configure
parent5c81be53407434ce22b849722a3d691295480016 (diff)
downloadglibc-c6982f7efc1c70fe2d6160a87ee44d871ac85ab0.tar.gz
Patch to require Python 3.4 or later to build glibc.
This patch makes Python 3.4 or later a required tool for building glibc, so allowing changes of awk, perl etc. code used in the build and test to Python code without any such changes needing makefile conditionals or to handle older Python versions. This patch makes the configure test for Python check the version and give an error if Python is missing or too old, and removes makefile conditionals that are no longer needed. It does not itself convert any code from another language to Python, and does not remove any compatibility with older Python versions from existing scripts. Tested for x86_64. * configure.ac (PYTHON_PROG): Use AC_CHECK_PROG_VER. Set critic_missing for versions before 3.4. * configure: Regenerated. * manual/install.texi (Tools for Compilation): Document requirement for Python to build glibc. * INSTALL: Regenerated. * Rules [PYTHON]: Make code unconditional. * benchtests/Makefile [PYTHON]: Likewise. * conform/Makefile [PYTHON]: Likewise. * manual/Makefile [PYTHON]: Likewise. * math/Makefile [PYTHON]: Likewise.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure29
1 files changed, 20 insertions, 9 deletions
diff --git a/configure b/configure
index f30c31afdc..535e2f62e0 100755
--- a/configure
+++ b/configure
@@ -5344,19 +5344,30 @@ fi
test -n "$PYTHON_PROG" && break
done
-test -n "$PYTHON_PROG" || PYTHON_PROG="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"
+if test -z "$PYTHON_PROG"; then
+ ac_verc_fail=yes
else
- PYTHON="$PYTHON_PROG -B"
+ # Found it, now check the version.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $PYTHON_PROG" >&5
+$as_echo_n "checking version of $PYTHON_PROG... " >&6; }
+ ac_prog_version=`$PYTHON_PROG --version 2>&1 | sed -n 's/^.*Python \([0-9][0-9.]*\).*$/\1/p'`
+ case $ac_prog_version in
+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+ 3.[4-9]*|3.[1-9][0-9]*|[4-9].*|[1-9][0-9]*)
+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5
+$as_echo "$ac_prog_version" >&6; }
fi
+if test $ac_verc_fail = yes; then
+ critic_missing="$critic_missing python"
+fi
+
+PYTHON="$PYTHON_PROG -B"
+
test -n "$critic_missing" && as_fn_error $? "
*** These critical programs are missing or too old:$critic_missing