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

Skip to content

Commit 4b53359

Browse files
committed
Issue #27490: Merge pgen cross-compile logic from 3.5
2 parents 2561726 + eac67be commit 4b53359

5 files changed

Lines changed: 12 additions & 1 deletion

File tree

Makefile.pre.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile
791791

792792
$(IO_OBJS): $(IO_H)
793793

794-
$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN)
794+
$(GRAMMAR_H): $(GRAMMAR_INPUT) @PGEN_DEPENDENCY@
795795
@$(MKDIR_P) Include
796796
# Avoid copying the file onto itself for an in-tree build
797797
if test "$(cross_compiling)" != "yes"; then \

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,7 @@ Steven Pemberton
11311131
Bo Peng
11321132
Santiago Peresón
11331133
George Peristerakis
1134+
Thomas Perl
11341135
Mathieu Perreault
11351136
Mark Perrego
11361137
Trevor Perrin

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ Windows
8080
Build
8181
-----
8282

83+
- Issue #27490: Do not build pgen when cross-compiling. Patch by Thomas
84+
Perl.
85+
8386
- Issue #26662: Set PYTHON_FOR_GEN in configure as the Python program to be
8487
used for file generation during the build.
8588

configure

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,7 @@ UNIVERSALSDK
740740
CONFIG_ARGS
741741
SOVERSION
742742
VERSION
743+
PGEN_DEPENDENCY
743744
PYTHON_FOR_BUILD
744745
PYTHON_FOR_GEN
745746
host_os
@@ -3050,14 +3051,17 @@ $as_echo_n "checking for python interpreter for cross build... " >&6; }
30503051
$as_echo "$interp" >&6; }
30513052
PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
30523053
fi
3054+
PGEN_DEPENDENCY=''
30533055
elif test "$cross_compiling" = maybe; then
30543056
as_fn_error $? "Cross compiling required --host=HOST-TUPLE and --build=ARCH" "$LINENO" 5
30553057
else
30563058
PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
3059+
PGEN_DEPENDENCY='$(PGEN)'
30573060
fi
30583061

30593062

30603063

3064+
30613065
if test "$prefix" != "/"; then
30623066
prefix=`echo "$prefix" | sed -e 's/\/$//g'`
30633067
fi

configure.ac

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,15 @@ if test "$cross_compiling" = yes; then
8181
AC_MSG_RESULT($interp)
8282
PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
8383
fi
84+
PGEN_DEPENDENCY=''
8485
elif test "$cross_compiling" = maybe; then
8586
AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
8687
else
8788
PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
89+
PGEN_DEPENDENCY='$(PGEN)'
8890
fi
8991
AC_SUBST(PYTHON_FOR_BUILD)
92+
AC_SUBST(PGEN_DEPENDENCY)
9093

9194
dnl Ensure that if prefix is specified, it does not end in a slash. If
9295
dnl it does, we get path names containing '//' which is both ugly and

0 commit comments

Comments
 (0)