be17c94171c7fe4fba5615839e012d386e77768d
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / python3 / 111-optional-decimal.patch
1 Add an option to disable decimal
2
3 This patch replaces the existing --with-system-libmpdec option with a
4 --with-libmpdec={system,builtin,none} option, which allows to tell
5 Python whether we want to use the system libmpdec (already installed),
6 the libmpdec builtin the Python sources, or no libmpdec at all.
7
8 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
9 ---
10
11 Index: b/configure.ac
12 ===================================================================
13 --- a/configure.ac
14 +++ b/configure.ac
15 @@ -2405,13 +2405,20 @@
16  AC_MSG_RESULT($with_system_ffi)
17  
18  # Check for use of the system libmpdec library
19 -AC_MSG_CHECKING(for --with-system-libmpdec)
20 -AC_ARG_WITH(system_libmpdec,
21 -            AS_HELP_STRING([--with-system-libmpdec], [build _decimal module using an installed libmpdec library]),
22 +AC_MSG_CHECKING(for --with-libmpdec)
23 +AC_ARG_WITH(libmpdec,
24 +            AS_HELP_STRING([--with-libmpdec], [select which libmpdec version to use: system, builtin, none]),
25              [],
26 -            [with_system_libmpdec="no"])
27 +            [with_libmpdec="builtin"])
28  
29 -AC_MSG_RESULT($with_system_libmpdec)
30 +AC_MSG_RESULT($with_libmpdec)
31 +if test "$with_libmpdec" != "none"; then
32 +   MPDEC=yes
33 +else
34 +   DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _decimal"
35 +   MPDEC=no
36 +fi
37 +AC_SUBST(MPDEC)
38  
39  # Check for support for loadable sqlite extensions
40  AC_MSG_CHECKING(for --enable-loadable-sqlite-extensions)
41 Index: b/setup.py
42 ===================================================================
43 --- a/setup.py
44 +++ b/setup.py
45 @@ -1968,7 +1968,7 @@
46      def _decimal_ext(self):
47          extra_compile_args = []
48          undef_macros = []
49 -        if '--with-system-libmpdec' in sysconfig.get_config_var("CONFIG_ARGS"):
50 +        if '--with-libmpdec=system' in sysconfig.get_config_var("CONFIG_ARGS"):
51              include_dirs = []
52              libraries = [':libmpdec.so.2']
53              sources = ['_decimal/_decimal.c']