Skip to content

Commit 7e394ca

Browse files
committed
Issue #27490: Do not build pgen when cross-compiling
The dependendency on the $(PGEN) variable must only be set when not cross-compiling. When cross-compiling, $(PGEN) will not be used, so no need to build it. Patch by Thomas Perl.
1 parent 7408c0a commit 7e394ca

File tree

5 files changed

+12
-1
lines changed

5 files changed

+12
-1
lines changed

Makefile.pre.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile
789789

790790
$(IO_OBJS): $(IO_H)
791791

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

Misc/ACKS

+1
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,7 @@ Steven Pemberton
11201120
Bo Peng
11211121
Santiago Peresón
11221122
George Peristerakis
1123+
Thomas Perl
11231124
Mathieu Perreault
11241125
Mark Perrego
11251126
Trevor Perrin

Misc/NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ Windows
145145
Build
146146
-----
147147

148+
- Issue #27490: Do not build pgen when cross-compiling. Patch by Thomas
149+
Perl.
150+
148151
- Issue #26662: Set PYTHON_FOR_GEN in configure as the Python program to be
149152
used for file generation during the build.
150153

configure

+4
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,7 @@ UNIVERSALSDK
739739
CONFIG_ARGS
740740
SOVERSION
741741
VERSION
742+
PGEN_DEPENDENCY
742743
PYTHON_FOR_BUILD
743744
PYTHON_FOR_GEN
744745
host_os
@@ -3049,14 +3050,17 @@ $as_echo_n "checking for python interpreter for cross build... " >&6; }
30493050
$as_echo "$interp" >&6; }
30503051
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
30513052
fi
3053+
PGEN_DEPENDENCY=''
30523054
elif test "$cross_compiling" = maybe; then
30533055
as_fn_error $? "Cross compiling required --host=HOST-TUPLE and --build=ARCH" "$LINENO" 5
30543056
else
30553057
PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
3058+
PGEN_DEPENDENCY='$(PGEN)'
30563059
fi
30573060

30583061

30593062

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

configure.ac

+3
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)