Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1 | ------------------------------------------------------------------------------- |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2 | -- Copyright 2020 Thomas E. Dickey -- |
| 3 | -- Copyright 2008-2011,2012 Free Software Foundation, Inc. -- |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 4 | -- -- |
| 5 | -- Permission is hereby granted, free of charge, to any person obtaining a -- |
| 6 | -- copy of this software and associated documentation files (the -- |
| 7 | -- "Software"), to deal in the Software without restriction, including -- |
| 8 | -- without limitation the rights to use, copy, modify, merge, publish, -- |
| 9 | -- distribute, distribute with modifications, sublicense, and/or sell copies -- |
| 10 | -- of the Software, and to permit persons to whom the Software is furnished -- |
| 11 | -- to do so, subject to the following conditions: -- |
| 12 | -- -- |
| 13 | -- The above copyright notice and this permission notice shall be included -- |
| 14 | -- in all copies or substantial portions of the Software. -- |
| 15 | -- -- |
| 16 | -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- |
| 17 | -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- |
| 18 | -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -- |
| 19 | -- NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- |
| 20 | -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- |
| 21 | -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -- |
| 22 | -- USE OR OTHER DEALINGS IN THE SOFTWARE. -- |
| 23 | -- -- |
| 24 | -- Except as contained in this notice, the name(s) of the above copyright -- |
| 25 | -- holders shall not be used in advertising or otherwise to promote the -- |
| 26 | -- sale, use or other dealings in this Software without prior written -- |
| 27 | -- authorization. -- |
| 28 | ------------------------------------------------------------------------------- |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 29 | -- $Id: README.MinGW,v 1.14 2020/09/06 22:22:44 tom Exp $ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 30 | -- Author: Juergen Pfeifer |
| 31 | ------------------------------------------------------------------------------- |
| 32 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 33 | This is work in progress, but it is in an state where one can see it |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 34 | works at least on the Windows Console. |
| 35 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 36 | You should install the MSYS2 package, so that you have a shell environment that |
| 37 | allows you to run scripts, especially configure, etc. You can get that |
| 38 | from |
| 39 | https://www.msys2.org/ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 40 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 41 | or the individual packages from |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 42 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 43 | https://sourceforge.net/projects/msys2/files/ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 44 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 45 | You may also use a hosted MinGW cross-compile toolchain, e.g., on Ubuntu or |
| 46 | ArchLinux to build the libraries and tools. |
| 47 | |
| 48 | To build ncurses for native Windows with support for the new Windows 10 Virtual |
| 49 | Terminal and PseudoConsole support, you should install at least version 8.0 of |
| 50 | the mingw-w64-x86_64-headers package as it appears to have support for the |
| 51 | required Windows SDK level. Please note that some of the Linux distributions |
| 52 | are a bit behind with respect to the required MinGW header versions and you may |
| 53 | not be able to properly build the libraries for current Windows 10 using these |
| 54 | toolchains. Although it is a bit slow, MSYS2 on Windows 10 64-Bit is the |
| 55 | authoritative build environment for the MinGW version of ncurses. |
| 56 | |
| 57 | Using MinGW is a pragmatic decision, it is the easiest way to port this |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 58 | heavily UNIX based sourcebase to native Windows. The goal is of course |
| 59 | to provide the includes, libraries and DLLs to be used with the more |
| 60 | common traditional development environments on Windows, mainly with |
| 61 | Microsoft Visual Studio. |
| 62 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 63 | The TERM environment variable must be set especially to activate the Windows |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 64 | console-driver. The driver checks if TERM is set to "#win32con" (explicit |
| 65 | use) or if TERM is unset or empty (implicit). |
| 66 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 67 | Beginning with build 17763 (Fall 2018 update), Windows 10 supports ANSI escape |
| 68 | sequences (Virtual Terminal support). If ncurses detects this or a later |
| 69 | Windows 10 version, the interpretation of the implicit TERM setting (which |
| 70 | means: TERM is not set or empty) changes. In this case, TERM is to be assumed |
| 71 | to be "ms-terminal" and ncurses acts using the regular terminfo based driver, |
| 72 | thus acting like a regular Terminal we all know from UNIX like environments. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 73 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 74 | This code requires WindowsNT 6.0 or better, which means on the client |
| 75 | Windows Vista or better, on the server Windows Server 2008 or better. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 76 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 77 | If running on Windows 10 Build 17763 or later is detected, any program |
| 78 | spawning a subprocess running a ncurses program should use the new |
| 79 | PseudoConsole support, which provides what we know as pty from the UNIX |
| 80 | world also for Windows. Using the CreatePseudoConsole API |
| 81 | (see https://docs.microsoft.com/en-us/windows/console/createpseudoconsole) |
| 82 | in the calling process, it is guaranteed that the called ncurses program has |
| 83 | a console that is required by its implementation, even if the calling program |
| 84 | is NOT a console program, e.g., MSYS2's own mintty Terminal emulator. |
| 85 | |
| 86 | In the current MSYS2/minGW setup, building MinGW shared libraries with |
| 87 | libtool for ncurses seems to be broken, so I recommend NOT to use libtool. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 88 | |
| 89 | To build a modern but still small footprint ncurses that provides |
| 90 | hooks for interop, I recommend using these options: |
| 91 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 92 | --without-libtool |
| 93 | --disable-home-terminfo |
| 94 | --enable-database |
| 95 | --disable-termcap |
| 96 | --enable-sp-funcs |
| 97 | --enable-term-driver |
| 98 | --enable-interop |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 99 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 100 | This is the configuration command line which I am using at the moment |
| 101 | (assuming environment variable MINGW_ROOT holds the root directory name of |
| 102 | your MinGW build): |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 103 | |
| 104 | ./configure \ |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 105 | --prefix=/mingw64 \ |
| 106 | --without-cxx \ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 107 | --without-ada \ |
| 108 | --enable-warnings \ |
| 109 | --enable-assertions \ |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 110 | --enable-exp-win32 \ |
| 111 | --enable-ext-funcs \ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 112 | --disable-home-terminfo \ |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 113 | --disable-echo \ |
| 114 | --disable-getcap \ |
| 115 | --disable-hard-tabs \ |
| 116 | --disable-leaks \ |
| 117 | --disable-macros \ |
| 118 | --disable-overwrite \ |
| 119 | --enable-opaque-curses \ |
| 120 | --enable-opaque-panel \ |
| 121 | --enable-opaque-menu \ |
| 122 | --enable-opaque-form \ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 123 | --enable-database \ |
| 124 | --enable-sp-funcs \ |
| 125 | --enable-term-driver \ |
| 126 | --enable-interop \ |
| 127 | --disable-termcap \ |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 128 | --enable-database \ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 129 | --with-progs \ |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 130 | --without-libtool \ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 131 | --enable-pc-files \ |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 132 | --with-shared \ |
| 133 | --with-normal \ |
| 134 | --without-debug \ |
| 135 | --with-fallbacks=ms-terminal \ |
| 136 | --without-manpages |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 137 | |
| 138 | Please note that it is also necessary to set this environment variable: |
| 139 | |
| 140 | export PATH_SEPARATOR=";" |
| 141 | |
| 142 | in order to parse the terminfo paths correctly. Terminfo paths should |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 143 | always be separated by a semicolon, even when running under MSYS2. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 144 | |
| 145 | All the options above are - like the whole Windows support - |
| 146 | experimental. |
| 147 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 148 | -- vile:txtmode |