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

Optional:

* perl      : Practical Extraction and Report Language (perlpod)
* 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 : MSYS2     : http://sourceforge.net/projects/msys2/
OS/2    : EMX       :

DJGPP gcc >= 4.6 seems to cause problems. Crashes of gcc itself, or crashing
wcd binaries. Use DJGPP gcc <= 4.5.3.

Wcd compiles with mingw.org and mingw-w64. I recommend using the MSYS2 project.

The MSYS2 project includes the MinGW-w64 compiler <http://mingw-w64.sourceforge.net/>
for both 32 and 64 bit. Plus it includes a complete building environment. A
POSIX shell, and many libraries and utilities.
See also http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/

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-w64 : Use MSYS2

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/
MSYS2     : http://sourceforge.net/projects/msys2/


perl
====

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

DJGPP     : http://www.delorie.com/pub/djgpp/current/v2gnu/
MSYS2     : http://sourceforge.net/projects/msys2/


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/
MSYS2     : http://sourceforge.net/projects/msys2/


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/p/mingw/bugs/1808/

The patch was not accepted by MinGW.org, but the MSYS2 project has included
the patch for both 32 and 64 bit.


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.


Ncurses
=======

You can also build the Windows version of wcd with Ncurses. It is best to take
the most recent version from http://invisible-island.net/ncurses/
See also whatsnew.txt for issues with Ncurses that have been solved.
To compile for ncurses add CURSES=ncursesw to the make command line.

* By default the Ncurses interface does not work in the Console2 console. Set
  environment variable NCURSES_CONSOLE2 to 1 to make it work.
* The ncurses interface shows some trembling while moving around in the tree.
* The ncurses interface has better support for Unicode than PDCurses, because Ncurses
  supports combining characters, while PDCurses doesn't.

Both Ncurses and PDCurses have misalignment at highlighted directory in tree
with true type CJK font, e.g. the Chinese Simsun font. (PDCurses has same
problem.)

Ncurses is still in active development, while PDCurses development is on hold.


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 and higher
====================================

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.
win32psh : Windows 32 bit PowerShell version.
win32zsh : Windows 32 bit MSYS and ZSH version.
win64    : Windows 64 bit console version.
win64psh : Windows 64 bit PowerShell version.
win64zsh : Windows 64 bit MSYS and ZSH version.
msys     : Native MSYS version.
msys2    : Native MSYS2 version.
os2      : OS/2 32 bit console version.

Change to the appropriate directory `dos32', `dos32bsh', `win32', `win32psh',
`win32zsh', `win64', `win64psh', `win64zsh', 'msys', 'msys2', '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* and win64* 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
===============

Unicode support is by default enabled on Windows and disabled on DOS
and OS/2. To disable add UCS= to the make command:

  make UCS=

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

Unicode works only in Windows PowerShell, and Command Prompt
on Windows 7 or higher. On older versions of Windows you need
Take Command or TCC/LE made by JP Software be able to change to
Unicode paths.


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
win32psh : The default PREFIX is c:/usr/local
win32zsh : The default PREFIX is c:/usr/local
win64    : The default PREFIX is c:/usr/local64
win64psh : The default PREFIX is c:/usr/local64
win64zsh : The default PREFIX is c:/usr/local64
msys     : The default PREFIX is /usr
msys2    : 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.

