005-pyc-pyo-conditional.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. Index: b/Makefile.pre.in
  2. ===================================================================
  3. --- a/Makefile.pre.in
  4. +++ b/Makefile.pre.in
  5. @@ -1248,24 +1248,32 @@
  6. $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
  7. $(DESTDIR)$(LIBDEST)/distutils/tests ; \
  8. fi
  9. +ifeq (@PYC_BUILD@,yes)
  10. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  11. $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
  12. -d $(LIBDEST) -f $(STDLIB_CACHE_FLAGS) \
  13. -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
  14. $(DESTDIR)$(LIBDEST)
  15. +endif
  16. +ifeq (@PYO_BUILD@,yes)
  17. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  18. $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
  19. -d $(LIBDEST) -f $(STDLIB_CACHE_FLAGS) \
  20. -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
  21. $(DESTDIR)$(LIBDEST)
  22. +endif
  23. +ifeq (@PYC_BUILD@,yes)
  24. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  25. $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
  26. -d $(LIBDEST)/site-packages -f $(STDLIB_CACHE_FLAGS) \
  27. -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
  28. +endif
  29. +ifeq (@PYO_BUILD@,yes)
  30. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  31. $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
  32. -d $(LIBDEST)/site-packages -f $(STDLIB_CACHE_FLAGS) \
  33. -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
  34. +endif
  35. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  36. $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
  37. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  38. Index: b/configure.ac
  39. ===================================================================
  40. --- a/configure.ac
  41. +++ b/configure.ac
  42. @@ -939,6 +939,18 @@
  43. AC_MSG_CHECKING(LDLIBRARY)
  44. +AC_SUBST(PYC_BUILD)
  45. +
  46. +AC_ARG_ENABLE(pyc-build,
  47. + AS_HELP_STRING([--disable-pyc-build], [disable build of pyc files]),
  48. + [ PYC_BUILD="${enableval}" ], [ PYC_BUILD=yes ])
  49. +
  50. +AC_SUBST(PYO_BUILD)
  51. +
  52. +AC_ARG_ENABLE(pyo-build,
  53. + AS_HELP_STRING([--disable-pyo-build], [disable build of pyo files]),
  54. + [ PYO_BUILD="${enableval}" ], [ PYO_BUILD=yes ])
  55. +
  56. # MacOSX framework builds need more magic. LDLIBRARY is the dynamic
  57. # library that we build, but we do not want to link against it (we
  58. # will find it with a -framework option). For this reason there is an