1 From 4f851142b8f3149d23654117621285df34ec768b Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Wed, 23 Dec 2015 13:58:00 +0100
4 Subject: [PATCH] Support PGEN_FOR_BUILD and FREEZE_IMPORTLIB_FOR_BUILD
6 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
8 Makefile.pre.in | 10 ++++++++++
10 2 files changed, 13 insertions(+)
12 diff --git a/Makefile.pre.in b/Makefile.pre.in
13 index 2466615..fdf622d 100644
16 @@ -712,10 +712,15 @@ Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
17 ############################################################################
20 +ifeq (@FREEZE_IMPORTLIB_FOR_BUILD@,)
21 Programs/_freeze_importlib.o: Programs/_freeze_importlib.c Makefile
23 Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN)
24 $(LINKCC) $(PY_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
26 +Programs/_freeze_importlib: @FREEZE_IMPORTLIB_FOR_BUILD@
30 Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib
31 ./Programs/_freeze_importlib \
32 @@ -789,8 +794,13 @@ $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN)
33 $(GRAMMAR_C): $(GRAMMAR_H)
36 +ifeq (@PGEN_FOR_BUILD@,)
38 $(CC) $(OPT) $(PY_LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
40 +$(PGEN): @PGEN_FOR_BUILD@
44 Parser/grammar.o: $(srcdir)/Parser/grammar.c \
45 $(srcdir)/Include/token.h \
46 diff --git a/configure.ac b/configure.ac
47 index c4c2353..750c232 100644
50 @@ -79,6 +79,9 @@ else
52 AC_SUBST(PYTHON_FOR_BUILD)
54 +AC_SUBST(PGEN_FOR_BUILD)
55 +AC_SUBST(FREEZE_IMPORTLIB_FOR_BUILD)
57 dnl Ensure that if prefix is specified, it does not end in a slash. If
58 dnl it does, we get path names containing '//' which is both ugly and
59 dnl can cause trouble.