This file explains how to compile wcd for DOS, Windows, and OS/2
with GNU C compiler (GCC, DJGPP/MinGW/EMX).

For Unix/Linux/Cygwin compile instructions see file UNIX.txt

For how to install the program on DOS, Windows, OS/2 see file INST_DOS.txt.


Prerequisites
=============

* gcc       : GNU C compiler
* make      : GNU make
* sh        : POSIX type shell
* coreutils : GNU core utilities package
* sed       : Stream editor
* perl      : Practical Extraction and Report Language (perlpod)

Optional:

* gettext   : Framework to help GNU packages produce multi-lingual messages.
* libiconv  : Character set conversion library.
* pdcurses  : CRT screen handling and optimization package


If you want to generate PostScript or PDF versions of the manual:

* groff       : GNU troff text formatting system.
* ghostscript : An interpreter for the PostScript language and for PDF (ps2pdf)

Needed for building packages:

* zip         : compressor-archiver


gcc
===

DOS            : DJGPP     : http://www.delorie.com/djgpp/
Windows        : MinGW     : http://www.mingw.org/
Windows 64 bit : MinGW-w64 : http://mingw-w64.sourceforge.net/
OS/2           : EMX       :

MinGW-w64 provides a cross-compiler that you can run on 32 bit Windows.
MinGW-w64 can produce programs for 32 and 64 bit Windows.


sh
==

A POSIX type shell. A copy of Bash or Zsh will do.

GNU make may not work as expected if you don't have a proper shell installed.
You can choose a shell for GNU Make by setting the environment variable SHELL.
See also the GNU make manual:

http://www.gnu.org/software/make/manual/make.html#Choosing-the-Shell

DJGPP     : Includes bash
MinGW     : Includes bash in the MSYS environment.
MinGW-w64 : You can use MinGW's MSYS

In DJGPP it is certain that you get problems if you don't make the SHELL
variable point to bash (c:/djgpp/bin/bash.exe).


make, coreutils
===============

make and coreutils can be found as packages on the web site of the gcc compiler.

Coreutiles is needed for `chmod', `install', `mkdir', `mv', `rm', and `uname'.
install   : copy files and set their attributes (part of GNU `coreutils' package).

For DJGPP compiler use package `fileutils' instead of `coreutils'. Coreutils is
not (yet) available for DJGPP.

DJGPP     : http://www.delorie.com/pub/djgpp/current/v2gnu/
MinGW     : http://sourceforge.net/projects/mingw/files/

For MinGW(-w64) use MSYS-make in the MSYS environment.


perl
====

Perl packages are distributed with the DJGPP, MinGW, and EMX environment.

DJGPP     : http://www.delorie.com/pub/djgpp/current/v2gnu/
MinGW     : http://sourceforge.net/projects/mingw/files/


gettext (libintl) and libiconv
==============================

gettext and libiconv can be found as packages on the web site of the gcc compiler.

DJGPP     : http://www.delorie.com/pub/djgpp/current/v2gnu/
MinGW     : http://sourceforge.net/projects/mingw/files/
MinGW-w64 : http://sourceforge.net/projects/mingw-w64/files/


Until wcd version 5.1.1 I used GnuWin32's gettext/libiconv instead of MinGW's,
because the GnuWin32 port of libintl (part of gettext) has builtin relocation
support. From wcd version 5.1.2 I use MinGW's gettext/libiconv. Wcd win32
binaries are packed with a patched version of MinGW's libintl-8.dll that also
supports relocation. See also http://waterlan.home.xs4all.nl/libintl.html and
http://sourceforge.net/tracker/?func=detail&atid=302435&aid=3003879&group_id=2435

MinGW-w64 may not have all packages available yet.


PDCurses
========

To build wcd with PDCurses interface you need to have the PDCurses
library installed. Get PDCurses at http://sourceforge.net/projects/pdcurses/
Compile it and copy the library file into the \lib directory of your
compiler and the curses.h file in the \include directory.

The DJGPP and MinGW project also provide ready-to-use binary PDCurses packages.


groff and ghostscript
==========================

These packages are needed if you want to create PostScript and PDF versions of
the wcd manual page.

The manual pages are included in the wcd DOS source package, not in the Unix
source package.

Groff and ghostscript are available in the Cygwin environment (http://cygwin.com).


Problems on Windows VISTA/7
===========================

To be able to run `gmake install' you may need adminstrator rights. You can get
a Command Prompt with administrator rights if you right click on the Command
Prompt icon and select `run as administrator'.


Basic Installation
==================

dos32    : DOS 32 bit
dos32bsh : DOS 32 bit for BASH
win32    : Windows 32 bit console version.
win32zsh : Windows 32 bit MSYS and ZSH version.
win32psh : Windows 32 bit PowerShell version.
win64    : Windows 64 bit console version.
win64psh : Windows 64 bit PowerShell version.
msys     : Native MSYS version.
os2      : OS/2 32 bit console version.

Change to the appropriate directory `dos32', `dos32bsh', `win32',
`win32zsh', `win32psh', 'msys', 'os2'.


Build wcd:

  Type `make' to compile the package.

Install wcd:

  Type `make install' to install the package.

  `make install' will also compile the package if it wasn't done yet.

To start clean:

  Type `make clean'


Native Language Support (NLS)
=============================

NLS is by default enabled. To disable reset the ENABLE_NLS variable:

  make ENABLE_NLS=


Curses interface
================

The default interface is curses.

win32* uses PDCurses with wide character support (CURSES=pdcursesw)
OS/2 uses NCurses (CURSES=ncurses)

To disable CURSES and compile with stdio interface, reset the CURSES variable:

  make CURSES=


Graphical tree
==============

By default the graphical tree is drawn with line drawing
characters. If these are not available on your system you
can set ASCII_TREE=1 so that ASCII characters are used instead.

  make ASCII_TREE=1



Conio interface (DOS only)
==========================

To enable the conio interface instead of curses add CONIO=1:


  make CONIO=1


Unicode support
===============

To activate Unicode support add UCS=1 to the make command:

  make UCS=1

This requires a (pd/n)curses installation with wide character support.
Not supported for DOS versions of wcd.

Unicode is only supported in Windows PowerShell, and Command Prompt
on Windows 7 or higher.


Enable Unicode normalization with UNINORM=1. This implies UCS=1.

  make UNINORM=1


Unicode normalization requires libunistring, see
  http://www.gnu.org/s/libunistring/
  http://en.wikipedia.org/wiki/Unicode_normalization

  Get libunistring packages via
  http://waterlan.home.xs4all.nl/libunistring.html

Installation Names
==================

By default `make install' will install the program in /usr/bin, the
language files in /usr/share/locale and the man file in
/usr/share/man. You can specify an installation prefix other than
`/usr' by giving `make' the option `prefix=PATH'.


Example:

  make clean
  make prefix=c:/Users/waterlan
  make install prefix=c:/Users/waterlan


dos32    : The default PREFIX is c:/dos32
dos32bsh : The default PREFIX is c:/dos32
win32    : The default PREFIX is c:/usr/local
win32zsh : The default PREFIX is c:/usr/local
win32psh : The default PREFIX is c:/usr/local
win64    : The default PREFIX is c:/usr/local64
win64psh : The default PREFIX is c:/usr/local64
msys     : The default PREFIX is /usr
os2      : The default PREFIX is c:/usr


distribution package
====================

After installation a ready-to-run binary distribution package can be created.

  Type `make dist' to create the package.

