linux-headers: bump 4.{4, 9}.x series
[buildroot-gz.git] / package / python3 / 0030-Support-PGEN_FOR_BUILD-and-FREEZE_IMPORTLIB_FOR_BUIL.patch
blob156eb2958ddda9df941324c5ae3c559b5ec38ba6
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>
7 ---
8 Makefile.pre.in | 10 ++++++++++
9 configure.ac | 3 +++
10 2 files changed, 13 insertions(+)
12 diff --git a/Makefile.pre.in b/Makefile.pre.in
13 index 2466615..fdf622d 100644
14 --- a/Makefile.pre.in
15 +++ b/Makefile.pre.in
16 @@ -712,10 +712,15 @@ Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
17 ############################################################################
18 # Importlib
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)
25 +else
26 +Programs/_freeze_importlib: @FREEZE_IMPORTLIB_FOR_BUILD@
27 + cp $^ $@
28 +endif
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)
34 touch $(GRAMMAR_C)
36 +ifeq (@PGEN_FOR_BUILD@,)
37 $(PGEN): $(PGENOBJS)
38 $(CC) $(OPT) $(PY_LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
39 +else
40 +$(PGEN): @PGEN_FOR_BUILD@
41 + cp $^ $@
42 +endif
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
48 --- a/configure.ac
49 +++ b/configure.ac
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.
60 --
61 2.6.4