]> granicus.if.org Git - python/commitdiff
Issue #27229: Fix in-tree cross-build rule, by Xavier de Gaye
authorMartin Panter <vadmium+py@gmail.com>
Tue, 7 Jun 2016 00:27:17 +0000 (00:27 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Tue, 7 Jun 2016 00:27:17 +0000 (00:27 +0000)
Makefile.pre.in
Misc/NEWS

index 5aeb5027a128743614516f86da8081a928a495f1..dd3db0461c56820f42646bf68a00caa032291d16 100644 (file)
@@ -685,13 +685,16 @@ $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN)
        if test "$(cross_compiling)" != "yes"; then \
                $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C); \
        else \
-               cp $(srcdir)/Include/graminit.h $(GRAMMAR_H); \
+               # Avoid copying the file onto itself for an in-tree build \
+               cp $(srcdir)/Include/graminit.h $(GRAMMAR_H).tmp; \
+               mv $(GRAMMAR_H).tmp $(GRAMMAR_H); \
        fi
 $(GRAMMAR_C): $(GRAMMAR_H)
        if test "$(cross_compiling)" != "yes"; then \
                touch $(GRAMMAR_C); \
        else \
-               cp $(srcdir)/Python/graminit.c $(GRAMMAR_C); \
+               cp $(srcdir)/Python/graminit.c $(GRAMMAR_C).tmp; \
+               mv $(GRAMMAR_C).tmp $(GRAMMAR_C); \
        fi
 
 $(PGEN):       $(PGENOBJS)
index 8fb478daea1f38a82dd45acc16c70980ab23a3ab..2107d09133ae02ea48c94ab511008da5a342adb8 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -321,6 +321,9 @@ Build
 
 - Issue #19450: Update Windows builds to use SQLite 3.8.11.0.
 
+- Issue #27229: Fix the cross-compiling pgen rule for in-tree builds.  Patch
+  by Xavier de Gaye.
+
 - Issue #17603: Avoid error about nonexistant fileblocks.o file by using a
   lower-level check for st_blocks in struct stat.