From 4f87c917c8c48840fd67cb2b3050fcf78c4e3745 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Mon, 6 May 2024 00:21:46 +0200 Subject: [PATCH] Address review: warn if system library was not found --- configure | 20 +++++++++++++------- configure.ac | 26 ++++++++++++++------------ 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/configure b/configure index c96c89bafee29f..2405938af71c82 100755 --- a/configure +++ b/configure @@ -14708,9 +14708,10 @@ save_CPPFLAGS=$CPPFLAGS save_LDFLAGS=$LDFLAGS save_LIBS=$LIBS -CPPFLAGS="$LIBMPDEC_CFLAGS $CPPFLAGS" - LDFLAGS="$LIBMPDEC_LIBS $LDFLAGS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing mpd_version" >&5 + + CPPFLAGS="$LIBMPDEC_CFLAGS $CPPFLAGS" + LDFLAGS="$LIBMPDEC_LIBS $LDFLAGS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing mpd_version" >&5 printf %s "checking for library containing mpd_version... " >&6; } if test ${ac_cv_search_mpd_version+y} then : @@ -14778,11 +14779,16 @@ LIBS=$save_LIBS else $as_nop - have_mpdec=yes - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: the bundled copy of libmpdecimal is scheduled for removal in Python 3.15; consider using a system installed mpdecimal library." >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: the bundled copy of libmpdecimal is scheduled for removal in Python 3.15; consider using a system installed mpdecimal library." >&5 printf "%s\n" "$as_me: WARNING: the bundled copy of libmpdecimal is scheduled for removal in Python 3.15; consider using a system installed mpdecimal library." >&2;} fi +if test "$with_system_libmpdec" = "yes" && test "$have_mpdec" = "no" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: no system libmpdecimal found; unable to build _decimal" >&5 +printf "%s\n" "$as_me: WARNING: no system libmpdecimal found; unable to build _decimal" >&2;} +fi + # Disable forced inlining in debug builds, see GH-94847 if test "x$with_pydebug" = xyes then : @@ -30507,9 +30513,9 @@ printf %s "checking for stdlib extension module _decimal... " >&6; } if test "$py_cv_module__decimal" != "n/a" then : - if test "$have_mpdec" = "yes" + if true then : - if true + if test "$have_mpdec" = "yes" then : py_cv_module__decimal=yes else $as_nop diff --git a/configure.ac b/configure.ac index e298d1daf0c220..102d4ffb75615f 100644 --- a/configure.ac +++ b/configure.ac @@ -3991,17 +3991,19 @@ AS_VAR_IF( LIBMPDEC_LIBS="-lm \$(LIBMPDEC_A)" LIBMPDEC_INTERNAL="\$(LIBMPDEC_HEADERS) \$(LIBMPDEC_A)"]) -AS_VAR_IF( - [with_system_libmpdec], [yes], - [WITH_SAVE_ENV( - [CPPFLAGS="$LIBMPDEC_CFLAGS $CPPFLAGS" - LDFLAGS="$LIBMPDEC_LIBS $LDFLAGS" - AC_SEARCH_LIBS([mpd_version], [mpdec], - [have_mpdec=yes], [have_mpdec=no])])], - [AS_VAR_SET([have_mpdec], [yes]) - AC_MSG_WARN([m4_normalize([the bundled copy of libmpdecimal is scheduled for - removal in Python 3.15; consider using a system - installed mpdecimal library.])])]) +AS_VAR_IF([with_system_libmpdec], [yes], + [WITH_SAVE_ENV([ + CPPFLAGS="$LIBMPDEC_CFLAGS $CPPFLAGS" + LDFLAGS="$LIBMPDEC_LIBS $LDFLAGS" + AC_SEARCH_LIBS( + [mpd_version], [mpdec], + [have_mpdec=yes], [have_mpdec=no])])], + [AC_MSG_WARN([m4_normalize([ + the bundled copy of libmpdecimal is scheduled for removal in Python 3.15; + consider using a system installed mpdecimal library.])])]) + +AS_IF([test "$with_system_libmpdec" = "yes" && test "$have_mpdec" = "no"], + [AC_MSG_WARN([no system libmpdecimal found; unable to build _decimal])]) # Disable forced inlining in debug builds, see GH-94847 AS_VAR_IF( @@ -7681,7 +7683,7 @@ PY_STDLIB_MOD([_curses_panel], [$PANEL_CFLAGS $CURSES_CFLAGS], [$PANEL_LIBS $CURSES_LIBS] ) PY_STDLIB_MOD([_decimal], - [test "$have_mpdec" = "yes"], [], + [], [test "$have_mpdec" = "yes"], [$LIBMPDEC_CFLAGS], [$LIBMPDEC_LIBS]) PY_STDLIB_MOD([_dbm], [test -n "$with_dbmliborder"], [test "$have_dbm" != "no"],