FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-154070: Build the curses module wide by capability, not by name by serhiy-storchaka · Pull Request #154071 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ac  (1) .rst  (1) No extension  (1) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Build the :mod:`curses` module against a wide-character capable ncurses
even when it is not named ``ncursesw`` -- for example the pkgsrc ncurses on
NetBSD and illumos, or the system ncurses on macOS. Such a library
previously produced a narrow build.
13 changes: 9 additions & 4 deletions configure

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

19 changes: 13 additions & 6 deletions configure.ac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -7248,12 +7248,18 @@ AS_VAR_IF([ac_sys_system], [Darwin], [
dnl pyconfig.h defines _XOPEN_SOURCE=700
PANEL_CFLAGS=$(echo $PANEL_CFLAGS | sed 's/-D_XOPEN_SOURCE=600//g')

dnl Native curses ("curses") may be wide-character capable (e.g. on NetBSD)
dnl even though it is not ncursesw. Probe for the wide API; if present, build
dnl the module against it like ncursesw by defining HAVE_NCURSESW. ncursesw
dnl already defines HAVE_NCURSESW, and ncurses must stay narrow, so only the
dnl native backend is probed here.
AS_VAR_IF([with_curses], [curses], [
dnl A curses that is not named "ncursesw" can still be wide-character capable:
dnl the system curses of NetBSD, or an ncurses built with --enable-widec that
dnl keeps the plain name (pkgsrc, macOS). Probe for the wide API and, if
dnl present, build the module wide by defining HAVE_NCURSESW. The "ncursesw"
dnl backend already defines it, so only the other backends are probed.
AS_CASE([$with_curses], [ncursesw|no], [], [
dnl Use the adjusted CURSES_CFLAGS (e.g. macOS's -D_XOPEN_SOURCE_EXTENDED)
dnl so the wide-character declarations are visible to the probe. This runs
dnl inside an outer WITH_SAVE_ENV, whose single CPPFLAGS save slot is not
dnl reentrant, so save and restore CPPFLAGS with a dedicated variable here.
save_curses_cppflags=$CPPFLAGS
AS_VAR_APPEND([CPPFLAGS], [" $CURSES_CFLAGS"])
AC_CACHE_CHECK([whether curses supports wide characters],
[ac_cv_curses_wide],
[AC_LINK_IFELSE(
Expand All @@ -7264,6 +7270,7 @@ AS_VAR_IF([with_curses], [curses], [
]])],
[ac_cv_curses_wide=yes],
[ac_cv_curses_wide=no])])
CPPFLAGS=$save_curses_cppflags
dnl HAVE_NCURSESW marks the wide (cchar_t) curses API; its template comes
dnl from the ncursesw pkg-config check above, so no description here.
AS_VAR_IF([ac_cv_curses_wide], [yes], [AC_DEFINE([HAVE_NCURSESW], [1])])
Expand Down
Loading

Back | FazBrowse Home | New Git URL