python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / python3 / 0030-Support-PGEN_FOR_BUILD-and-FREEZE_IMPORTLIB_FOR_BUIL.patch
blob2b7ec0578c3210306d53ac21c3df82c3bf9d5acc
1 From e151b6863bd8f697f17b50eda2cecef57e433c3e 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 0c26bcf..d1237eb 100644
14 --- a/Makefile.pre.in
15 +++ b/Makefile.pre.in
16 @@ -719,10 +719,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 if test "$(cross_compiling)" != "yes"; then \
32 @@ -811,8 +816,13 @@ $(GRAMMAR_C): $(GRAMMAR_H)
33 mv $(GRAMMAR_C).tmp $(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 4e2b88e..16a827c 100644
48 --- a/configure.ac
49 +++ b/configure.ac
50 @@ -80,6 +80,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.7.4