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>
15 Makefile.pre.in | 6 +++++-
16 configure.ac | 18 +++++++++++++-----
18 3 files changed, 19 insertions(+), 7 deletions(-)
20 diff --git a/Makefile.pre.in b/Makefile.pre.in
21 index b97c21e..bdfee19 100644
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 \
32 multiprocessing multiprocessing/dummy \
33 @@ -1257,6 +1257,10 @@ ifeq (@CURSES@,yes)
38 +LIBSUBDIRS += $(XMLLIBSUBDIRS)
41 ifeq (@TEST_MODULES@,yes)
42 LIBSUBDIRS += $(TESTSUBDIRS)
44 diff --git a/configure.ac b/configure.ac
45 index 0be47b2..e6bcacc 100644
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)
57 + AS_HELP_STRING([--with-expat], [select which expat version to use: system, builtin, none]),
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
68 + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} pyexpat"
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
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"):