1 From 28f81597314ea3ed03935b519453a55cf6c3c20d Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Wed, 23 Dec 2015 11:29:35 +0100
4 Subject: [PATCH] Make the build of pyc files conditional
6 This commit adds a new configure option --disable-pyc-build to disable
7 the compilation of pyc.
9 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
11 Makefile.pre.in | 2 ++
12 configure.ac | 6 ++++++
13 2 files changed, 8 insertions(+)
15 diff --git a/Makefile.pre.in b/Makefile.pre.in
16 index 4d2a061..272f312 100644
19 @@ -1283,6 +1283,7 @@ 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 $(DESTDIR)$(LIBDEST)/compileall.py \
27 @@ -1310,6 +1311,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
28 $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
29 -d $(LIBDEST)/site-packages -f \
30 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
32 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
33 $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
34 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
35 diff --git a/configure.ac b/configure.ac
36 index 76b70a0..66d4642 100644
39 @@ -1056,6 +1056,12 @@ fi
41 AC_MSG_CHECKING(LDLIBRARY)
45 +AC_ARG_ENABLE(pyc-build,
46 + AS_HELP_STRING([--disable-pyc-build], [disable build of pyc files]),
47 + [ PYC_BUILD="${enableval}" ], [ PYC_BUILD=yes ])
49 # MacOSX framework builds need more magic. LDLIBRARY is the dynamic
50 # library that we build, but we do not want to link against it (we
51 # will find it with a -framework option). For this reason there is an