2
1

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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. From 9dd808909ea18f8e99272cbdf1e39151bff62037 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. ---
  11. Makefile.pre.in | 2 ++
  12. configure.ac | 6 ++++++
  13. 2 files changed, 8 insertions(+)
  14. diff --git a/Makefile.pre.in b/Makefile.pre.in
  15. index 4d1921bf435..f90ec2eeb1d 100644
  16. --- a/Makefile.pre.in
  17. +++ b/Makefile.pre.in
  18. @@ -2139,6 +2139,7 @@ libinstall: all $(srcdir)/Modules/xxmodule.c
  19. $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
  20. $(DESTDIR)$(LIBDEST)/distutils/tests ; \
  21. fi
  22. +ifeq (@PYC_BUILD@,yes)
  23. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  24. $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
  25. -j0 -d $(LIBDEST) -f \
  26. @@ -2166,6 +2167,7 @@ libinstall: all $(srcdir)/Modules/xxmodule.c
  27. $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
  28. -j0 -d $(LIBDEST)/site-packages -f \
  29. -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
  30. +endif
  31. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  32. $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
  33. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  34. diff --git a/configure.ac b/configure.ac
  35. index bbe7f891e7d..7b136bd2f0b 100644
  36. --- a/configure.ac
  37. +++ b/configure.ac
  38. @@ -1459,6 +1459,12 @@ fi
  39. AC_MSG_CHECKING(LDLIBRARY)
  40. +AC_SUBST(PYC_BUILD)
  41. +
  42. +AC_ARG_ENABLE(pyc-build,
  43. + AS_HELP_STRING([--disable-pyc-build], [disable build of pyc files]),
  44. + [ PYC_BUILD="${enableval}" ], [ PYC_BUILD=yes ])
  45. +
  46. # MacOSX framework builds need more magic. LDLIBRARY is the dynamic
  47. # library that we build, but we do not want to link against it (we
  48. # will find it with a -framework option). For this reason there is an
  49. --
  50. 2.44.0