]> granicus.if.org Git - python/commitdiff
Issue #22359: Avoid recursive $(MAKE); disable running cross-compiled pgen
authorMartin Panter <vadmium+py@gmail.com>
Sat, 23 Apr 2016 00:58:44 +0000 (00:58 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Sat, 23 Apr 2016 00:58:44 +0000 (00:58 +0000)
Patches by Jonas Wagner and Xavier de Gaye.

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

index c4e8caa425987aa94967b79bfbe0ec5d746f7b55..f65422e2cfb93f2f168fa60981a50b2735cc0474 100644 (file)
@@ -200,6 +200,7 @@ UNICODE_OBJS=   @UNICODE_OBJS@
 PYTHON=                python$(EXE)
 BUILDPYTHON=   python$(BUILDEXE)
 
+cross_compiling=@cross_compiling@
 PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
 _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
 HOST_GNU_TYPE=  @host@
@@ -677,13 +678,19 @@ 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) $(PGENSRCS)
-               @$(MKDIR_P) Include
-               $(MAKE) $(PGEN)
-               $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
-$(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
-               $(MAKE) $(GRAMMAR_H)
-               touch $(GRAMMAR_C)
+$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN)
+       @$(MKDIR_P) Include
+       if test "$(cross_compiling)" != "yes"; then \
+               $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C); \
+       else \
+               cp $(srcdir)/Include/graminit.h $(GRAMMAR_H); \
+       fi
+$(GRAMMAR_C): $(GRAMMAR_H)
+       if test "$(cross_compiling)" != "yes"; then \
+               touch $(GRAMMAR_C); \
+       else \
+               cp $(srcdir)/Python/graminit.c $(GRAMMAR_C); \
+       fi
 
 $(PGEN):       $(PGENOBJS)
                $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
index 1b486a17abed696f71f78622335b1030d6647af3..d58c8f7a66618edb201e507b24dc359ee6144be6 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -225,6 +225,11 @@ Tests
 Build
 -----
 
+- Issue #22359: Avoid incorrect recursive $(MAKE), and disable the rules for
+  running pgen when cross-compiling.  The pgen output is normally saved with
+  the source code anyway, and is still regenerated when doing a native build.
+  Patch by Jonas Wagner and Xavier de Gaye.
+
 - Issue #19450: Update Windows builds to use SQLite 3.8.11.0.
 
 - Issue #17603: Avoid error about nonexistant fileblocks.o file by using a
index 1724be5b582039e7b47261cfac1d71cf8bf3c703..960ee0a3fd3261264dbf65b3a71fdcc985342335 100755 (executable)
--- a/configure
+++ b/configure
@@ -743,6 +743,7 @@ build_os
 build_vendor
 build_cpu
 build
+cross_compiling
 target_alias
 host_alias
 build_alias
index 3783b1e4828be128acd7abe79a8507abe9803462..2d3119b4e68062a451d42978df044d979d9b1fa4 100644 (file)
@@ -12,6 +12,7 @@ AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/)
 AC_CONFIG_SRCDIR([Include/object.h])
 AC_CONFIG_HEADER(pyconfig.h)
 
+AC_SUBST(cross_compiling)
 AC_CANONICAL_HOST
 AC_SUBST(build)
 AC_SUBST(host)