This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author thomas.perl
Recipients Alex.Willmer, martin.panter, thomas.perl
Date 2016-07-13.10:25:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1468405528.99.0.496885309837.issue27490@psf.upfronthosting.co.za>
In-reply-to
Content
Yes setting "CC" would fix the problem, but i guess the CFLAGS issue was just the original symptom (and my first reaction to fixing it), whereas the underlying problem is that pgen gets built in cases where it shouldn't be built at all.

The solution with "ifeq" does seem to require GNU make, and since these conditionals would still appear in the Makefile even for non-cross-builds, we can't really use this if compatibility with non-GNU make is a requirement.

Based on http://gallium.inria.fr/blog/portable-conditionals-in-makefiles/, here is something that seems to work ($(PGEN_DEPS) will be $(PGEN) when cross_compiling=no, and empty when cross_compiling=yes, and configure.ac errors out if cross_compiling is "maybe", so we do not need to handle that case at the moment):

=====
diff -ru Python-2.7.12/Makefile.pre.in Python-2.7.12-fix/Makefile.pre.in
--- Python-2.7.12/Makefile.pre.in	2016-06-25 23:49:31.000000000 +0200
+++ Python-2.7.12-fix/Makefile.pre.in	2016-07-13 12:21:27.000000000 +0200
@@ -246,6 +246,8 @@
 ##########################################################################
 # Parser
 PGEN=		Parser/pgen$(EXE)
+PGEN_DEPS0=     ${cross_compiling:yes=}
+PGEN_DEPS=      ${PGEN_DEPS0:no=$(PGEN)}
 
 PSRCS=		\
 		Parser/acceler.c \
@@ -680,7 +682,7 @@
 
 Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h
 
-$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN)
+$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN_DEPS)
 	@$(MKDIR_P) Include
 	# Avoid copying the file onto itself for an in-tree build
 	if test "$(cross_compiling)" != "yes"; then \
=====
History
Date User Action Args
2016-07-13 10:25:29thomas.perlsetrecipients: + thomas.perl, martin.panter, Alex.Willmer
2016-07-13 10:25:28thomas.perlsetmessageid: <1468405528.99.0.496885309837.issue27490@psf.upfronthosting.co.za>
2016-07-13 10:25:28thomas.perllinkissue27490 messages
2016-07-13 10:25:28thomas.perlcreate