]> granicus.if.org Git - python/commitdiff
Issue #27490: Do not build pgen when cross-compiling
authorMartin Panter <vadmium+py@gmail.com>
Thu, 28 Jul 2016 01:28:27 +0000 (01:28 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Thu, 28 Jul 2016 01:28:27 +0000 (01:28 +0000)
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.

Makefile.pre.in
Misc/ACKS
Misc/NEWS
configure
configure.ac

index dffc0b9973110401d1ae868ffaae531eddf42a08..ccfdd59952e30351df75de5424f491bd40ca17ad 100644 (file)
@@ -680,7 +680,7 @@ Modules/grpmodule.o: $(srcdir)/Modules/grpmodule.c $(srcdir)/Modules/posixmodule
 
 Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.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 \
index 8edea85e4c4a5a7ab06e5d3267a9c049303a330c..7aa8fc8af825a3da032e5805b1a080d5ca4c7493 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1056,6 +1056,7 @@ Steven Pemberton
 Bo Peng
 Santiago Peresón
 George Peristerakis
+Thomas Perl
 Mathieu Perreault
 Mark Perrego
 Trevor Perrin
index 3158c33d07f6cfef8511b872df5463547ddd7685..0676ff841a6d74cc4bdbcba0172d464f1a2c9bc5 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -90,6 +90,9 @@ What's New in Python 2.7.12?
 Build
 -----
 
+- Issue #27490: Do not build pgen when cross-compiling.  Patch by Thomas
+  Perl.
+
 - Issue #26930: Update Windows builds to use OpenSSL 1.0.2h.
 
 IDLE
index 897f0a244f25f56f41d3af43ccf7b939d1872624..521dd7a06ce4c611127c6853cb9a9a32dfc16717 100755 (executable)
--- a/configure
+++ b/configure
@@ -735,6 +735,7 @@ UNIVERSALSDK
 CONFIG_ARGS
 SOVERSION
 VERSION
+PGEN_DEPENDENCY
 PYTHON_FOR_BUILD
 host_os
 host_vendor
@@ -2924,14 +2925,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
index f5e741d29ba732ee9ccc12cfceb75c2d41ec21e2..c4dfe79053e9a84239b502bb7efce4f796ba59f0 100644 (file)
@@ -36,12 +36,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