Skip to content

Commit 74358f2

Browse files
[3.15] gh-155911: Fix curses detection with libraries in LIBS (GH-156130) (GH-156223)
AC_SEARCH_LIBS tries linking with no extra library first, so a curses library already in LIBS made the search report "none required", which then became the module's link flag. Search with only the libraries the module is linked with. (cherry picked from commit f74cdf8) Co-authored-by: Shamil <ashm.tech@proton.me>
1 parent 6de9200 commit 74358f2

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix curses detection when a curses library is already in ``LIBS``.
2+
Patch by Shamil Abdulaev.

‎configure‎

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎configure.ac‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7153,8 +7153,9 @@ WITH_SAVE_ENV([
71537153
]))
71547154
71557155
# Check that we're able to link with crucial curses/panel functions. This
7156-
# also serves as a fallback in case pkg-config failed.
7157-
AS_VAR_APPEND([LIBS], [" $CURSES_LIBS $PANEL_LIBS"])
7156+
# also serves as a fallback in case pkg-config failed. Extension modules are
7157+
# not linked with LIBS, so exclude it to get the required libraries.
7158+
LIBS="$CURSES_LIBS $PANEL_LIBS"
71587159
AC_SEARCH_LIBS([initscr], [ncursesw ncurses],
71597160
[AS_VAR_IF([have_curses], [no],
71607161
[AS_VAR_SET([have_curses], [yes])

0 commit comments

Comments
 (0)