Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c537d8b

Browse filesBrowse files
gh-115119: Fall back to bundled libmpdec if system libmpdec is not found
1 parent 0abf997 commit c537d8b
Copy full SHA for c537d8b

File tree

3 files changed

+28
-12
lines changed
Filter options

3 files changed

+28
-12
lines changed
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fall back to the bundled libmpdec if a system version cannot be found.

‎configure

Copy file name to clipboardExpand all lines: configure
+14-6Lines changed: 14 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎configure.ac

Copy file name to clipboardExpand all lines: configure.ac
+13-6Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3980,16 +3980,21 @@ AC_ARG_WITH(
39803980
[with_system_libmpdec="yes"])
39813981
AC_MSG_RESULT([$with_system_libmpdec])
39823982

3983+
AC_DEFUN([USE_BUNDLED_LIBMPDEC],
3984+
[LIBMPDEC_CFLAGS="-I\$(srcdir)/Modules/_decimal/libmpdec"
3985+
LIBMPDEC_LIBS="-lm \$(LIBMPDEC_A)"
3986+
LIBMPDEC_INTERNAL="\$(LIBMPDEC_HEADERS) \$(LIBMPDEC_A)"
3987+
have_mpdec=yes
3988+
with_system_libmpdec=no])
3989+
39833990
AS_VAR_IF(
39843991
[with_system_libmpdec], [yes],
39853992
[PKG_CHECK_MODULES(
39863993
[LIBMPDEC], [libmpdec >= 2.5.0], [],
39873994
[LIBMPDEC_CFLAGS=${LIBMPDEC_CFLAGS-""}
39883995
LIBMPDEC_LIBS=${LIBMPDEC_LIBS-"-lmpdec -lm"}
39893996
LIBMPDEC_INTERNAL=])],
3990-
[LIBMPDEC_CFLAGS="-I\$(srcdir)/Modules/_decimal/libmpdec"
3991-
LIBMPDEC_LIBS="-lm \$(LIBMPDEC_A)"
3992-
LIBMPDEC_INTERNAL="\$(LIBMPDEC_HEADERS) \$(LIBMPDEC_A)"])
3997+
[USE_BUNDLED_LIBMPDEC()])
39933998

39943999
AS_VAR_IF([with_system_libmpdec], [yes],
39954000
[WITH_SAVE_ENV([
@@ -4006,13 +4011,15 @@ AS_VAR_IF([with_system_libmpdec], [yes],
40064011
[have_mpdec=yes],
40074012
[have_mpdec=no])
40084013
])],
4009-
[AS_VAR_SET([have_mpdec], [yes])
4010-
AC_MSG_WARN([m4_normalize([
4014+
[AC_MSG_WARN([m4_normalize([
40114015
the bundled copy of libmpdecimal is scheduled for removal in Python 3.15;
40124016
consider using a system installed mpdecimal library.])])])
40134017

40144018
AS_IF([test "$with_system_libmpdec" = "yes" && test "$have_mpdec" = "no"],
4015-
[AC_MSG_WARN([no system libmpdecimal found; unable to build _decimal])])
4019+
[AC_MSG_WARN([m4_normalize([
4020+
no system libmpdecimal found; falling back to bundled libmpdecimal
4021+
(deprecated and scheduled for removal in Python 3.15)])])
4022+
USE_BUNDLED_LIBMPDEC()])
40164023

40174024
# Disable forced inlining in debug builds, see GH-94847
40184025
AS_VAR_IF(

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.