Thomas Perl added the comment: 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 \ ===== ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27490> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com