What I've done is mainly guessing good parameters for compilation, editing config.h, building a set of makefiles, fixing and important error in hardscroll.c and adding a few of `O_BINARY/O_TEXT'. The result is a set of changed files put together under the name `nc_emx_p.zip', and the compiled sources archived under `nc_emx_b.zip'.
dll/*.dll | Dynamic link libraries needed to run programs. Put them in a directory that appeas in LIBPATH |
lib/*.lib | Import libraries in OMF format. Link your programs with these libraries if you want those programs to use the DLLs |
lib/*.a | Static libraries in a.out format. Link your programs with them if you don't want the DLLs or need DOS-compatible programs. |
include/*.h | NCurses, Panel, Menu and Form headers. Compatibility headers (`termcap.h) as well. |
bin/*.exe | Utilities that compile, convert and dump terminfo databases, among other tasks. |
lib/.terminfo/[0-1A-Z] | The compiled terminfo descriptions |
lib/.terminfo/emx.src | A sample set of terminfo description, enough for most systems. |
lib/.terminfo/cleantic.cmd | A script to `pack' terminfo databases, and clean empty directories |
To install the binary distribution, find an empty directory, and unpack it there. Next, move the files to their appropiate places and finally set some required environment variables. Read the following sections for details about where .terminfo should go and important environment variables.
Man pages are in a third archive named NC-EMX-D.ZIP. They're groff sources, so you'll need this program (or a smaller one called `awf') to view them.
The first one, termcap fallback, means reading and parsing of a `termcap.dat' file when no terminfo database is available. It's currently disabled because, at this stage of development this feature seems to be too error prone. I hope I'll find a fix, as well as I did with some other bugs, but this is just a hope.
The second one, normal fallback, or using built in terminal descriptions, should be possible, but has shown some undesirable effects and, until it proves to be stable, this feature will be disabled in the EMX version.
So, finally, you must have a set of compiled terminfo descriptions. These are binary files, which contain the codes for most important keys, as well as some set of commands that clean the screen, change the text attributes, and so on.
There are two possible places where NCurses will find a compiled terminfo database:
Note: watch out! There's a dot in the name .terminfo.
The second way is, in my opinion, the least painful one: you only need to set the HOME environment variable with a path to an existing directory and move `.terminfo' there. And HOME is already used by many other GNU programs and libraries!
The terminfo database is a set of files collected in a peculiar directory tree. To simplify things a bit, I've put an EMX compatible database in NCurses's binary distribution. Let's say you've unpacked the NC-EMX-B.ZIP archive in the c:\tmp directory. Then you should
The precompiled database is the result of running `emx.src' through the program `tic.exe'. `emx.src' is a sample file that lists a set of terminal descriptions including those from EMX's termcap.dat (and some X-terminal descriptions). It adds capabilities to handle function keys, cursor keys, colors, etc, as DOS and OS/2 handle them. There's a copy of `emx.src' in `NCurses-1.9.9e/lib/terminfo'.
Maybe one day you'll need to recompile the database. The steps needed to recompile `emx.src' are, in a simplified way:
Note: cleantic.cmd is a simple batch file that removes empty directories from the .terminfo structure.
These variables should be set in CONFIG.SYS, so that all programs have access to them.
Note: probably, you already have TERM set on your system. You may leave it like that as most of the terminal description that EMX's termcap supported are included in NCurses, too.
Note: make sure the awk program has the name gawk.exe. If not, edit Makefile.inc to suit your system. And if you still have problems, make a copy of that program with the name gawk.exe.
MAKE's variable | default value | comments |
bindir | $(prefix)/bin | where programs are installed |
dlldir | $(prefix)/dll | shared dynamic link libraries |
libdir | $(prefix)/lib | static link libraries |
mandir | $(prefix)/man | manuals |
To get things installed this way, edit `misc\Makefile.inc' setting an appropiate value for prefix, and then run
However, you might choose to install the files manually, which is less risky at this stage of testing. To do so, first build the libraries and the programs (with make all). Next choose a place for programs, libraries and headers. The files you have to install are
./progs/tic.exe | important utility for terminfo compiling |
./misc/emx.src | the source for the terminfo database |
./lib/*.dll | the dynamic link libraries. |
These are only needed when compiling programs that use NCurses:
./lib/*.a | static libraries |
./lib/*.lib | import libraries for programs that use the DLLs |
./include/curses.h
./include/unctrl.h ./include/menu.h ./include/eti.h ./include/form.h ./include/panel.h ./include/termcap.h | important header files for C code |
Note: I recommend you not installing the headers and libraries in EMX's directories, but using other places and adding them to C_INCLUDE_PATH, CPLUS_INCLUDE_PATH, LIBRARY_PATH as explained in the EMX documentation.
See Terminal descriptions above for important instructions about terminfo compiling.
As you probably guessed, they may be used by multithreaded programs and use EMXLIBCM.DLL. So, programs you build and link with NCURSES.LIB, FORMS.LIB, PANELS.LIB or MENU.LIB, must be linked and compiled with the -Zmtd or -Zmt -Zcrtdll flags.
For more information on linking, dynamic link libraries and multithreading, read the EMX documentation.
Note: some time ago I distributed a set of libraries (ncurses.dll, panel.dll, etc) which were compiled without these. They're OK and you may keep them in your system -- in case some program needs them.
BTW, this place has only space for 2Mbytes and, as now I seem to have some spare time I'm planning to do BIG things, I might remove the binary and manual distributions and leave only the patches. However, this shouldn't happen in a month or so (And by that time I will have uploaded it to Hobbes)