From a223317c4d6f076469144d9b5f8cecdaed5320e3 Mon Sep 17 00:00:00 2001 From: Shamil Abdulaev Date: Thu, 20 Aug 2026 20:49:53 +0300 Subject: [PATCH] Fix: handle curses libraries already in LIBS --- .../Build/2026-08-20-17-41-11.gh-issue-155911.yL3z8q.rst | 2 ++ configure | 5 +++-- configure.ac | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2026-08-20-17-41-11.gh-issue-155911.yL3z8q.rst diff --git a/Misc/NEWS.d/next/Build/2026-08-20-17-41-11.gh-issue-155911.yL3z8q.rst b/Misc/NEWS.d/next/Build/2026-08-20-17-41-11.gh-issue-155911.yL3z8q.rst new file mode 100644 index 000000000000000..f102002dfef3077 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-08-20-17-41-11.gh-issue-155911.yL3z8q.rst @@ -0,0 +1,2 @@ +Fix curses detection with libraries in ``LIBS`` and +:option:`--without-curses`. Patch by Shamil Abdulaev. diff --git a/configure b/configure index ea560d600722592..f0517c8de0f91b2 100755 --- a/configure +++ b/configure @@ -30970,8 +30970,9 @@ esac fi # Check that we're able to link with crucial curses/panel functions. This - # also serves as a fallback in case pkg-config failed. - as_fn_append LIBS " $CURSES_LIBS $PANEL_LIBS" + # also serves as a fallback in case pkg-config failed. Extension modules are + # not linked with LIBS, so exclude it to get the required libraries. + LIBS="$CURSES_LIBS $PANEL_LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing initscr" >&5 printf %s "checking for library containing initscr... " >&6; } if test ${ac_cv_search_initscr+y} diff --git a/configure.ac b/configure.ac index 7dfc6ca29297a8b..3220e01b1ee0c72 100644 --- a/configure.ac +++ b/configure.ac @@ -7277,8 +7277,9 @@ WITH_SAVE_ENV([ ]))]) # Check that we're able to link with crucial curses/panel functions. This - # also serves as a fallback in case pkg-config failed. - AS_VAR_APPEND([LIBS], [" $CURSES_LIBS $PANEL_LIBS"]) + # also serves as a fallback in case pkg-config failed. Extension modules are + # not linked with LIBS, so exclude it to get the required libraries. + LIBS="$CURSES_LIBS $PANEL_LIBS" AC_SEARCH_LIBS([initscr], [$curses_libs], [AS_VAR_IF([have_curses], [no], [AS_VAR_SET([have_curses], [yes])