0008-Add-an-option-to-disable-expat.patch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. From fb7d73d6e3c4cdc9cb272120845103b1aa965240 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. Upstream: N/A
  11. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  12. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  13. [ Andrey Smirnov: ported to Python 3.6 ]
  14. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
  15. [ Adam Duskett: ported to Python 3.10.0 ]
  16. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  17. [ Vincent Fazio: ported to Python 3.13.2 ]
  18. Signed-off-by: Vincent Fazio <vfazio@gmail.com>
  19. ---
  20. Makefile.pre.in | 5 ++++-
  21. configure.ac | 24 +++++++++++++-----------
  22. 2 files changed, 17 insertions(+), 12 deletions(-)
  23. diff --git a/Makefile.pre.in b/Makefile.pre.in
  24. index a4531d1f0fc..f6719bd19b3 100644
  25. --- a/Makefile.pre.in
  26. +++ b/Makefile.pre.in
  27. @@ -2336,7 +2336,6 @@ LIBSUBDIRS= asyncio \
  28. urllib \
  29. venv venv/scripts venv/scripts/common venv/scripts/posix \
  30. wsgiref \
  31. - $(XMLLIBSUBDIRS) \
  32. xmlrpc \
  33. zipfile zipfile/_path \
  34. zoneinfo \
  35. @@ -2501,6 +2500,10 @@ ifeq (@SQLITE3@,yes)
  36. LIBSUBDIRS += sqlite3
  37. endif
  38. +ifeq (@EXPAT@,yes)
  39. +LIBSUBDIRS += $(XMLLIBSUBDIRS)
  40. +endif
  41. +
  42. TEST_MODULES=@TEST_MODULES@
  43. .PHONY: libinstall
  44. diff --git a/configure.ac b/configure.ac
  45. index 30ad6f1e68d..370eb94730f 100644
  46. --- a/configure.ac
  47. +++ b/configure.ac
  48. @@ -3970,17 +3970,19 @@ LIBS="$withval $LIBS"
  49. [AC_MSG_RESULT([no])])
  50. # Check for use of the system expat library
  51. -AC_MSG_CHECKING([for --with-system-expat])
  52. -AC_ARG_WITH(
  53. - [system_expat],
  54. - [AS_HELP_STRING(
  55. - [--with-system-expat],
  56. - [build pyexpat module using an installed expat library, see Doc/library/pyexpat.rst (default is no)]
  57. - )], [], [with_system_expat="no"])
  58. -
  59. -AC_MSG_RESULT([$with_system_expat])
  60. -
  61. -AS_VAR_IF([with_system_expat], [yes], [
  62. +AC_MSG_CHECKING(for --with-expat)
  63. +AC_ARG_WITH(expat,
  64. + AS_HELP_STRING([--with-expat], [select which expat version to use: system, builtin, none]),
  65. + [],
  66. + [with_expat="builtin"])
  67. +AC_MSG_RESULT($with_expat)
  68. +AS_IF([test "$with_expat" != "none"],
  69. + [EXPAT=yes],
  70. + [PY_STDLIB_MOD_SET_NA([pyexpat])
  71. + EXPAT=no])
  72. +AC_SUBST(EXPAT)
  73. +
  74. +AS_VAR_IF([with_expat], [system], [
  75. LIBEXPAT_CFLAGS=${LIBEXPAT_CFLAGS-""}
  76. LIBEXPAT_LDFLAGS=${LIBEXPAT_LDFLAGS-"-lexpat"}
  77. LIBEXPAT_INTERNAL=
  78. --
  79. 2.34.1