0018-Add-an-option-to-disable-decimal.patch 2.0 KB

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