python-pyasn: bump to version 1.6.0b1
[buildroot-gz.git] / package / python3 / 0023-Add-an-option-to-disable-expat.patch
blob73f9b36bd0e96ed5bbaf6bf2b64f9bfbe4178509
1 From 6281850ee8c3fb6d93b4997833af0cca4a48947b Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Wed, 23 Dec 2015 11:49:42 +0100
4 Subject: [PATCH] Add an option to disable expat
6 This patch replaces the existing --with-system-expat option with a
7 --with-expat={system,builtin,none} option, which allows to tell Python
8 whether we want to use the system expat (already installed), the expat
9 builtin the Python sources, or no expat at all (which disables the
10 installation of XML modules).
12 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
13 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
14 ---
15 Makefile.pre.in | 6 +++++-
16 configure.ac | 18 +++++++++++++-----
17 setup.py | 2 +-
18 3 files changed, 19 insertions(+), 7 deletions(-)
20 diff --git a/Makefile.pre.in b/Makefile.pre.in
21 index b97c21e..bdfee19 100644
22 --- a/Makefile.pre.in
23 +++ b/Makefile.pre.in
24 @@ -1180,7 +1180,7 @@ LIBSUBDIRS= \
25 logging csv wsgiref urllib \
26 ctypes ctypes/macholib \
27 idlelib idlelib/Icons \
28 - distutils distutils/command $(XMLLIBSUBDIRS) \
29 + distutils distutils/command \
30 importlib \
31 turtledemo \
32 multiprocessing multiprocessing/dummy \
33 @@ -1257,6 +1257,10 @@ ifeq (@CURSES@,yes)
34 LIBSUBDIRS += curses
35 endif
37 +ifeq (@EXPAT@,yes)
38 +LIBSUBDIRS += $(XMLLIBSUBDIRS)
39 +endif
41 ifeq (@TEST_MODULES@,yes)
42 LIBSUBDIRS += $(TESTSUBDIRS)
43 endif
44 diff --git a/configure.ac b/configure.ac
45 index 0be47b2..e6bcacc 100644
46 --- a/configure.ac
47 +++ b/configure.ac
48 @@ -2591,13 +2591,21 @@ PKG_PROG_PKG_CONFIG
49 AC_SUBST(DISABLED_EXTENSIONS)
51 # Check for use of the system expat library
52 -AC_MSG_CHECKING(for --with-system-expat)
53 -AC_ARG_WITH(system_expat,
54 - AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library]),
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_system_expat="no"])
60 + [with_expat="builtin"])
62 -AC_MSG_RESULT($with_system_expat)
63 +AC_MSG_RESULT($with_expat)
65 +if test "$with_expat" != "none"; then
66 + EXPAT=yes
67 +else
68 + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} pyexpat"
69 + EXPAT=no
70 +fi
71 +AC_SUBST(EXPAT)
73 # Check for use of the system libffi library
74 AC_MSG_CHECKING(for --with-system-ffi)
75 diff --git a/setup.py b/setup.py
76 index 722308b..ecddb6a 100644
77 --- a/setup.py
78 +++ b/setup.py
79 @@ -1434,7 +1434,7 @@ class PyBuildExt(build_ext):
81 # More information on Expat can be found at www.libexpat.org.
83 - if '--with-system-expat' in sysconfig.get_config_var("CONFIG_ARGS"):
84 + if '--with-expat=system' in sysconfig.get_config_var("CONFIG_ARGS"):
85 expat_inc = []
86 define_macros = []
87 expat_lib = ['expat']
88 --
89 2.6.4