libnetfilter_cthelper: add patch for uclinux tuple
[buildroot-gz.git] / package / python3 / python3-106-optional-expat.patch
blobd171b79ef7d74f6b134a9eef7e7a25742c4a2035
1 Add an option to disable expat
3 This patch replaces the existing --with-system-expat option with a
4 --with-expat={system,builtin,none} option, which allows to tell Python
5 whether we want to use the system expat (already installed), the expat
6 builtin the Python sources, or no expat at all (which disables the
7 installation of XML modules).
9 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
10 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
12 ---
13 Makefile.pre.in | 6 +++++-
14 configure.ac | 18 +++++++++++++-----
15 setup.py | 2 +-
16 3 files changed, 19 insertions(+), 7 deletions(-)
18 Index: cpython/Makefile.pre.in
19 ===================================================================
20 --- cpython.orig/Makefile.pre.in
21 +++ cpython/Makefile.pre.in
22 @@ -987,7 +987,7 @@
23 html json http dbm xmlrpc \
24 logging csv wsgiref urllib \
25 ctypes ctypes/macholib idlelib idlelib/Icons \
26 - distutils distutils/command $(XMLLIBSUBDIRS) \
27 + distutils distutils/command \
28 importlib \
29 turtledemo \
30 multiprocessing multiprocessing/dummy \
31 @@ -1065,6 +1065,10 @@
32 LIBSUBDIRS += curses
33 endif
35 +ifeq (@EXPAT@,yes)
36 +LIBSUBDIRS += $(XMLLIBSUBDIRS)
37 +endif
39 libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
40 @for i in $(SCRIPTDIR) $(LIBDEST); \
41 do \
42 Index: cpython/configure.ac
43 ===================================================================
44 --- cpython.orig/configure.ac
45 +++ cpython/configure.ac
46 @@ -2178,13 +2178,21 @@
47 AC_SUBST(DISABLED_EXTENSIONS)
49 # Check for use of the system expat library
50 -AC_MSG_CHECKING(for --with-system-expat)
51 -AC_ARG_WITH(system_expat,
52 - AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library]),
53 +AC_MSG_CHECKING(for --with-expat)
54 +AC_ARG_WITH(expat,
55 + AS_HELP_STRING([--with-expat], [select which expat version to use: system, builtin, none]),
56 [],
57 - [with_system_expat="no"])
58 + [with_expat="builtin"])
60 -AC_MSG_RESULT($with_system_expat)
61 +AC_MSG_RESULT($with_expat)
63 +if test "$with_expat" != "none"; then
64 + EXPAT=yes
65 +else
66 + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} pyexpat"
67 + EXPAT=no
68 +fi
69 +AC_SUBST(EXPAT)
71 # Check for use of the system libffi library
72 AC_MSG_CHECKING(for --with-system-ffi)
73 Index: cpython/setup.py
74 ===================================================================
75 --- cpython.orig/setup.py
76 +++ cpython/setup.py
77 @@ -1404,7 +1404,7 @@
79 # More information on Expat can be found at www.libexpat.org.
81 - if '--with-system-expat' in sysconfig.get_config_var("CONFIG_ARGS"):
82 + if '--with-expat=system' in sysconfig.get_config_var("CONFIG_ARGS"):
83 expat_inc = []
84 define_macros = []
85 expat_lib = ['expat']