Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bb70760

Browse files
committed
Issue #27229: Merge cross-compiling fix from 3.5
2 parents 6db1f6f + 9c2a8f9 commit bb70760

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Makefile.pre.in

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,13 +793,16 @@ $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN)
793793
if test "$(cross_compiling)" != "yes"; then \
794794
$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C); \
795795
else \
796-
cp $(srcdir)/Include/graminit.h $(GRAMMAR_H); \
796+
# Avoid copying the file onto itself for an in-tree build \
797+
cp $(srcdir)/Include/graminit.h $(GRAMMAR_H).tmp; \
798+
mv $(GRAMMAR_H).tmp $(GRAMMAR_H); \
797799
fi
798800
$(GRAMMAR_C): $(GRAMMAR_H)
799801
if test "$(cross_compiling)" != "yes"; then \
800802
touch $(GRAMMAR_C); \
801803
else \
802-
cp $(srcdir)/Python/graminit.c $(GRAMMAR_C); \
804+
cp $(srcdir)/Python/graminit.c $(GRAMMAR_C).tmp; \
805+
mv $(GRAMMAR_C).tmp $(GRAMMAR_C); \
803806
fi
804807

805808
$(PGEN): $(PGENOBJS)

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ Windows
137137
Build
138138
-----
139139

140+
- Issue #27229: Fix the cross-compiling pgen rule for in-tree builds. Patch
141+
by Xavier de Gaye.
142+
140143
- Issue #26930: Update OS X 10.5+ 32-bit-only installer to build
141144
and link with OpenSSL 1.0.2h.
142145

0 commit comments

Comments
 (0)