0019-Add-an-option-to-disable-expat.patch 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. From 63fc5bc90cb57460552b544cbed0c2939759ab9e 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. ---
  15. Makefile.pre.in | 6 +++++-
  16. configure.ac | 18 +++++++++++++-----
  17. setup.py | 2 +-
  18. 3 files changed, 19 insertions(+), 7 deletions(-)
  19. diff --git a/Makefile.pre.in b/Makefile.pre.in
  20. index 6a6bc082cd..dc4b92b6fe 100644
  21. --- a/Makefile.pre.in
  22. +++ b/Makefile.pre.in
  23. @@ -1273,7 +1273,7 @@ LIBSUBDIRS= site-packages \
  24. logging csv wsgiref urllib \
  25. ctypes ctypes/macholib \
  26. idlelib idlelib/Icons \
  27. - distutils distutils/command $(XMLLIBSUBDIRS) \
  28. + distutils distutils/command \
  29. importlib \
  30. turtledemo \
  31. multiprocessing multiprocessing/dummy \
  32. @@ -1354,6 +1354,10 @@ ifeq (@CURSES@,yes)
  33. LIBSUBDIRS += curses
  34. endif
  35. +ifeq (@EXPAT@,yes)
  36. +LIBSUBDIRS += $(XMLLIBSUBDIRS)
  37. +endif
  38. +
  39. ifeq (@LIB2TO3@,yes)
  40. LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2
  41. TESTSUBDIRS += lib2to3/tests \
  42. diff --git a/configure.ac b/configure.ac
  43. index 5896b39ff9..6f21482207 100644
  44. --- a/configure.ac
  45. +++ b/configure.ac
  46. @@ -2969,13 +2969,21 @@ PKG_PROG_PKG_CONFIG
  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]),
  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. +
  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. # Check for use of the system libffi library
  69. AC_MSG_CHECKING(for --with-system-ffi)
  70. diff --git a/setup.py b/setup.py
  71. index 76429e1326..38aa5e605e 100644
  72. --- a/setup.py
  73. +++ b/setup.py
  74. @@ -1490,7 +1490,7 @@ class PyBuildExt(build_ext):
  75. #
  76. # More information on Expat can be found at www.libexpat.org.
  77. #
  78. - if '--with-system-expat' in sysconfig.get_config_var("CONFIG_ARGS"):
  79. + if '--with-expat=system' in sysconfig.get_config_var("CONFIG_ARGS"):
  80. expat_inc = []
  81. define_macros = []
  82. extra_compile_args = []
  83. --
  84. 2.13.5