Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix curses detection with libraries in ``LIBS`` and ``--without-curses``.
Patched by Shamil Abdulaev.
37 changes: 30 additions & 7 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 14 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -7248,8 +7248,8 @@ AS_VAR_POPDEF([panel_var])])

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

AS_VAR_IF([with_curses], [no], [], [
WITH_SAVE_ENV([
# Make sure we've got the header defines. For the native "curses" backend,
# probe only the plain headers: a system may also have ncurses headers (e.g.
Expand All @@ -7280,14 +7281,18 @@ WITH_SAVE_ENV([
# also serves as a fallback in case pkg-config failed.
AS_VAR_APPEND([LIBS], [" $CURSES_LIBS $PANEL_LIBS"])
AC_SEARCH_LIBS([initscr], [$curses_libs],
[AS_VAR_IF([have_curses], [no],
[AS_VAR_SET([have_curses], [yes])
CURSES_LIBS=${CURSES_LIBS-"$ac_cv_search_initscr"}])],
[AS_VAR_IF([have_curses], [no], [
AS_VAR_SET([have_curses], [yes])
AS_VAR_IF([ac_cv_search_initscr], ["none required"], [],
[CURSES_LIBS=${CURSES_LIBS-"$ac_cv_search_initscr"}])
])],
[AS_VAR_SET([have_curses], [no])])
AC_SEARCH_LIBS([update_panels], [$panel_libs],
[AS_VAR_IF([have_panel], [no],
[AS_VAR_SET([have_panel], [yes])
PANEL_LIBS=${PANEL_LIBS-"$ac_cv_search_update_panels"}])],
[AS_VAR_IF([have_panel], [no], [
AS_VAR_SET([have_panel], [yes])
AS_VAR_IF([ac_cv_search_update_panels], ["none required"], [],
[PANEL_LIBS=${PANEL_LIBS-"$ac_cv_search_update_panels"}])
])],
[AS_VAR_SET([have_panel], [no])])

dnl Issue #25720: ncurses has introduced the NCURSES_OPAQUE symbol making opaque
Expand Down Expand Up @@ -7498,6 +7503,7 @@ PY_CHECK_CURSES_FUNC([scr_set])
CPPFLAGS=$ac_save_cppflags
])dnl have_curses != no
])dnl save env
])dnl with_curses != no

AC_MSG_NOTICE([checking for device files])

Expand Down
Loading