summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-07-28 01:28:27 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-07-28 01:28:27 (GMT)
commiteac67be948e972dc12b7b4abfa83b09becf6422c (patch)
tree0a6627d7d36fcb503c5330aec167280582390520
parente33797b686d764014aeaf80d7b4cb24863d238d9 (diff)
downloadcpython-eac67be948e972dc12b7b4abfa83b09becf6422c.zip
cpython-eac67be948e972dc12b7b4abfa83b09becf6422c.tar.gz
cpython-eac67be948e972dc12b7b4abfa83b09becf6422c.tar.bz2
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.
-rw-r--r--Makefile.pre.in2
-rw-r--r--Misc/ACKS1
-rw-r--r--Misc/NEWS3
-rwxr-xr-xconfigure4
-rw-r--r--configure.ac3
5 files changed, 12 insertions, 1 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 369b330..d30e565 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -789,7 +789,7 @@ Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile
$(IO_OBJS): $(IO_H)
-$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN)
+$(GRAMMAR_H): $(GRAMMAR_INPUT) @PGEN_DEPENDENCY@
@$(MKDIR_P) Include
# Avoid copying the file onto itself for an in-tree build
if test "$(cross_compiling)" != "yes"; then \
diff --git a/Misc/ACKS b/Misc/ACKS
index 2b32fb8..a4a4cdc 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1120,6 +1120,7 @@ Steven Pemberton
Bo Peng
Santiago Peresón
George Peristerakis
+Thomas Perl
Mathieu Perreault
Mark Perrego
Trevor Perrin
diff --git a/Misc/NEWS b/Misc/NEWS
index 3ac2ed3..799e1f0 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -145,6 +145,9 @@ Windows
Build
-----
+- Issue #27490: Do not build pgen when cross-compiling. Patch by Thomas
+ Perl.
+
- Issue #26662: Set PYTHON_FOR_GEN in configure as the Python program to be
used for file generation during the build.
diff --git a/configure b/configure
index 550c1bb..f0cf515 100755
--- a/configure
+++ b/configure
@@ -739,6 +739,7 @@ UNIVERSALSDK
CONFIG_ARGS
SOVERSION
VERSION
+PGEN_DEPENDENCY
PYTHON_FOR_BUILD
PYTHON_FOR_GEN
host_os
@@ -3049,14 +3050,17 @@ $as_echo_n "checking for python interpreter for cross build... " >&6; }
$as_echo "$interp" >&6; }
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
fi
+ PGEN_DEPENDENCY=''
elif test "$cross_compiling" = maybe; then
as_fn_error $? "Cross compiling required --host=HOST-TUPLE and --build=ARCH" "$LINENO" 5
else
PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
+ PGEN_DEPENDENCY='$(PGEN)'
fi
+
if test "$prefix" != "/"; then
prefix=`echo "$prefix" | sed -e 's/\/$//g'`
fi
diff --git a/configure.ac b/configure.ac
index bf27ab8..bf2a348 100644
--- a/configure.ac
+++ b/configure.ac
@@ -81,12 +81,15 @@ if test "$cross_compiling" = yes; then
AC_MSG_RESULT($interp)
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
fi
+ PGEN_DEPENDENCY=''
elif test "$cross_compiling" = maybe; then
AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
else
PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
+ PGEN_DEPENDENCY='$(PGEN)'
fi
AC_SUBST(PYTHON_FOR_BUILD)
+AC_SUBST(PGEN_DEPENDENCY)
dnl Ensure that if prefix is specified, it does not end in a slash. If
dnl it does, we get path names containing '//' which is both ugly and