]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-113565: Improve and harden detection of curses dependencies (GH-119816...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 1 Jul 2024 08:35:38 +0000 (10:35 +0200)
committerGitHub <noreply@github.com>
Mon, 1 Jul 2024 08:35:38 +0000 (08:35 +0000)
commit82777cd024331598dd87b45a00f9dd71437b93fa
tree33fe7065c9ef191d688ed5d0562a39a71c776729
parentd481d4b7676f2e5d33465ca691346f69af655b24
[3.13] gh-113565: Improve and harden detection of curses dependencies (GH-119816) (#121202)

1. Use pkg-config to check for ncursesw/panelw. If that fails, use
   pkg-config to check for ncurses/panel.
2. Regardless of pkg-config output, search for curses/panel headers, so
   we're sure we have all defines in pyconfig.h.
3. Regardless of pkg-config output, check if libncurses or libncursesw
   contains the 'initscr' symbol; if it does _and_ pkg-config failed
   earlier, add the resulting -llib linker option to CURSES_LIBS.
   Ditto for 'update_panels' and PANEL_LIBS.
4. Wrap the rest of the checks with WITH_SAVE_ENV and make sure we're
   using updated LIBS and CPPFLAGS for those.

Add the PY_CHECK_CURSES convenience macro.
(cherry picked from commit f80376b129ad947263a6b03a6c3a874e9f8706e6)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Include/py_curses.h
Misc/NEWS.d/next/Build/2024-06-02-13-23-26.gh-issue-113565.8xBlId.rst [new file with mode: 0644]
Modules/_curses_panel.c
Modules/_cursesmodule.c
configure
configure.ac
pyconfig.h.in