Diffstat (limited to 'README.MinGW')
1 files changed, 74 insertions, 65 deletions
diff --git a/README.MinGW b/README.MinGW
index 56a2bca21e34..3add2e7de3e2 100644
@@ -26,114 +26,123 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
--- $Id: README.MinGW,v 1.10 2020/02/02 23:34:34 tom Exp $
+-- $Id: README.MinGW,v 1.14 2020/09/06 22:22:44 tom Exp $
-- Author: Juergen Pfeifer
-This is work in progress, but it's in an state where one can see it
+This is work in progress, but it is in an state where one can see it
works at least on the Windows Console.
-You should install the MSYS package, so that you've a shell environment that
-allows you to run the scripts, especially configure etc. You can get that
+You should install the MSYS2 package, so that you have a shell environment that
+allows you to run scripts, especially configure, etc. You can get that
-To build ncurses for native Windows, you need the MinGW toolchain. The
-original MinGW toolchain from the above site is only for 32-Bit Windows. As
-Windows Server - and also regular workstations - are moving to 64-Bit, it
-seems to be reasonable to have a toolchain that supports both architectures.
-I recommend to use the TDM gcc toolchain which you can find at
-http://tdm-gcc.tdragon.net/download. Go to the download section and select
-the bundle installer for tdm64 (MinGW-w64). This installs a multilib version
-of the gcc toolchain that can compile for native 32- and 64-Bit Windows
-versions. It also comes with a working pthread implementation.
+or the individual packages from
-The latest config and build scripts we use for MinGW have only been tested
-for the gcc-4.6.1 compiler toolchain (or better).
-Using MinGW is a pragmatic decision, it's the easiest way to port this
+You may also use a hosted MinGW cross-compile toolchain, e.g., on Ubuntu or
+ArchLinux to build the libraries and tools.
+To build ncurses for native Windows with support for the new Windows 10 Virtual
+Terminal and PseudoConsole support, you should install at least version 8.0 of
+the mingw-w64-x86_64-headers package as it appears to have support for the
+required Windows SDK level. Please note that some of the Linux distributions
+are a bit behind with respect to the required MinGW header versions and you may
+not be able to properly build the libraries for current Windows 10 using these
+toolchains. Although it is a bit slow, MSYS2 on Windows 10 64-Bit is the
+authoritative build environment for the MinGW version of ncurses.
+Using MinGW is a pragmatic decision, it is the easiest way to port this
heavily UNIX based sourcebase to native Windows. The goal is of course
to provide the includes, libraries and DLLs to be used with the more
common traditional development environments on Windows, mainly with
Microsoft Visual Studio.
-The TERM environment variable must be set specially to active the Windows
+The TERM environment variable must be set especially to activate the Windows
console-driver. The driver checks if TERM is set to "#win32con" (explicit
use) or if TERM is unset or empty (implicit).
-Please also make sure that MSYS links to the correct directory containing
-your MinGW toolchain. For TDM this is usually C:\MinGW64. In your Windows
-CMD.EXE command shell go to the MSYS root directory (most probably
-C:\MSYS or C:\MSYS\1.0) and verify, that there is a junction point mingw
-that points to the MinGW toolchain directory. If not, delete the mingw
-directory and use the mklink command (or the linkd.exe utility on older
-Windows) to create the junction point.
+Beginning with build 17763 (Fall 2018 update), Windows 10 supports ANSI escape
+sequences (Virtual Terminal support). If ncurses detects this or a later
+Windows 10 version, the interpretation of the implicit TERM setting (which
+means: TERM is not set or empty) changes. In this case, TERM is to be assumed
+to be "ms-terminal" and ncurses acts using the regular terminfo based driver,
+thus acting like a regular Terminal we all know from UNIX like environments.
+This code requires WindowsNT 6.0 or better, which means on the client
+Windows Vista or better, on the server Windows Server 2008 or better.
-This code requires WindowsNT 5.1 or better, which means on the client
-Windows XP or better, on the server Windows Server 2003 or better.
+If running on Windows 10 Build 17763 or later is detected, any program
+spawning a subprocess running a ncurses program should use the new
+PseudoConsole support, which provides what we know as pty from the UNIX
+world also for Windows. Using the CreatePseudoConsole API
+in the calling process, it is guaranteed that the called ncurses program has
+a console that is required by its implementation, even if the calling program
+is NOT a console program, e.g., MSYS2's own mintty Terminal emulator.
-I recommend using libtool to build ncurses on MinGW, because libtool
-knows exactly how to build dll's on Windows for use with MinGW.
+In the current MSYS2/minGW setup, building MinGW shared libraries with
+libtool for ncurses seems to be broken, so I recommend NOT to use libtool.
To build a modern but still small footprint ncurses that provides
hooks for interop, I recommend using these options:
-This is the configuration commandline as I'm using it at the moment (assuming
-environment variable MINGW_ROOT to hold the root directory name of your MinGW
+This is the configuration command line which I am using at the moment
+(assuming environment variable MINGW_ROOT holds the root directory name of
+your MinGW build):
- --prefix=$MINGW_ROOT \
- --with-cxx \
+ --prefix=/mingw64 \
+ --without-cxx \
+ --enable-exp-win32 \
+ --enable-ext-funcs \
+ --disable-echo \
+ --disable-getcap \
+ --disable-hard-tabs \
+ --disable-leaks \
+ --disable-macros \
+ --disable-overwrite \
+ --enable-opaque-curses \
+ --enable-opaque-panel \
+ --enable-opaque-menu \
+ --enable-opaque-form \
+ --enable-database \
- --with-libtool \
+ --without-libtool \
+ --with-shared \
+ --with-normal \
+ --without-debug \
+ --with-fallbacks=ms-terminal \
Please note that it is also necessary to set this environment variable:
in order to parse the terminfo paths correctly. Terminfo paths should
-always be separated by a seeeemicolon,even when running under MSYS.
-To support regular expressions properly, ncurses under MinGW should be
-linked against the gnurx regex library, which must be built separately
-under MinGW. See
+always be separated by a semicolon, even when running under MSYS2.
All the options above are - like the whole Windows support -
-A lot is still TODO, e.g.:
- - Wide Character support (display is workable, but input untested)
- The Win32Con driver should actually only use Unicode in the
- - Thread support (locking). If using TDM toolchain this is done by
- configuring pthreads.
- - A GUI console driver
- - Support for Terminals attached via a serial port (via terminfo)
- - Support for networked Terminal connections (via terminfo)
- - Workarounds for MinGW's filesystem access are necessary to make infocmp
- work (though tic works).
-To support terminfo, we would need to have an ioctl() simulation for the
-serial and networked terminals.