[Python-checkins] cpython (3.2): - Issue #16262: fix out-of-src-tree builds, if mercurial is not installed.

matthias.klose python-checkins at python.org
Sun Oct 21 23:19:24 CEST 2012


http://hg.python.org/cpython/rev/03236a19eb87
changeset:   79885:03236a19eb87
branch:      3.2
parent:      79878:ebb8c7d79f52
user:        Matthias Klose <doko at ubuntu.com>
date:        Sun Oct 21 23:05:35 2012 +0200
summary:
  - Issue #16262: fix out-of-src-tree builds, if mercurial is not installed.

files:
  Makefile.pre.in |   2 +-
  Misc/NEWS       |   2 +
  configure       |  47 ++++++++++++++++++++----------------
  configure.ac    |  12 ++++----
  4 files changed, 35 insertions(+), 28 deletions(-)


diff --git a/Makefile.pre.in b/Makefile.pre.in
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -280,7 +280,7 @@
 
 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
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -590,6 +590,8 @@
 Build
 -----
 
+- Issue #16262: fix out-of-src-tree builds, if mercurial is not installed.
+
 - Issue #15923: fix a mistake in asdl_c.py that resulted in a TypeError after
   2801bf875a24 (see #15801).
 
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -645,8 +645,8 @@
 INSTALL_DATA
 INSTALL_SCRIPT
 INSTALL_PROGRAM
-HAS_PYTHON
-DISABLE_ASDLGEN
+PYTHON
+ASDLGEN
 HAS_HG
 HGBRANCH
 HGTAG
@@ -5281,16 +5281,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 :
-  $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 ${ac_cv_prog_PYTHON+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  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
@@ -5299,7 +5300,7 @@
   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
@@ -5307,22 +5308,26 @@
   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; }
+fi
+fi
+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
--- a/configure.ac
+++ b/configure.ac
@@ -867,12 +867,12 @@
     HGBRANCH=""
 fi
 
-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
 
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list