]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-113565: Improve and harden detection of curses dependencies (#119816)
authorErlend E. Aasland <erlend@python.org>
Mon, 1 Jul 2024 08:10:03 +0000 (10:10 +0200)
committerGitHub <noreply@github.com>
Mon, 1 Jul 2024 08:10:03 +0000 (08:10 +0000)
commitf80376b129ad947263a6b03a6c3a874e9f8706e6
tree3544f2d954f5a817aae4f6514cf449af2c7e63db
parentbd473aa598c5161521a7018896dc124728214a6c
gh-113565: Improve and harden detection of curses dependencies (#119816)

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.
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