freebsd-skq/contrib/ncurses/README.MinGW

149 lines
6.6 KiB
Plaintext
Raw Normal View History

2014-02-28 19:18:07 +00:00
-------------------------------------------------------------------------------
2020-02-19 16:58:06 +00:00
-- Copyright 2020 Thomas E. Dickey --
-- Copyright 2008-2011,2012 Free Software Foundation, Inc. --
2014-02-28 19:18:07 +00:00
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell copies --
-- of the Software, and to permit persons to whom the Software is furnished --
-- to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN --
-- NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE --
-- USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
2021-02-25 17:22:00 +00:00
-- $Id: README.MinGW,v 1.14 2020/09/06 22:22:44 tom Exp $
2014-02-28 19:18:07 +00:00
-- Author: Juergen Pfeifer
-------------------------------------------------------------------------------
2021-02-25 17:22:00 +00:00
This is work in progress, but it is in an state where one can see it
2014-02-28 19:18:07 +00:00
works at least on the Windows Console.
2021-02-25 17:22:00 +00:00
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
from
https://www.msys2.org/
2014-02-28 19:18:07 +00:00
2021-02-25 17:22:00 +00:00
or the individual packages from
2014-02-28 19:18:07 +00:00
2021-02-25 17:22:00 +00:00
https://sourceforge.net/projects/msys2/files/
2014-02-28 19:18:07 +00:00
2021-02-25 17:22:00 +00:00
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
2014-02-28 19:18:07 +00:00
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.
2021-02-25 17:22:00 +00:00
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).
2014-02-28 19:18:07 +00:00
2021-02-25 17:22:00 +00:00
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.
2014-02-28 19:18:07 +00:00
2021-02-25 17:22:00 +00:00
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
(see https://docs.microsoft.com/en-us/windows/console/createpseudoconsole)
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.
2014-02-28 19:18:07 +00:00
2021-02-25 17:22:00 +00:00
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:
2014-02-28 19:18:07 +00:00
2021-02-25 17:22:00 +00:00
--without-libtool
--disable-home-terminfo
--enable-database
--disable-termcap
--enable-sp-funcs
--enable-term-driver
--enable-interop
2014-02-28 19:18:07 +00:00
2021-02-25 17:22:00 +00:00
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):
2014-02-28 19:18:07 +00:00
./configure \
2021-02-25 17:22:00 +00:00
--prefix=/mingw64 \
--without-cxx \
2014-02-28 19:18:07 +00:00
--without-ada \
--enable-warnings \
--enable-assertions \
2021-02-25 17:22:00 +00:00
--enable-exp-win32 \
--enable-ext-funcs \
2014-02-28 19:18:07 +00:00
--disable-home-terminfo \
2021-02-25 17:22:00 +00:00
--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 \
2014-02-28 19:18:07 +00:00
--enable-sp-funcs \
--enable-term-driver \
--enable-interop \
--disable-termcap \
2021-02-25 17:22:00 +00:00
--enable-database \
--with-progs \
2021-02-25 17:22:00 +00:00
--without-libtool \
--enable-pc-files \
2021-02-25 17:22:00 +00:00
--with-shared \
--with-normal \
--without-debug \
--with-fallbacks=ms-terminal \
--without-manpages
2014-02-28 19:18:07 +00:00
Please note that it is also necessary to set this environment variable:
2014-02-28 19:18:07 +00:00
export PATH_SEPARATOR=";"
2014-02-28 19:18:07 +00:00
in order to parse the terminfo paths correctly. Terminfo paths should
2021-02-25 17:22:00 +00:00
always be separated by a semicolon, even when running under MSYS2.
All the options above are - like the whole Windows support -
experimental.
2014-02-28 19:18:07 +00:00
2021-02-25 17:22:00 +00:00
-- vile:txtmode