Skip to content

Commit 3c274d0

Browse files
gh-136687: Add ./configure --with-curses to select the curses backend (GH-153992)
Add --with-curses=ncursesw|ncurses|curses|no, mirroring --with-readline. The default (auto) keeps the current behaviour: prefer ncursesw, fall back to ncurses. --with-curses=curses links the system's native curses (e.g. on NetBSD or Solaris), which has no pkg-config file and was previously unreachable; it is built with wide-character support when the library provides it. --without-curses excludes the curses and _curses_panel modules from the build. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 1f13740 commit 3c274d0

5 files changed

Lines changed: 1139 additions & 56 deletions

File tree

Doc/using/configure.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,32 @@ Libraries options
10871087

10881088
.. versionadded:: 3.10
10891089

1090+
.. option:: --with-curses=ncursesw|ncurses|curses
1091+
1092+
Designate a backend library for the :mod:`curses` and :mod:`curses.panel`
1093+
modules.
1094+
1095+
* ``ncursesw``: Use the wide-character ``libncursesw`` (and ``libpanelw``),
1096+
found via ``pkg-config``.
1097+
* ``ncurses``: Use ``libncurses`` (and ``libpanel``), found via
1098+
``pkg-config``.
1099+
* ``curses``: Use the system's native ``libcurses`` (and ``libpanel``), such
1100+
as on NetBSD or Solaris. It is built with wide-character support when the
1101+
library provides it.
1102+
1103+
Without this option (or with ``--with-curses=auto``, the default), Python
1104+
tries ``ncursesw`` and then ``ncurses``; the native ``curses`` is used only
1105+
when requested explicitly.
1106+
1107+
.. versionadded:: next
1108+
1109+
.. option:: --without-curses
1110+
1111+
Don't build the :mod:`curses` and :mod:`curses.panel` modules, even when a
1112+
curses library is present (built by default when one is found).
1113+
1114+
.. versionadded:: next
1115+
10901116
.. option:: --with-libm=STRING
10911117

10921118
Override ``libm`` math library to *STRING* (default is system-dependent).

Doc/whatsnew/3.16.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,15 @@ Build changes
768768

769769
(Contributed by Stefano Rivera in :gh:`131372`.)
770770

771+
* Add the :option:`--with-curses` :program:`configure` option to select the
772+
curses backend for the :mod:`curses` and :mod:`curses.panel` modules.
773+
In addition to ``ncursesw`` and ``ncurses``, it can now build against the
774+
system's native ``curses`` library (for example on NetBSD or Solaris), with
775+
wide-character support when the library provides it. :option:`--without-curses`
776+
excludes the modules from the build.
777+
778+
(Contributed by Serhiy Storchaka in :gh:`136687`.)
779+
771780

772781
C API changes
773782
=============
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Add the :option:`--with-curses` option to :program:`configure` to select the
2+
curses backend (``ncursesw``, ``ncurses`` or the system's native ``curses``) or,
3+
as :option:`--without-curses`, to exclude the :mod:`curses` and
4+
:mod:`curses.panel` modules from the build.

0 commit comments

Comments
 (0)