Skip to content

[3.13] gh-113565: Improve and harden detection of curses dependencies (GH-119816) #121202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jul 1, 2024

  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 f80376b)

Co-authored-by: Erlend E. Aasland erlend@python.org

…ythonGH-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.
(cherry picked from commit f80376b)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants