@@ -4169,31 +4169,30 @@ fi
41694169
41704170# Check for use of the system libmpdec library
41714171AC_MSG_CHECKING ( [ for --with-system-libmpdec] )
4172+ AC_DEFUN ( [ USE_BUNDLED_LIBMPDEC] ,
4173+ [ LIBMPDEC_CFLAGS="-I\$(srcdir)/Modules/_decimal/libmpdec"
4174+ LIBMPDEC_LIBS="-lm \$(LIBMPDEC_A)"
4175+ LIBMPDEC_INTERNAL="\$(LIBMPDEC_HEADERS) \$(LIBMPDEC_A)"
4176+ have_mpdec=yes
4177+ with_system_libmpdec=no] )
41724178AC_ARG_WITH (
41734179 [ system_libmpdec] ,
41744180 [ AS_HELP_STRING (
41754181 [ --with-system-libmpdec] ,
41764182 [ build _decimal module using an installed mpdecimal library, see Doc/library/decimal.rst (default is yes)]
41774183 ) ] ,
4178- [ ] ,
4184+ [ AS_IF ( [ test "x$with_system_libmpdec" = xno] ,
4185+ [ USE_BUNDLED_LIBMPDEC()] ) ] ,
41794186 [ with_system_libmpdec="yes"] )
41804187AC_MSG_RESULT ( [ $with_system_libmpdec] )
41814188
4182- AC_DEFUN ( [ USE_BUNDLED_LIBMPDEC] ,
4183- [ LIBMPDEC_CFLAGS="-I\$(srcdir)/Modules/_decimal/libmpdec"
4184- LIBMPDEC_LIBS="-lm \$(LIBMPDEC_A)"
4185- LIBMPDEC_INTERNAL="\$(LIBMPDEC_HEADERS) \$(LIBMPDEC_A)"
4186- have_mpdec=yes
4187- with_system_libmpdec=no] )
4188-
41894189AS_VAR_IF (
41904190 [ with_system_libmpdec] , [ yes] ,
41914191 [ PKG_CHECK_MODULES(
41924192 [ LIBMPDEC] , [ libmpdec >= 2.5.0] , [ ] ,
41934193 [ LIBMPDEC_CFLAGS=${LIBMPDEC_CFLAGS-""}
41944194 LIBMPDEC_LIBS=${LIBMPDEC_LIBS-"-lmpdec -lm"}
4195- LIBMPDEC_INTERNAL=] )] ,
4196- [ USE_BUNDLED_LIBMPDEC()] )
4195+ LIBMPDEC_INTERNAL=] )] )
41974196
41984197AS_VAR_IF ( [ with_system_libmpdec] , [ yes] ,
41994198 [ WITH_SAVE_ENV([
@@ -4209,16 +4208,7 @@ AS_VAR_IF([with_system_libmpdec], [yes],
42094208 ] , [ const char *x = mpd_version();] ) ] ,
42104209 [ have_mpdec=yes] ,
42114210 [ have_mpdec=no] )
4212- ] )] ,
4213- [ AC_MSG_WARN ( [ m4_normalize ( [
4214- the bundled copy of libmpdecimal is scheduled for removal in Python 3.15;
4215- consider using a system installed mpdecimal library.] ) ] ) ] )
4216-
4217- AS_IF ( [ test "$with_system_libmpdec" = "yes" && test "$have_mpdec" = "no"] ,
4218- [ AC_MSG_WARN ( [ m4_normalize ( [
4219- no system libmpdecimal found; falling back to bundled libmpdecimal
4220- (deprecated and scheduled for removal in Python 3.15)] ) ] )
4221- USE_BUNDLED_LIBMPDEC()] )
4211+ ] )] )
42224212
42234213# Disable forced inlining in debug builds, see GH-94847
42244214AS_VAR_IF (
@@ -8136,6 +8126,16 @@ PY_STDLIB_MOD([_curses_panel],
81368126PY_STDLIB_MOD([ _decimal] ,
81378127 [ ] , [ test "$have_mpdec" = "yes"] ,
81388128 [ $LIBMPDEC_CFLAGS] , [ $LIBMPDEC_LIBS] )
8129+
8130+ AS_VAR_IF ( [ with_system_libmpdec] , [ no] ,
8131+ [ AC_MSG_WARN ( [ m4_normalize ( [
8132+ the bundled copy of libmpdecimal is scheduled for removal in Python 3.16;
8133+ consider using a system installed mpdecimal library.] ) ] ) ] )
8134+ AS_IF ( [ test "$with_system_libmpdec" = "yes" && test "$have_mpdec" = "no"] ,
8135+ [ AC_MSG_WARN ( [ m4_normalize ( [
8136+ no system libmpdecimal found; falling back to pure-Python version
8137+ for the decimal module] ) ] ) ] )
8138+
81398139PY_STDLIB_MOD([ _dbm] ,
81408140 [ test -n "$with_dbmliborder"] , [ test "$have_dbm" != "no"] ,
81418141 [ $DBM_CFLAGS] , [ $DBM_LIBS] )
0 commit comments