python-2.7-106-optional-expat.patch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. ---
  9. Makefile.pre.in | 6 +++++-
  10. configure.in | 18 +++++++++++++-----
  11. setup.py | 2 +-
  12. 3 files changed, 19 insertions(+), 7 deletions(-)
  13. Index: Python-2.7.2/Makefile.pre.in
  14. ===================================================================
  15. --- Python-2.7.2.orig/Makefile.pre.in
  16. +++ Python-2.7.2/Makefile.pre.in
  17. @@ -863,7 +863,7 @@
  18. sqlite3 \
  19. logging bsddb csv importlib wsgiref \
  20. ctypes ctypes/macholib idlelib idlelib/Icons \
  21. - distutils distutils/command $(XMLLIBSUBDIRS) \
  22. + distutils distutils/command \
  23. multiprocessing multiprocessing/dummy \
  24. unittest \
  25. lib-old \
  26. @@ -910,6 +910,10 @@
  27. LIBSUBDIRS += curses
  28. endif
  29. +ifeq (@EXPAT@,yes)
  30. +LIBSUBDIRS += $(XMLLIBSUBDIRS)
  31. +endif
  32. +
  33. libinstall: build_all $(srcdir)/Lib/$(PLATDIR)
  34. @for i in $(SCRIPTDIR) $(LIBDEST); \
  35. do \
  36. Index: Python-2.7.2/configure.in
  37. ===================================================================
  38. --- Python-2.7.2.orig/configure.in
  39. +++ Python-2.7.2/configure.in
  40. @@ -2102,13 +2102,21 @@
  41. AC_SUBST(DISABLED_EXTENSIONS)
  42. # Check for use of the system expat library
  43. -AC_MSG_CHECKING(for --with-system-expat)
  44. -AC_ARG_WITH(system_expat,
  45. - AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library]),
  46. +AC_MSG_CHECKING(for --with-expat)
  47. +AC_ARG_WITH(expat,
  48. + AS_HELP_STRING([--with-expat], [select which expat version to use: system, builtin, none]),
  49. [],
  50. - [with_system_expat="no"])
  51. + [with_expat="builtin"])
  52. -AC_MSG_RESULT($with_system_expat)
  53. +AC_MSG_RESULT($with_expat)
  54. +
  55. +if test "$with_expat" != "none"; then
  56. + EXPAT=yes
  57. +else
  58. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} pyexpat"
  59. + EXPAT=no
  60. +fi
  61. +AC_SUBST(EXPAT)
  62. # Check for use of the system libffi library
  63. AC_MSG_CHECKING(for --with-system-ffi)
  64. Index: Python-2.7.2/setup.py
  65. ===================================================================
  66. --- Python-2.7.2.orig/setup.py
  67. +++ Python-2.7.2/setup.py
  68. @@ -1403,7 +1403,7 @@
  69. #
  70. # More information on Expat can be found at www.libexpat.org.
  71. #
  72. - if '--with-system-expat' in sysconfig.get_config_var("CONFIG_ARGS"):
  73. + if '--with-expat=system' in sysconfig.get_config_var("CONFIG_ARGS"):
  74. expat_inc = []
  75. define_macros = []
  76. expat_lib = ['expat']