Skip to content

Commit 653a996

Browse files
committed
Fix: handle curses libraries already in LIBS
1 parent 228b1bf commit 653a996

3 files changed

Lines changed: 46 additions & 15 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 with libraries in ``LIBS`` and ``--without-curses``.
2+
Patched by Shamil Abdulaev.

configure

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

configure.ac

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7248,8 +7248,8 @@ AS_VAR_POPDEF([panel_var])])
72487248

72497249
# Detect the selected backend. ncursesw/ncurses are found via pkg-config;
72507250
# native curses has no .pc file and is left to the header/link probes below.
7251-
# curses_libs/panel_libs drive the AC_SEARCH_LIBS fallback; for "no" they are
7252-
# empty so nothing links and have_curses stays "no".
7251+
# curses_libs/panel_libs drive the AC_SEARCH_LIBS fallback; "no" skips the
7252+
# probes below.
72537253
AS_CASE([$with_curses],
72547254
[ncursesw], [PY_CHECK_CURSES([ncursesw], [panelw])
72557255
curses_libs="ncursesw"; panel_libs="panelw gnupanel"],
@@ -7262,6 +7262,7 @@ AS_CASE([$with_curses],
72627262
AS_VAR_IF([have_curses], [no], [PY_CHECK_CURSES([ncurses], [panel])])
72637263
curses_libs="ncursesw ncurses"; panel_libs="panelw panel gnupanel"])
72647264

7265+
AS_VAR_IF([with_curses], [no], [], [
72657266
WITH_SAVE_ENV([
72667267
# Make sure we've got the header defines. For the native "curses" backend,
72677268
# probe only the plain headers: a system may also have ncurses headers (e.g.
@@ -7280,14 +7281,18 @@ WITH_SAVE_ENV([
72807281
# also serves as a fallback in case pkg-config failed.
72817282
AS_VAR_APPEND([LIBS], [" $CURSES_LIBS $PANEL_LIBS"])
72827283
AC_SEARCH_LIBS([initscr], [$curses_libs],
7283-
[AS_VAR_IF([have_curses], [no],
7284-
[AS_VAR_SET([have_curses], [yes])
7285-
CURSES_LIBS=${CURSES_LIBS-"$ac_cv_search_initscr"}])],
7284+
[AS_VAR_IF([have_curses], [no], [
7285+
AS_VAR_SET([have_curses], [yes])
7286+
AS_VAR_IF([ac_cv_search_initscr], ["none required"], [],
7287+
[CURSES_LIBS=${CURSES_LIBS-"$ac_cv_search_initscr"}])
7288+
])],
72867289
[AS_VAR_SET([have_curses], [no])])
72877290
AC_SEARCH_LIBS([update_panels], [$panel_libs],
7288-
[AS_VAR_IF([have_panel], [no],
7289-
[AS_VAR_SET([have_panel], [yes])
7290-
PANEL_LIBS=${PANEL_LIBS-"$ac_cv_search_update_panels"}])],
7291+
[AS_VAR_IF([have_panel], [no], [
7292+
AS_VAR_SET([have_panel], [yes])
7293+
AS_VAR_IF([ac_cv_search_update_panels], ["none required"], [],
7294+
[PANEL_LIBS=${PANEL_LIBS-"$ac_cv_search_update_panels"}])
7295+
])],
72917296
[AS_VAR_SET([have_panel], [no])])
72927297
72937298
dnl Issue #25720: ncurses has introduced the NCURSES_OPAQUE symbol making opaque
@@ -7498,6 +7503,7 @@ PY_CHECK_CURSES_FUNC([scr_set])
74987503
CPPFLAGS=$ac_save_cppflags
74997504
])dnl have_curses != no
75007505
])dnl save env
7506+
])dnl with_curses != no
75017507

75027508
AC_MSG_NOTICE([checking for device files])
75037509

0 commit comments

Comments
 (0)