0013-Add-an-option-to-disable-expat.patch 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. From 3ed9d35554631a1e0c438636b60b6b9b699cba4b Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Wed, 22 Feb 2017 17:40:45 -0800
  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. [ Andrey Smirnov: ported to Python 3.6 ]
  13. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
  14. [ Adam Duskett: ported to Python 3.10.0 ]
  15. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  16. ---
  17. Makefile.pre.in | 5 ++++-
  18. configure.ac | 20 ++++++++++++++------
  19. 2 files changed, 18 insertions(+), 7 deletions(-)
  20. diff --git a/Makefile.pre.in b/Makefile.pre.in
  21. index 09408c3471f..8e5f6762d20 100644
  22. --- a/Makefile.pre.in
  23. +++ b/Makefile.pre.in
  24. @@ -1938,7 +1938,6 @@ LIBSUBDIRS= asyncio \
  25. urllib \
  26. venv venv/scripts venv/scripts/common venv/scripts/posix \
  27. wsgiref \
  28. - $(XMLLIBSUBDIRS) \
  29. xmlrpc \
  30. zoneinfo \
  31. __phello__
  32. @@ -2087,6 +2086,10 @@ ifeq (@CURSES@,yes)
  33. LIBSUBDIRS += curses
  34. endif
  35. +ifeq (@EXPAT@,yes)
  36. +LIBSUBDIRS += $(XMLLIBSUBDIRS)
  37. +endif
  38. +
  39. TEST_MODULES=@TEST_MODULES@
  40. libinstall: all $(srcdir)/Modules/xxmodule.c
  41. @for i in $(SCRIPTDIR) $(LIBDEST); \
  42. diff --git a/configure.ac b/configure.ac
  43. index 5d52c813ba6..6e577f19b8c 100644
  44. --- a/configure.ac
  45. +++ b/configure.ac
  46. @@ -3615,15 +3615,23 @@ LIBS="$withval $LIBS"
  47. AC_SUBST(DISABLED_EXTENSIONS)
  48. # Check for use of the system expat library
  49. -AC_MSG_CHECKING(for --with-system-expat)
  50. -AC_ARG_WITH(system_expat,
  51. - AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library, see Doc/library/pyexpat.rst (default is no)]),
  52. +AC_MSG_CHECKING(for --with-expat)
  53. +AC_ARG_WITH(expat,
  54. + AS_HELP_STRING([--with-expat], [select which expat version to use: system, builtin, none]),
  55. [],
  56. - [with_system_expat="no"])
  57. + [with_expat="builtin"])
  58. -AC_MSG_RESULT($with_system_expat)
  59. +AC_MSG_RESULT($with_expat)
  60. -AS_VAR_IF([with_system_expat], [yes], [
  61. +if test "$with_expat" != "none"; then
  62. + EXPAT=yes
  63. +else
  64. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} pyexpat"
  65. + EXPAT=no
  66. +fi
  67. +AC_SUBST(EXPAT)
  68. +
  69. +AS_VAR_IF([with_expat], [system], [
  70. LIBEXPAT_CFLAGS=${LIBEXPAT_CFLAGS-""}
  71. LIBEXPAT_LDFLAGS=${LIBEXPAT_LDFLAGS-"-lexpat"}
  72. LIBEXPAT_INTERNAL=
  73. --
  74. 2.44.0