1From 12b5db4e25182962eb0b8bc21479a743c35a158c Mon Sep 17 00:00:00 2001 2From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 3Date: Wed, 23 Dec 2015 11:51:31 +0100 4Subject: [PATCH] Add an option to disable decimal 5 6This patch replaces the existing --with-system-libmpdec option with a 7--with-libmpdec={system,builtin,none} option, which allows to tell 8Python whether we want to use the system libmpdec (already installed), 9the libmpdec builtin the Python sources, or no libmpdec at all. 10 11Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 12[aduskett@gmail.com: Update for python 3.7.0] 13Signed-off-by: Adam Duskett <aduskett@gmail.com> 14[james.hilliard1@gmail.com: adapt to python 3.9] 15Signed-off-by: James Hilliard <james.hilliard1@gmail.com> 16--- 17 configure.ac | 19 +++++++++++++------ 18 1 file changed, 13 insertions(+), 6 deletions(-) 19 20diff --git a/configure.ac b/configure.ac 21index fe497ec9dfb..20b3c2459f4 100644 22--- a/configure.ac 23+++ b/configure.ac 24@@ -3680,14 +3680,21 @@ fi 25 AC_SUBST(LIBFFI_INCLUDEDIR) 26 27 # Check for use of the system libmpdec library 28-AC_MSG_CHECKING(for --with-system-libmpdec) 29-AC_ARG_WITH(system_libmpdec, 30- AS_HELP_STRING([--with-system-libmpdec], [build _decimal module using an installed libmpdec library, see Doc/library/decimal.rst (default is no)]), 31+AC_MSG_CHECKING(for --with-libmpdec) 32+AC_ARG_WITH(libmpdec, 33+ AS_HELP_STRING([--with-libmpdec], [select which libmpdec version to use: system, builtin, none]), 34 [], 35- [with_system_libmpdec="no"]) 36-AC_MSG_RESULT($with_system_libmpdec) 37+ [with_libmpdec="builtin"]) 38+AC_MSG_RESULT($with_libmpdec) 39+if test "$with_libmpdec" != "none"; then 40+ MPDEC=yes 41+else 42+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _decimal" 43+ MPDEC=no 44+fi 45+AC_SUBST(MPDEC) 46 47-AS_VAR_IF([with_system_libmpdec], [yes], [ 48+AS_VAR_IF([with_libmpdec], [system], [ 49 LIBMPDEC_CFLAGS=${LIBMPDEC_CFLAGS-""} 50 LIBMPDEC_LDFLAGS=${LIBMPDEC_LDFLAGS-"-lmpdec"} 51 LIBMPDEC_INTERNAL= 52-- 532.44.0 54 55