Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c4c4842

Browse files
committed
- Issue #16262: fix out-of-src-tree builds, if mercurial is not installed.
1 parent 5f8f0d6 commit c4c4842

4 files changed

Lines changed: 31 additions & 24 deletions

File tree

Makefile.pre.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ AST_ASDL= $(srcdir)/Parser/Python.asdl
280280

281281
ASDLGEN_FILES= $(srcdir)/Parser/asdl.py $(srcdir)/Parser/asdl_c.py
282282
# XXX Note that a build now requires Python exist before the build starts
283-
ASDLGEN= @DISABLE_ASDLGEN@ $(srcdir)/Parser/asdl_c.py
283+
ASDLGEN= @ASDLGEN@ $(srcdir)/Parser/asdl_c.py
284284

285285
##########################################################################
286286
# Python

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,8 @@ Tests
590590
Build
591591
-----
592592

593+
- Issue #16262: fix out-of-src-tree builds, if mercurial is not installed.
594+
593595
- Issue #15923: fix a mistake in asdl_c.py that resulted in a TypeError after
594596
2801bf875a24 (see #15801).
595597

configure

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,8 @@ MKDIR_P
645645
INSTALL_DATA
646646
INSTALL_SCRIPT
647647
INSTALL_PROGRAM
648-
HAS_PYTHON
649-
DISABLE_ASDLGEN
648+
PYTHON
649+
ASDLGEN
650650
HAS_HG
651651
HGBRANCH
652652
HGTAG
@@ -5281,16 +5281,17 @@ else
52815281
fi
52825282

52835283

5284-
DISABLE_ASDLGEN=""
5285-
# Extract the first word of "python", so it can be a program name with args.
5286-
set dummy python; ac_word=$2
5284+
for ac_prog in python$PACKAGE_VERSION python3 python
5285+
do
5286+
# Extract the first word of "$ac_prog", so it can be a program name with args.
5287+
set dummy $ac_prog; ac_word=$2
52875288
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
52885289
$as_echo_n "checking for $ac_word... " >&6; }
5289-
if ${ac_cv_prog_HAS_PYTHON+:} false; then :
5290+
if ${ac_cv_prog_PYTHON+:} false; then :
52905291
$as_echo_n "(cached) " >&6
52915292
else
5292-
if test -n "$HAS_PYTHON"; then
5293-
ac_cv_prog_HAS_PYTHON="$HAS_PYTHON" # Let the user override the test.
5293+
if test -n "$PYTHON"; then
5294+
ac_cv_prog_PYTHON="$PYTHON" # Let the user override the test.
52945295
else
52955296
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
52965297
for as_dir in $PATH
@@ -5299,30 +5300,34 @@ do
52995300
test -z "$as_dir" && as_dir=.
53005301
for ac_exec_ext in '' $ac_executable_extensions; do
53015302
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5302-
ac_cv_prog_HAS_PYTHON="found"
5303+
ac_cv_prog_PYTHON="$ac_prog"
53035304
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
53045305
break 2
53055306
fi
53065307
done
53075308
done
53085309
IFS=$as_save_IFS
53095310

5310-
test -z "$ac_cv_prog_HAS_PYTHON" && ac_cv_prog_HAS_PYTHON="not-found"
53115311
fi
53125312
fi
5313-
HAS_PYTHON=$ac_cv_prog_HAS_PYTHON
5314-
if test -n "$HAS_PYTHON"; then
5315-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_PYTHON" >&5
5316-
$as_echo "$HAS_PYTHON" >&6; }
5313+
PYTHON=$ac_cv_prog_PYTHON
5314+
if test -n "$PYTHON"; then
5315+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
5316+
$as_echo "$PYTHON" >&6; }
53175317
else
53185318
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
53195319
$as_echo "no" >&6; }
53205320
fi
53215321

53225322

5323-
if test $HAS_HG != found -o $HAS_PYTHON != found
5324-
then
5325-
DISABLE_ASDLGEN="@echo hg: $HAS_HG, python: $HAS_PYTHON! cannot run \$(srcdir)/Parser/asdl_c.py #"
5323+
test -n "$PYTHON" && break
5324+
done
5325+
test -n "$PYTHON" || PYTHON="not-found"
5326+
5327+
if $PYTHON = not-found; then
5328+
ASDLGEN="@echo python: $PYTHON! cannot run \$(srcdir)/Parser/asdl_c.py #"
5329+
else
5330+
ASDLGEN="$PYTHON"
53265331
fi
53275332

53285333

configure.ac

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -867,12 +867,12 @@ else
867867
HGBRANCH=""
868868
fi
869869

870-
AC_SUBST(DISABLE_ASDLGEN)
871-
DISABLE_ASDLGEN=""
872-
AC_CHECK_PROG(HAS_PYTHON, python, found, not-found)
873-
if test $HAS_HG != found -o $HAS_PYTHON != found
874-
then
875-
DISABLE_ASDLGEN="@echo hg: $HAS_HG, python: $HAS_PYTHON! cannot run \$(srcdir)/Parser/asdl_c.py #"
870+
AC_SUBST(ASDLGEN)
871+
AC_CHECK_PROGS(PYTHON, python$PACKAGE_VERSION python3 python, not-found)
872+
if $PYTHON = not-found; then
873+
ASDLGEN="@echo python: $PYTHON! cannot run \$(srcdir)/Parser/asdl_c.py #"
874+
else
875+
ASDLGEN="$PYTHON"
876876
fi
877877

878878

0 commit comments

Comments
 (0)