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

Skip to content

Commit 9c2a8f9

Browse files
committed
Issue #27229: Fix in-tree cross-build rule, by Xavier de Gaye
1 parent 8f5798e commit 9c2a8f9

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
@@ -581,6 +581,9 @@ Build
581581
source code anyway, and is still regenerated when doing a native build.
582582
Patch by Xavier de Gaye.
583583

584+
- Issue #27229: Fix the cross-compiling pgen rule for in-tree builds. Patch
585+
by Xavier de Gaye.
586+
584587
- Issue #21668: Link audioop, _datetime, _ctypes_test modules to libm,
585588
except on Mac OS X. Patch written by Xavier de Gaye.
586589

0 commit comments

Comments
 (0)