Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1 | ------------------------------------------------------------------------------- |
| 2 | -- Copyright (c) 2008-2011,2012 Free Software Foundation, Inc. -- |
| 3 | -- -- |
| 4 | -- Permission is hereby granted, free of charge, to any person obtaining a -- |
| 5 | -- copy of this software and associated documentation files (the -- |
| 6 | -- "Software"), to deal in the Software without restriction, including -- |
| 7 | -- without limitation the rights to use, copy, modify, merge, publish, -- |
| 8 | -- distribute, distribute with modifications, sublicense, and/or sell copies -- |
| 9 | -- of the Software, and to permit persons to whom the Software is furnished -- |
| 10 | -- to do so, subject to the following conditions: -- |
| 11 | -- -- |
| 12 | -- The above copyright notice and this permission notice shall be included -- |
| 13 | -- in all copies or substantial portions of the Software. -- |
| 14 | -- -- |
| 15 | -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- |
| 16 | -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- |
| 17 | -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -- |
| 18 | -- NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- |
| 19 | -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- |
| 20 | -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -- |
| 21 | -- USE OR OTHER DEALINGS IN THE SOFTWARE. -- |
| 22 | -- -- |
| 23 | -- Except as contained in this notice, the name(s) of the above copyright -- |
| 24 | -- holders shall not be used in advertising or otherwise to promote the -- |
| 25 | -- sale, use or other dealings in this Software without prior written -- |
| 26 | -- authorization. -- |
| 27 | ------------------------------------------------------------------------------- |
| 28 | -- $Id: README.MinGW,v 1.9 2012/09/22 17:46:04 tom Exp $ |
| 29 | -- Author: Juergen Pfeifer |
| 30 | ------------------------------------------------------------------------------- |
| 31 | |
| 32 | This is work in progress, but it's in an state where one can see it |
| 33 | works at least on the Windows Console. |
| 34 | |
| 35 | You should install the MSYS package, so that you've a shell environment that |
| 36 | allows you to run the scripts, especially configure etc. You can get that |
| 37 | from http://www.mingw.org |
| 38 | |
| 39 | To build ncurses for native Windows, you need the MinGW toolchain. The |
| 40 | original MinGW toolchain from the above site is only for 32-Bit Windows. As |
| 41 | Windows Server - and also regular workstations - are moving to 64-Bit, it |
| 42 | seems to be reasonable to have a toolchain that supports both architectures. |
| 43 | I recommend to use the TDM gcc toolchain which you can find at |
| 44 | http://tdm-gcc.tdragon.net/download. Go to the download section and select |
| 45 | the bundle installer for tdm64 (MinGW-w64). This installs a multilib version |
| 46 | of the gcc toolchain that can compile for native 32- and 64-Bit Windows |
| 47 | versions. It also comes with a working pthread implementation. |
| 48 | |
| 49 | The latest config and build scripts we use for MinGW have only been tested |
| 50 | for the gcc-4.6.1 compiler toolchain (or better). |
| 51 | |
| 52 | Using MinGW is a pragmatic decision, it's the easiest way to port this |
| 53 | heavily UNIX based sourcebase to native Windows. The goal is of course |
| 54 | to provide the includes, libraries and DLLs to be used with the more |
| 55 | common traditional development environments on Windows, mainly with |
| 56 | Microsoft Visual Studio. |
| 57 | |
| 58 | The TERM environment variable must be set specially to active the Windows |
| 59 | console-driver. The driver checks if TERM is set to "#win32con" (explicit |
| 60 | use) or if TERM is unset or empty (implicit). |
| 61 | |
| 62 | Please also make sure that MSYS links to the correct directory containing |
| 63 | your MinGW toolchain. For TDM this is usually C:\MinGW64. In your Windows |
| 64 | CMD.EXE command shell go to the MSYS root directory (most probably |
| 65 | C:\MSYS or C:\MSYS\1.0) and verify, that there is a junction point mingw |
| 66 | that points to the MinGW toolchain directory. If not, delete the mingw |
| 67 | directory and use the mklink command (or the linkd.exe utility on older |
| 68 | Windows) to create the junction point. |
| 69 | |
| 70 | This code requires WindowsNT 5.1 or better, which means on the client |
| 71 | Windows XP or better, on the server Windows Server 2003 or better. |
| 72 | |
| 73 | I recommend using libtool to build ncurses on MinGW, because libtool |
| 74 | knows exactly how to build dll's on Windows for use with MinGW. |
| 75 | |
| 76 | To build a modern but still small footprint ncurses that provides |
| 77 | hooks for interop, I recommend using these options: |
| 78 | |
| 79 | --with-libtool |
| 80 | --disable-home-terminfo |
| 81 | --enable-database |
| 82 | --disable-termcap |
| 83 | --enable-sp-funcs |
| 84 | --enable-term-driver |
| 85 | --enable-interop |
| 86 | |
| 87 | This is the configuration commandline as I'm using it at the moment (assuming |
| 88 | environment variable MINGW_ROOT to hold the root directory name of your MinGW |
| 89 | build): |
| 90 | |
| 91 | ./configure \ |
| 92 | --prefix=$MINGW_ROOT \ |
| 93 | --with-cxx \ |
| 94 | --without-ada \ |
| 95 | --enable-warnings \ |
| 96 | --enable-assertions \ |
| 97 | --disable-home-terminfo \ |
| 98 | --enable-database \ |
| 99 | --enable-sp-funcs \ |
| 100 | --enable-term-driver \ |
| 101 | --enable-interop \ |
| 102 | --disable-termcap \ |
| 103 | --with-progs \ |
| 104 | --with-libtool \ |
| 105 | --enable-pc-files \ |
| 106 | --mandir=$MINGW_ROOT/share/man |
| 107 | |
| 108 | Please note that it is also necessary to set this environment variable: |
| 109 | |
| 110 | export PATH_SEPARATOR=";" |
| 111 | |
| 112 | in order to parse the terminfo paths correctly. Terminfo paths should |
| 113 | always be separated by a seeeemicolon,even when running under MSYS. |
| 114 | |
| 115 | To support regular expressions properly, ncurses under MinGW should be |
| 116 | linked against the gnurx regex library, which must be built separately |
| 117 | under MinGW. See |
| 118 | |
| 119 | ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/libgnurx-src-2.5.zip |
| 120 | |
| 121 | All the options above are - like the whole Windows support - |
| 122 | experimental. |
| 123 | |
| 124 | A lot is still TODO, e.g.: |
| 125 | |
| 126 | - Wide Character support (display is workable, but input untested) |
| 127 | The Win32Con driver should actually only use Unicode in the |
| 128 | future. |
| 129 | - Thread support (locking). If using TDM toolchain this is done by |
| 130 | configuring pthreads. |
| 131 | - A GUI console driver |
| 132 | - Support for Terminals attached via a serial port (via terminfo) |
| 133 | - Support for networked Terminal connections (via terminfo) |
| 134 | - Workarounds for MinGW's filesystem access are necessary to make infocmp |
| 135 | work (though tic works). |
| 136 | |
| 137 | To support terminfo, we would need to have an ioctl() simulation for the |
| 138 | serial and networked terminals. |