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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. From 455e500067431c19770d637ee0769b450208550f 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 | 22 ++++++++++++----------
  19. 2 files changed, 16 insertions(+), 11 deletions(-)
  20. diff --git a/Makefile.pre.in b/Makefile.pre.in
  21. index 2b0307b1282..fcddbf33e9e 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. @@ -2286,6 +2285,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 94bebbfd48e..a2436c0733b 100644
  43. --- a/configure.ac
  44. +++ b/configure.ac
  45. @@ -3826,17 +3826,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. +AC_MSG_CHECKING(for --with-expat)
  56. +AC_ARG_WITH(expat,
  57. + AS_HELP_STRING([--with-expat], [select which expat version to use: system, builtin, none]),
  58. + [],
  59. + [with_expat="builtin"])
  60. +AC_MSG_RESULT($with_expat)
  61. +AS_IF([test "$with_expat" != "none"],
  62. + [EXPAT=yes],
  63. + [PY_STDLIB_MOD_SET_NA([pyexpat])
  64. + EXPAT=no])
  65. +AC_SUBST(EXPAT)
  66. -AC_MSG_RESULT([$with_system_expat])
  67. -
  68. -AS_VAR_IF([with_system_expat], [yes], [
  69. +AS_VAR_IF([with_expat], [system], [
  70. LIBEXPAT_CFLAGS=${LIBEXPAT_CFLAGS-""}
  71. LIBEXPAT_LDFLAGS=${LIBEXPAT_LDFLAGS-"-lexpat"}
  72. LIBEXPAT_INTERNAL=
  73. --
  74. 2.39.5