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
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 [ Andrey Smirnov: ported to Python 3.6 ]
15 Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
17 Makefile.pre.in | 6 +++++-
18 configure.ac | 18 +++++++++++++-----
20 3 files changed, 19 insertions(+), 7 deletions(-)
22 diff --git a/Makefile.pre.in b/Makefile.pre.in
23 index 6a6bc082cd..dc4b92b6fe 100644
26 @@ -1208,7 +1208,7 @@ LIBSUBDIRS= site-packages \
27 logging csv wsgiref urllib \
28 ctypes ctypes/macholib \
29 idlelib idlelib/Icons \
30 - distutils distutils/command $(XMLLIBSUBDIRS) \
31 + distutils distutils/command \
34 multiprocessing multiprocessing/dummy \
35 @@ -1271,6 +1271,10 @@ ifeq (@CURSES@,yes)
40 +LIBSUBDIRS += $(XMLLIBSUBDIRS)
44 LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2
45 TESTSUBDIRS += lib2to3/tests \
46 diff --git a/configure.ac b/configure.ac
47 index 5896b39ff9..6f21482207 100644
50 @@ -2813,13 +2813,21 @@ PKG_PROG_PKG_CONFIG
51 AC_SUBST(DISABLED_EXTENSIONS)
53 # Check for use of the system expat library
54 -AC_MSG_CHECKING(for --with-system-expat)
55 -AC_ARG_WITH(system_expat,
56 - AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library]),
57 +AC_MSG_CHECKING(for --with-expat)
59 + AS_HELP_STRING([--with-expat], [select which expat version to use: system, builtin, none]),
61 - [with_system_expat="no"])
62 + [with_expat="builtin"])
64 -AC_MSG_RESULT($with_system_expat)
65 +AC_MSG_RESULT($with_expat)
67 +if test "$with_expat" != "none"; then
70 + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} pyexpat"
75 # Check for use of the system libffi library
76 AC_MSG_CHECKING(for --with-system-ffi)
77 diff --git a/setup.py b/setup.py
78 index 76429e1326..38aa5e605e 100644
81 @@ -1495,7 +1495,7 @@ class PyBuildExt(build_ext):
83 # More information on Expat can be found at www.libexpat.org.
85 - if '--with-system-expat' in sysconfig.get_config_var("CONFIG_ARGS"):
86 + if '--with-expat=system' in sysconfig.get_config_var("CONFIG_ARGS"):