0001-Make-the-build-of-pyc-files-conditional.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. From e568f4deb7c648e3265154574db753601636cdda Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Wed, 22 Feb 2017 16:21:31 -0800
  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. [ Andrey Smrinov: ported to Python 3.6 ]
  9. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
  10. [aduskett@gmail.com: Update for python 3.6.4]
  11. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  12. ---
  13. Makefile.pre.in | 2 ++
  14. configure.ac | 6 ++++++
  15. 2 files changed, 8 insertions(+)
  16. diff --git a/Makefile.pre.in b/Makefile.pre.in
  17. index 82e830727e..b38bd79121 100644
  18. --- a/Makefile.pre.in
  19. +++ b/Makefile.pre.in
  20. @@ -1345,6 +1345,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c
  21. $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
  22. $(DESTDIR)$(LIBDEST)/distutils/tests ; \
  23. fi
  24. +ifeq (@PYC_BUILD@,yes)
  25. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  26. $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
  27. -d $(LIBDEST) -f \
  28. @@ -1372,6 +1373,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c
  29. $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
  30. -d $(LIBDEST)/site-packages -f \
  31. -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
  32. +endif
  33. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  34. $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
  35. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  36. diff --git a/configure.ac b/configure.ac
  37. index 962006704f..a76b5444df 100644
  38. --- a/configure.ac
  39. +++ b/configure.ac
  40. @@ -1113,6 +1113,12 @@ fi
  41. AC_MSG_CHECKING(LDLIBRARY)
  42. +AC_SUBST(PYC_BUILD)
  43. +
  44. +AC_ARG_ENABLE(pyc-build,
  45. + AS_HELP_STRING([--disable-pyc-build], [disable build of pyc files]),
  46. + [ PYC_BUILD="${enableval}" ], [ PYC_BUILD=yes ])
  47. +
  48. # MacOSX framework builds need more magic. LDLIBRARY is the dynamic
  49. # library that we build, but we do not want to link against it (we
  50. # will find it with a -framework option). For this reason there is an
  51. --
  52. 2.13.5