1 From ff77defc777a57d4caee5183796fd44dd265e78b Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Wed, 23 Dec 2015 11:51:31 +0100
4 Subject: [PATCH] Add an option to disable decimal
6 This patch replaces the existing --with-system-libmpdec option with a
7 --with-libmpdec={system,builtin,none} option, which allows to tell
8 Python whether we want to use the system libmpdec (already installed),
9 the libmpdec builtin the Python sources, or no libmpdec at all.
11 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
13 configure.ac | 17 ++++++++++++-----
15 2 files changed, 13 insertions(+), 6 deletions(-)
17 diff --git a/configure.ac b/configure.ac
18 index 6b59792..51e1760 100644
21 @@ -2624,13 +2624,20 @@ AC_SUBST(LIBFFI_INCLUDEDIR)
22 AC_MSG_RESULT($with_system_ffi)
24 # Check for use of the system libmpdec library
25 -AC_MSG_CHECKING(for --with-system-libmpdec)
26 -AC_ARG_WITH(system_libmpdec,
27 - AS_HELP_STRING([--with-system-libmpdec], [build _decimal module using an installed libmpdec library]),
28 +AC_MSG_CHECKING(for --with-libmpdec)
29 +AC_ARG_WITH(libmpdec,
30 + AS_HELP_STRING([--with-libmpdec], [select which libmpdec version to use: system, builtin, none]),
32 - [with_system_libmpdec="no"])
33 + [with_libmpdec="builtin"])
35 -AC_MSG_RESULT($with_system_libmpdec)
36 +AC_MSG_RESULT($with_libmpdec)
37 +if test "$with_libmpdec" != "none"; then
40 + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _decimal"
45 # Check for support for loadable sqlite extensions
46 AC_MSG_CHECKING(for --enable-loadable-sqlite-extensions)
47 diff --git a/setup.py b/setup.py
48 index 7fe68e8..364b350 100644
51 @@ -1988,7 +1988,7 @@ class PyBuildExt(build_ext):
52 def _decimal_ext(self):
53 extra_compile_args = []
55 - if '--with-system-libmpdec' in sysconfig.get_config_var("CONFIG_ARGS"):
56 + if '--with-libmpdec=system' in sysconfig.get_config_var("CONFIG_ARGS"):
58 libraries = [':libmpdec.so.2']
59 sources = ['_decimal/_decimal.c']