2
1

0003-Make-the-build-of-pyc-files-conditional.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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
  5. This commit adds a new configure option --disable-pyc-build to disable
  6. the compilation of pyc.
  7. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  8. ---
  9. Makefile.pre.in | 2 ++
  10. configure.ac | 6 ++++++
  11. 2 files changed, 8 insertions(+)
  12. diff --git a/Makefile.pre.in b/Makefile.pre.in
  13. index 4d2a061..272f312 100644
  14. --- a/Makefile.pre.in
  15. +++ b/Makefile.pre.in
  16. @@ -1283,6 +1283,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  17. $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
  18. $(DESTDIR)$(LIBDEST)/distutils/tests ; \
  19. fi
  20. +ifeq (@PYC_BUILD@,yes)
  21. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  22. $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
  23. -d $(LIBDEST) -f \
  24. @@ -1310,6 +1311,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  25. $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
  26. -d $(LIBDEST)/site-packages -f \
  27. -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
  28. +endif
  29. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  30. $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
  31. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  32. diff --git a/configure.ac b/configure.ac
  33. index 76b70a0..66d4642 100644
  34. --- a/configure.ac
  35. +++ b/configure.ac
  36. @@ -1056,6 +1056,12 @@ fi
  37. AC_MSG_CHECKING(LDLIBRARY)
  38. +AC_SUBST(PYC_BUILD)
  39. +
  40. +AC_ARG_ENABLE(pyc-build,
  41. + AS_HELP_STRING([--disable-pyc-build], [disable build of pyc files]),
  42. + [ PYC_BUILD="${enableval}" ], [ PYC_BUILD=yes ])
  43. +
  44. # MacOSX framework builds need more magic. LDLIBRARY is the dynamic
  45. # library that we build, but we do not want to link against it (we
  46. # will find it with a -framework option). For this reason there is an
  47. --
  48. 2.6.4