python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / python / 0004-Make-the-compilation-of-.pyc-and-.pyo-conditional.patch
blob3bf407d54274c554269cc9fd8ad31f6877e56daa
1 From 168e6c594e80395583de5ab0d082be119b2061fc Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Tue, 7 Mar 2017 22:18:57 +0100
4 Subject: [PATCH] Make the compilation of .pyc and .pyo conditional
6 This commit adds --{enable,disable}-{pyc,pyo} options to enable/disable
7 the compilation of pyc/pyo files.
9 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
10 ---
11 Makefile.pre.in | 8 ++++++++
12 configure.ac | 11 +++++++++++
13 2 files changed, 19 insertions(+)
15 diff --git a/Makefile.pre.in b/Makefile.pre.in
16 index 5367df7..96fc718 100644
17 --- a/Makefile.pre.in
18 +++ b/Makefile.pre.in
19 @@ -1128,24 +1128,32 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
20 $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
21 $(DESTDIR)$(LIBDEST)/distutils/tests ; \
23 +ifeq (@PYC_BUILD@,yes)
24 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
25 $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
26 -d $(LIBDEST) -f \
27 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
28 $(DESTDIR)$(LIBDEST)
29 +endif
30 +ifeq (@PYO_BUILD@,yes)
31 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
32 $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
33 -d $(LIBDEST) -f \
34 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
35 $(DESTDIR)$(LIBDEST)
36 +endif
37 +ifeq (@PYC_BUILD@,yes)
38 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
39 $(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
40 -d $(LIBDEST)/site-packages -f \
41 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
42 +endif
43 +ifeq (@PYO_BUILD@,yes)
44 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
45 $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
46 -d $(LIBDEST)/site-packages -f \
47 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
48 +endif
49 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
50 $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
51 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
52 diff --git a/configure.ac b/configure.ac
53 index 5f89797..4aafc82 100644
54 --- a/configure.ac
55 +++ b/configure.ac
56 @@ -759,6 +759,17 @@ SunOS*)
58 esac
60 +AC_SUBST(PYC_BUILD)
62 +AC_ARG_ENABLE(pyc-build,
63 + AS_HELP_STRING([--disable-pyc-build], [disable build of pyc files]),
64 + [ PYC_BUILD="${enableval}" ], [ PYC_BUILD=yes ])
66 +AC_SUBST(PYO_BUILD)
68 +AC_ARG_ENABLE(pyo-build,
69 + AS_HELP_STRING([--disable-pyo-build], [disable build of pyo files]),
70 + [ PYO_BUILD="${enableval}" ], [ PYO_BUILD=yes ])
72 AC_SUBST(LIBRARY)
73 AC_MSG_CHECKING(LIBRARY)
74 --
75 2.7.4