2
1

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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. From d1701f1c89e9d2319ede200052319183fbb4ae18 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 | 24 +++++++++++++-----------
  19. 2 files changed, 17 insertions(+), 12 deletions(-)
  20. diff --git a/Makefile.pre.in b/Makefile.pre.in
  21. index 283ca1bd60..13f7512f42 100644
  22. --- a/Makefile.pre.in
  23. +++ b/Makefile.pre.in
  24. @@ -2113,7 +2113,6 @@ LIBSUBDIRS= asyncio \
  25. urllib \
  26. venv venv/scripts venv/scripts/common venv/scripts/posix \
  27. wsgiref \
  28. - $(XMLLIBSUBDIRS) \
  29. xmlrpc \
  30. zipfile zipfile/_path \
  31. zoneinfo \
  32. @@ -2280,6 +2279,10 @@ ifeq (@SQLITE3@,yes)
  33. LIBSUBDIRS += sqlite3
  34. endif
  35. +ifeq (@EXPAT@,yes)
  36. +LIBSUBDIRS += $(XMLLIBSUBDIRS)
  37. +endif
  38. +
  39. TEST_MODULES=@TEST_MODULES@
  40. .PHONY: libinstall
  41. diff --git a/configure.ac b/configure.ac
  42. index 92d663ed40..1cb95f41fd 100644
  43. --- a/configure.ac
  44. +++ b/configure.ac
  45. @@ -3823,17 +3823,19 @@ LIBS="$withval $LIBS"
  46. [AC_MSG_RESULT([no])])
  47. # Check for use of the system expat library
  48. -AC_MSG_CHECKING([for --with-system-expat])
  49. -AC_ARG_WITH(
  50. - [system_expat],
  51. - [AS_HELP_STRING(
  52. - [--with-system-expat],
  53. - [build pyexpat module using an installed expat library, see Doc/library/pyexpat.rst (default is no)]
  54. - )], [], [with_system_expat="no"])
  55. -
  56. -AC_MSG_RESULT([$with_system_expat])
  57. -
  58. -AS_VAR_IF([with_system_expat], [yes], [
  59. +AC_MSG_CHECKING(for --with-expat)
  60. +AC_ARG_WITH(expat,
  61. + AS_HELP_STRING([--with-expat], [select which expat version to use: system, builtin, none]),
  62. + [],
  63. + [with_expat="builtin"])
  64. +AC_MSG_RESULT($with_expat)
  65. +AS_IF([test "$with_expat" != "none"],
  66. + [EXPAT=yes],
  67. + [PY_STDLIB_MOD_SET_NA([pyexpat])
  68. + EXPAT=no])
  69. +AC_SUBST(EXPAT)
  70. +
  71. +AS_VAR_IF([with_expat], [system], [
  72. LIBEXPAT_CFLAGS=${LIBEXPAT_CFLAGS-""}
  73. LIBEXPAT_LDFLAGS=${LIBEXPAT_LDFLAGS-"-lexpat"}
  74. LIBEXPAT_INTERNAL=
  75. --
  76. 2.34.1