summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Klose <doko@ubuntu.com>2012-10-21 21:12:35 (GMT)
committerMatthias Klose <doko@ubuntu.com>2012-10-21 21:12:35 (GMT)
commitaee3c76acf068b5f7b3f709c42b8bbefbce0d84b (patch)
tree4397322f398893272d4e6df8a5142088e103e260
parent18b7fcc7a627733ae8f9d72cb1f95f3d7d40696e (diff)
parentc4c4842d8625db87bfdd916a3751f90e8a0f9d88 (diff)
downloadcpython-aee3c76acf068b5f7b3f709c42b8bbefbce0d84b.zip
cpython-aee3c76acf068b5f7b3f709c42b8bbefbce0d84b.tar.gz
cpython-aee3c76acf068b5f7b3f709c42b8bbefbce0d84b.tar.bz2
- Issue #16262: fix out-of-src-tree builds, if mercurial is not installed.
-rw-r--r--Makefile.pre.in2
-rw-r--r--Misc/NEWS2
-rwxr-xr-xParser/asdl_c.py1
-rwxr-xr-xconfigure39
-rw-r--r--configure.ac12
5 files changed, 31 insertions, 25 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 9c83248..c4243f3 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -308,7 +308,7 @@ AST_ASDL= $(srcdir)/Parser/Python.asdl
ASDLGEN_FILES= $(srcdir)/Parser/asdl.py $(srcdir)/Parser/asdl_c.py
# XXX Note that a build now requires Python exist before the build starts
-ASDLGEN= @DISABLE_ASDLGEN@ $(srcdir)/Parser/asdl_c.py
+ASDLGEN= @ASDLGEN@ $(srcdir)/Parser/asdl_c.py
##########################################################################
# Python
diff --git a/Misc/NEWS b/Misc/NEWS
index fe62aab..7af66af 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -140,6 +140,8 @@ Tests
Build
-----
+- Issue #16262: fix out-of-src-tree builds, if mercurial is not installed.
+
- Issue #15298: ensure _sysconfigdata is generated in build directory, not
source directory.
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 5748360..a9e6626 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -5,7 +5,6 @@
# handle fields that have a type but no name
import os, sys
-import subprocess
import asdl
diff --git a/configure b/configure
index 6e1825f..3dd173b 100755
--- a/configure
+++ b/configure
@@ -644,8 +644,8 @@ MKDIR_P
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
-HAS_PYTHON
-DISABLE_ASDLGEN
+PYTHON
+ASDLGEN
ac_ct_READELF
READELF
ARFLAGS
@@ -5923,16 +5923,17 @@ fi
-DISABLE_ASDLGEN=""
-# Extract the first word of "python", so it can be a program name with args.
-set dummy python; ac_word=$2
+for ac_prog in python$PACKAGE_VERSION python3 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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_HAS_PYTHON+:} false; then :
+if ${ac_cv_prog_PYTHON+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test -n "$HAS_PYTHON"; then
- ac_cv_prog_HAS_PYTHON="$HAS_PYTHON" # Let the user override the test.
+ if test -n "$PYTHON"; then
+ ac_cv_prog_PYTHON="$PYTHON" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -5941,7 +5942,7 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_HAS_PYTHON="found"
+ ac_cv_prog_PYTHON="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -5949,22 +5950,26 @@ done
done
IFS=$as_save_IFS
- test -z "$ac_cv_prog_HAS_PYTHON" && ac_cv_prog_HAS_PYTHON="not-found"
fi
fi
-HAS_PYTHON=$ac_cv_prog_HAS_PYTHON
-if test -n "$HAS_PYTHON"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_PYTHON" >&5
-$as_echo "$HAS_PYTHON" >&6; }
+PYTHON=$ac_cv_prog_PYTHON
+if test -n "$PYTHON"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
+$as_echo "$PYTHON" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
-if test $HAS_HG != found -o $HAS_PYTHON != found
-then
- DISABLE_ASDLGEN="@echo hg: $HAS_HG, python: $HAS_PYTHON! cannot run \$(srcdir)/Parser/asdl_c.py #"
+ test -n "$PYTHON" && break
+done
+test -n "$PYTHON" || PYTHON="not-found"
+
+if $PYTHON = not-found; then
+ ASDLGEN="@echo python: $PYTHON! cannot run \$(srcdir)/Parser/asdl_c.py #"
+else
+ ASDLGEN="$PYTHON"
fi
diff --git a/configure.ac b/configure.ac
index 4eb6c43..236951c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1000,12 +1000,12 @@ if test "$cross_compiling" = yes; then
fi
AC_SUBST(READELF)
-AC_SUBST(DISABLE_ASDLGEN)
-DISABLE_ASDLGEN=""
-AC_CHECK_PROG(HAS_PYTHON, python, found, not-found)
-if test $HAS_HG != found -o $HAS_PYTHON != found
-then
- DISABLE_ASDLGEN="@echo hg: $HAS_HG, python: $HAS_PYTHON! cannot run \$(srcdir)/Parser/asdl_c.py #"
+AC_SUBST(ASDLGEN)
+AC_CHECK_PROGS(PYTHON, python$PACKAGE_VERSION python3 python, not-found)
+if $PYTHON = not-found; then
+ ASDLGEN="@echo python: $PYTHON! cannot run \$(srcdir)/Parser/asdl_c.py #"
+else
+ ASDLGEN="$PYTHON"
fi