From: Martin Panter Date: Tue, 7 Jun 2016 00:27:17 +0000 (+0000) Subject: Issue #27229: Fix in-tree cross-build rule, by Xavier de Gaye X-Git-Tag: v3.5.2rc1~42 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9c2a8f97da41e230bcd25bf169d254ee74be2f6a;p=thirdparty%2FPython%2Fcpython.git Issue #27229: Fix in-tree cross-build rule, by Xavier de Gaye --- diff --git a/Makefile.pre.in b/Makefile.pre.in index dee126395b8b..eb88f5f0d81b 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -793,13 +793,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) diff --git a/Misc/NEWS b/Misc/NEWS index feb0c624b8a5..da2dc3ec8e39 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -581,6 +581,9 @@ Build source code anyway, and is still regenerated when doing a native build. Patch by Xavier de Gaye. +- Issue #27229: Fix the cross-compiling pgen rule for in-tree builds. Patch + by Xavier de Gaye. + - Issue #21668: Link audioop, _datetime, _ctypes_test modules to libm, except on Mac OS X. Patch written by Xavier de Gaye.