]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/python3/0019-Add-an-option-to-disable-expat.patch
Revert "python3: bump to 2.6.4"
[coffee/buildroot.git] / package / python3 / 0019-Add-an-option-to-disable-expat.patch
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
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).
11
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>
16 ---
17  Makefile.pre.in |  6 +++++-
18  configure.ac    | 18 +++++++++++++-----
19  setup.py        |  2 +-
20  3 files changed, 19 insertions(+), 7 deletions(-)
21
22 diff --git a/Makefile.pre.in b/Makefile.pre.in
23 index 6a6bc082cd..dc4b92b6fe 100644
24 --- a/Makefile.pre.in
25 +++ b/Makefile.pre.in
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 \
32                 importlib \
33                 turtledemo \
34                 multiprocessing multiprocessing/dummy \
35 @@ -1271,6 +1271,10 @@ ifeq (@CURSES@,yes)
36  LIBSUBDIRS += curses
37  endif
38  
39 +ifeq (@EXPAT@,yes)
40 +LIBSUBDIRS += $(XMLLIBSUBDIRS)
41 +endif
42 +
43  ifeq (@LIB2TO3@,yes)
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
48 --- a/configure.ac
49 +++ b/configure.ac
50 @@ -2813,13 +2813,21 @@ PKG_PROG_PKG_CONFIG
51  AC_SUBST(DISABLED_EXTENSIONS)
52  
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)
58 +AC_ARG_WITH(expat,
59 +            AS_HELP_STRING([--with-expat], [select which expat version to use: system, builtin, none]),
60              [],
61 -            [with_system_expat="no"])
62 +            [with_expat="builtin"])
63  
64 -AC_MSG_RESULT($with_system_expat)
65 +AC_MSG_RESULT($with_expat)
66 +
67 +if test "$with_expat" != "none"; then
68 +   EXPAT=yes
69 +else
70 +   DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} pyexpat"
71 +   EXPAT=no
72 +fi
73 +AC_SUBST(EXPAT)
74  
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
79 --- a/setup.py
80 +++ b/setup.py
81 @@ -1495,7 +1495,7 @@ class PyBuildExt(build_ext):
82          #
83          # More information on Expat can be found at www.libexpat.org.
84          #
85 -        if '--with-system-expat' in sysconfig.get_config_var("CONFIG_ARGS"):
86 +        if '--with-expat=system' in sysconfig.get_config_var("CONFIG_ARGS"):
87              expat_inc = []
88              define_macros = []
89              expat_lib = ['expat']
90 -- 
91 2.13.5
92