106-optional-expat.patch 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. Add an option to disable expat
  2. This patch replaces the existing --with-system-expat option with a
  3. --with-expat={system,builtin,none} option, which allows to tell Python
  4. whether we want to use the system expat (already installed), the expat
  5. builtin the Python sources, or no expat at all (which disables the
  6. installation of XML modules).
  7. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  8. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  9. ---
  10. Makefile.pre.in | 6 +++++-
  11. configure.in | 18 +++++++++++++-----
  12. setup.py | 2 +-
  13. 3 files changed, 19 insertions(+), 7 deletions(-)
  14. Index: b/Makefile.pre.in
  15. ===================================================================
  16. --- a/Makefile.pre.in
  17. +++ b/Makefile.pre.in
  18. @@ -968,7 +968,7 @@
  19. logging bsddb csv importlib wsgiref \
  20. ctypes ctypes/macholib \
  21. idlelib idlelib/Icons \
  22. - distutils distutils/command $(XMLLIBSUBDIRS) \
  23. + distutils distutils/command \
  24. multiprocessing multiprocessing/dummy \
  25. unittest \
  26. lib-old \
  27. @@ -1018,6 +1018,10 @@
  28. LIBSUBDIRS += curses
  29. endif
  30. +ifeq (@EXPAT@,yes)
  31. +LIBSUBDIRS += $(XMLLIBSUBDIRS)
  32. +endif
  33. +
  34. libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  35. @for i in $(SCRIPTDIR) $(LIBDEST); \
  36. do \
  37. Index: b/configure.ac
  38. ===================================================================
  39. --- a/configure.ac
  40. +++ b/configure.ac
  41. @@ -2298,13 +2298,21 @@
  42. AC_SUBST(DISABLED_EXTENSIONS)
  43. # Check for use of the system expat library
  44. -AC_MSG_CHECKING(for --with-system-expat)
  45. -AC_ARG_WITH(system_expat,
  46. - AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library]),
  47. +AC_MSG_CHECKING(for --with-expat)
  48. +AC_ARG_WITH(expat,
  49. + AS_HELP_STRING([--with-expat], [select which expat version to use: system, builtin, none]),
  50. [],
  51. - [with_system_expat="no"])
  52. + [with_expat="builtin"])
  53. -AC_MSG_RESULT($with_system_expat)
  54. +AC_MSG_RESULT($with_expat)
  55. +
  56. +if test "$with_expat" != "none"; then
  57. + EXPAT=yes
  58. +else
  59. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} pyexpat"
  60. + EXPAT=no
  61. +fi
  62. +AC_SUBST(EXPAT)
  63. # Check for use of the system libffi library
  64. AC_MSG_CHECKING(for --with-system-ffi)
  65. Index: b/setup.py
  66. ===================================================================
  67. --- a/setup.py
  68. +++ b/setup.py
  69. @@ -1463,7 +1463,7 @@
  70. #
  71. # More information on Expat can be found at www.libexpat.org.
  72. #
  73. - if '--with-system-expat' in sysconfig.get_config_var("CONFIG_ARGS"):
  74. + if '--with-expat=system' in sysconfig.get_config_var("CONFIG_ARGS"):
  75. expat_inc = []
  76. define_macros = []
  77. expat_lib = ['expat']