0023-Add-an-option-to-disable-expat.patch 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. From 6281850ee8c3fb6d93b4997833af0cca4a48947b Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Wed, 23 Dec 2015 11:49:42 +0100
  4. Subject: [PATCH] Add an option to disable expat
  5. This patch replaces the existing --with-system-expat option with a
  6. --with-expat={system,builtin,none} option, which allows to tell Python
  7. whether we want to use the system expat (already installed), the expat
  8. builtin the Python sources, or no expat at all (which disables the
  9. installation of XML modules).
  10. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  11. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  12. ---
  13. Makefile.pre.in | 6 +++++-
  14. configure.ac | 18 +++++++++++++-----
  15. setup.py | 2 +-
  16. 3 files changed, 19 insertions(+), 7 deletions(-)
  17. diff --git a/Makefile.pre.in b/Makefile.pre.in
  18. index b97c21e..bdfee19 100644
  19. --- a/Makefile.pre.in
  20. +++ b/Makefile.pre.in
  21. @@ -1180,7 +1180,7 @@ LIBSUBDIRS= \
  22. logging csv wsgiref urllib \
  23. ctypes ctypes/macholib \
  24. idlelib idlelib/Icons \
  25. - distutils distutils/command $(XMLLIBSUBDIRS) \
  26. + distutils distutils/command \
  27. importlib \
  28. turtledemo \
  29. multiprocessing multiprocessing/dummy \
  30. @@ -1257,6 +1257,10 @@ ifeq (@CURSES@,yes)
  31. LIBSUBDIRS += curses
  32. endif
  33. +ifeq (@EXPAT@,yes)
  34. +LIBSUBDIRS += $(XMLLIBSUBDIRS)
  35. +endif
  36. +
  37. ifeq (@TEST_MODULES@,yes)
  38. LIBSUBDIRS += $(TESTSUBDIRS)
  39. endif
  40. diff --git a/configure.ac b/configure.ac
  41. index 0be47b2..e6bcacc 100644
  42. --- a/configure.ac
  43. +++ b/configure.ac
  44. @@ -2591,13 +2591,21 @@ PKG_PROG_PKG_CONFIG
  45. AC_SUBST(DISABLED_EXTENSIONS)
  46. # Check for use of the system expat library
  47. -AC_MSG_CHECKING(for --with-system-expat)
  48. -AC_ARG_WITH(system_expat,
  49. - AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library]),
  50. +AC_MSG_CHECKING(for --with-expat)
  51. +AC_ARG_WITH(expat,
  52. + AS_HELP_STRING([--with-expat], [select which expat version to use: system, builtin, none]),
  53. [],
  54. - [with_system_expat="no"])
  55. + [with_expat="builtin"])
  56. -AC_MSG_RESULT($with_system_expat)
  57. +AC_MSG_RESULT($with_expat)
  58. +
  59. +if test "$with_expat" != "none"; then
  60. + EXPAT=yes
  61. +else
  62. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} pyexpat"
  63. + EXPAT=no
  64. +fi
  65. +AC_SUBST(EXPAT)
  66. # Check for use of the system libffi library
  67. AC_MSG_CHECKING(for --with-system-ffi)
  68. diff --git a/setup.py b/setup.py
  69. index 722308b..ecddb6a 100644
  70. --- a/setup.py
  71. +++ b/setup.py
  72. @@ -1434,7 +1434,7 @@ class PyBuildExt(build_ext):
  73. #
  74. # More information on Expat can be found at www.libexpat.org.
  75. #
  76. - if '--with-system-expat' in sysconfig.get_config_var("CONFIG_ARGS"):
  77. + if '--with-expat=system' in sysconfig.get_config_var("CONFIG_ARGS"):
  78. expat_inc = []
  79. define_macros = []
  80. expat_lib = ['expat']
  81. --
  82. 2.6.4