@@ -4171,6 +4171,16 @@ if test "$ac_cv_ffi_complex_double_supported" = "yes"; then
41714171 [ Defined if _Complex C type can be used with libffi.] )
41724172fi
41734173
4174+ # Check for use of the libmpdec library
4175+ AC_MSG_CHECKING ( [ for --with-libmpdec] )
4176+ AC_ARG_WITH (
4177+ [ libmpdec] ,
4178+ [ AS_HELP_STRING (
4179+ [ --with-libmpdec] ,
4180+ [ build _decimal module (default is yes)]
4181+ ) ] )
4182+ AC_MSG_RESULT ( [ $with_libmpdec] )
4183+
41744184# Check for use of the system libmpdec library
41754185AC_MSG_CHECKING ( [ for --with-system-libmpdec] )
41764186AC_DEFUN ( [ USE_BUNDLED_LIBMPDEC] ,
@@ -4185,7 +4195,7 @@ AC_ARG_WITH(
41854195 [ --with-system-libmpdec] ,
41864196 [ build _decimal module using an installed mpdecimal library, see Doc/library/decimal.rst (default is yes)]
41874197 ) ] ,
4188- [ AS_IF ( [ test "x$with_system_libmpdec" = xno] ,
4198+ [ AS_IF ( [ test "x$with_system_libmpdec" = xno && test "x$with_libmpdec" = xyes ] ,
41894199 [ USE_BUNDLED_LIBMPDEC()] ) ] ,
41904200 [ with_system_libmpdec="yes"] )
41914201AC_MSG_RESULT ( [ $with_system_libmpdec] )
@@ -4213,16 +4223,16 @@ AS_VAR_IF([with_system_libmpdec], [yes],
42134223 [ have_mpdec=yes] ,
42144224 [ have_mpdec=no] )
42154225 ] )] )
4216- AS_VAR_IF ( [ with_system_libmpdec] , [ no ] ,
4226+ AS_IF ( [ test "$ with_system_libmpdec" = "no" && test "$with_libmpdec" = "yes" ] ,
42174227 [ AC_MSG_WARN ( [ m4_normalize ( [
4218- the bundled copy of libmpdecimal is scheduled for removal in Python 3.16;
4228+ the bundled copy of libmpdec is scheduled for removal in Python 3.16;
42194229 consider using a system installed mpdecimal library.] ) ] ) ] )
42204230
4221- AS_IF ( [ test "$with_system_libmpdec " = "yes" && test "$have_mpdec" = "no"] ,
4222- [ AC_MSG_WARN ( [ m4_normalize ( [
4223- no system libmpdecimal found; falling back to pure-Python version
4224- for the decimal module ] ) ] )
4225- AS_VAR_SET ( [ py_cv_module_] _decimal , [ n/a] ) ] )
4231+ AS_IF ( [ test "$with_libmpdec " = "yes" && test "$have_mpdec" = "no"] ,
4232+ [ AC_MSG_ERROR ( [ m4_normalize ( [
4233+ no system libmpdec found; use --without-libmpdec to build Python with only pure-Python version for the decimal module ] ) ] ) ] )
4234+ AS_VAR_IF ( [ with_libmpdec ] , [ no ] ,
4235+ [ AS_VAR_SET ( [ py_cv_module_] _decimal , [ n/a] ) ] )
42264236
42274237# Disable forced inlining in debug builds, see GH-94847
42284238AS_VAR_IF (
0 commit comments