]> ncurses.scripts.mit.edu Git - ncurses.git/blob - README.MinGW
ncurses 6.2 - patch 20200704
[ncurses.git] / README.MinGW
1 -------------------------------------------------------------------------------
2 -- Copyright 2020 Thomas E. Dickey                                           --
3 -- Copyright 2008-2011,2012 Free Software Foundation, Inc.                   --
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 -------------------------------------------------------------------------------
29 -- $Id: README.MinGW,v 1.10 2020/02/02 23:34:34 tom Exp $
30 -- Author: Juergen Pfeifer
31 -------------------------------------------------------------------------------
32
33 This is work in progress, but it's in an state where one can see it
34 works at least on the Windows Console.
35
36 You should install the MSYS package, so that you've a shell environment that
37 allows you to run the scripts, especially configure etc.  You can get that
38 from http://www.mingw.org
39
40 To build ncurses for native Windows, you need the MinGW toolchain.  The
41 original MinGW toolchain from the above site is only for 32-Bit Windows.  As
42 Windows Server - and also regular workstations - are moving to 64-Bit, it
43 seems to be reasonable to have a toolchain that supports both architectures.
44 I recommend to use the TDM gcc toolchain which you can find at
45 http://tdm-gcc.tdragon.net/download.  Go to the download section and select
46 the bundle installer for tdm64 (MinGW-w64).  This installs a multilib version
47 of the gcc toolchain that can compile for native 32- and 64-Bit Windows
48 versions.  It also comes with a working pthread implementation.
49
50 The latest config and build scripts we use for MinGW have only been tested
51 for the gcc-4.6.1 compiler toolchain (or better).
52
53 Using MinGW is a pragmatic decision, it's the easiest way to port this
54 heavily UNIX based sourcebase to native Windows. The goal is of course
55 to provide the includes, libraries and DLLs to be used with the more
56 common traditional development environments on Windows, mainly with
57 Microsoft Visual Studio.
58
59 The TERM environment variable must be set specially to active the Windows
60 console-driver.  The driver checks if TERM is set to "#win32con" (explicit
61 use) or if TERM is unset or empty (implicit).
62
63 Please also make sure that MSYS links to the correct directory containing
64 your MinGW toolchain. For TDM this is usually C:\MinGW64. In your Windows
65 CMD.EXE command shell go to the MSYS root directory (most probably
66 C:\MSYS or C:\MSYS\1.0) and verify, that there is a junction point mingw
67 that points to the MinGW toolchain directory. If not, delete the mingw
68 directory and use the mklink command (or the linkd.exe utility on older
69 Windows) to create the junction point.
70
71 This code requires WindowsNT 5.1 or better, which means on the client
72 Windows XP or better, on the server Windows Server 2003 or better.
73
74 I recommend using libtool to build ncurses on MinGW, because libtool
75 knows exactly how to build dll's on Windows for use with MinGW.
76
77 To build a modern but still small footprint ncurses that provides
78 hooks for interop, I recommend using these options:
79
80           --with-libtool
81           --disable-home-terminfo
82           --enable-database
83           --disable-termcap
84           --enable-sp-funcs
85           --enable-term-driver
86           --enable-interop
87
88 This is the configuration commandline as I'm using it at the moment (assuming
89 environment variable MINGW_ROOT to hold the root directory name of your MinGW
90 build):
91
92 ./configure \
93         --prefix=$MINGW_ROOT \
94         --with-cxx \
95         --without-ada \
96         --enable-warnings \
97         --enable-assertions \
98         --disable-home-terminfo \
99         --enable-database \
100         --enable-sp-funcs \
101         --enable-term-driver \
102         --enable-interop \
103         --disable-termcap \
104         --with-progs \
105         --with-libtool \
106         --enable-pc-files \
107         --mandir=$MINGW_ROOT/share/man
108
109 Please note that it is also necessary to set this environment variable:
110
111 export PATH_SEPARATOR=";"
112
113 in order to parse the terminfo paths correctly. Terminfo paths should
114 always be separated by a seeeemicolon,even when running under MSYS.
115
116 To support regular expressions properly, ncurses under MinGW should be
117 linked against the gnurx regex library, which must be built separately
118 under MinGW.  See
119
120     ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/libgnurx-src-2.5.zip
121
122 All the options above are - like the whole Windows support -
123 experimental.
124
125 A lot is still TODO, e.g.:
126
127   - Wide Character support (display is workable, but input untested)
128     The Win32Con driver should actually only use Unicode in the
129     future.
130   - Thread support (locking). If using TDM toolchain this is done by
131     configuring pthreads.
132   - A GUI console driver
133   - Support for Terminals attached via a serial port (via terminfo)
134   - Support for networked Terminal connections (via terminfo)
135   - Workarounds for MinGW's filesystem access are necessary to make infocmp
136     work (though tic works).
137
138 To support terminfo, we would need to have an ioctl() simulation for the
139 serial and networked terminals.