PREREQUISITES

        Required
            * gcc       : GNU C compiler
            * make      : GNU make
            * sh        : POSIX type shell
            * coreutils : GNU core utilities package (chmod, install, mkdir, mv, rm, uname)
            * sed       : Stream editor

        Optional (depending on build targets):
            * perl         : Practical Extraction and Report Language (perlpod)
                             perl >= 5.10.1 is required for rebuilding the
                             manual pages with pod2man.
                             perl >= 5.18 is required for rebuilding the
                             international manual pages correctly in HTML with pod2html.
            * gettext      : Framework to help GNU packages produce multi-lingual messages.
            * po4a         : PO for anything.
            * ncurses      : CRT screen handling and optimization package.
            * libunistring : Library with functions for manipulating Unicode strings.
            * groff        : GNU troff text formatting system.
            * ghostscript  : An interpreter for the PostScript language and for PDF (ps2pdf)

        Check if you have GNU make(1) and GNU gcc(1) installed on your
        system. On some systems GNU make may be installed as 'gmake' command.

            make --version
            gcc --version


BASIC INSTALLATION

        Change to directory src/

        To compile using GNU make:

            make all

        Options that can be enabled during compiling

            UCS=        Disable Unicode (UTF8) support
                        The default value is 1.

            UNINORM=1   Enable Unicode normalization.
                        The default value is empty.
                        On Cygwin the default value is 1.
                        Requires libunistring, see
                        https://www.gnu.org/s/libunistring/
                        https://en.wikipedia.org/wiki/Unicode_normalization

            ENABLE_NLS=1
                        Enable native language support.
                        That is, use locale files.
                        The default value is 1.

            STATIC=1    Enable static linking. Make a
                        standalone wcd binary.
                        The default value is empty.

            DEBUG=1     A debug enabled build can be made by
                        adding DEBUG=1 to the make command.

            DEBUGMSG=1  DEBUGMSG=1 makes wcd print verbose messages
                        about accessing the file system.

            LFS=
                        Large File Support (LFS) is by default enabled. This
                        enables the use of 64 bit file system interface on 32
                        bit systems.  This makes it possible to open files
                        larger than 2GB on 32 bit systems, provided the OS
                        has LFS support builtin. To disable LFS make the LFS
                        variable empty. Example:

                        Disable LFS:
                        make clean install LFS=

            CURSES=<curses|ncurses|ncursesw|pdcurses>

                        Select curses library.
                        The default value is 'ncurses'.
                        Only an expert should change this.

            NCURSES_DEBUG=1
                        Link with ncurses debug enabled library by
                        adding NCURSES_DEBUG=1 to the make command.

            ASCII_TREE=1
                        Draw graphical tree with
                        ASCII characters.
                        The default value is empty.

            EXT=.exe    Set executable extension
                        The default value is '.exe' to
                        make a distinction between the binary
                        and the function/alias.

            HMTLEXT=html
                        Set HTML manual file extension.
                        The default value is 'htm' to
                        support all platforms.

        An example to disable unicode support.

            make clean all UCS=

        To disable Native Language Support,
        reset the ENABLE_NLS variable:

            make ENABLE_NLS=

        To disable curses and compile with plain stdin/stdout
        interface type, reset the CURSES variable:

            make CURSES=

        To install:

            make all strip install

        Now go to section SHELL INTEGRATION below.

INSTALLATION NAMES

        By default the 'install' target will install the program in
        /usr/bin, the language files in /usr/share/locale
        and the man page in /usr/share/man. You can specify an
        installation prefix other than /usr by modifying the
        'prefix' variable. An Example:

            make prefix=$HOME clean all
            make prefix=$HOME strip install

SHELL INTEGRATION

        See manual page section "INSTALLATION" how to manually configure the
        shell to use the program.  It is required to configure your shell,
        otherwise wcd cannot work.

        Alternatively you can use the shell scripts that are provided to
        install the wcd function (sh) or alias (csh) under /etc/profile.d/.
        To install these scripts type:

            make install-profile

        If you wish that Wcd stores its files under $HOME/.wcd instead of
        $HOME, add DOTWCD=1. This will add a definition of WCDHOME=$HOME/.wcd
        (see manual).

            make install-profile DOTWCD=1

        Under Cygwin these shell scripts are always installed.


INTERNATIONAL MAN PAGES

    All man pages are encoded in UTF-8, because even Western-European man pages
    may contain Unicode characters not supported by the Latin-1 (ISO-8859-1)
    character set.

    Originally the Unix man system supported only man pages in Latin1 format.
    Although the world is moving to Unicode format (UTF-8) there is still a lot
    of Latin1 legacy around.

    The English man page is a pure ASCII file and is readable on all platforms.

    Non-English man pages are encoded in UTF-8. These do not show properly on
    old systems.  Man pages in UTF-8 format are shown properly on Linux. Not
    all roff implementations support UTF-8.

    In order to show UTF-8 man pages properly on Cygwin you need to do the
    following when you use classic man:

    In /etc/man.conf, change the NROFF definition to use 'preconv'.

        NROFF        /usr/bin/preconv | /usr/bin/nroff -c -mandoc 2>/dev/null

    To view the man page set the correct locale. E.g. for Ukrainian:

        export LANG=uk_UA.UTF-8
        man dos2unix

    When you use man-db all pages are shown correctly automatically.

DOCUMENTATION

    Manual pages are generated from Perl POD files.
    To rebuild the man pages from POD type:

        make maintainer-clean
        make man

    Manuals in PDF format are by default not created.
    To create manuals in PDF format type:

        make pdf

    PDF generation requires GhostScript to be installed.


BINARY DISTRIBUTION PACKAGE CREATION

        After installation, a package can be created that contains
        a ready-to-run wcd binary.

          Type `make dist' to create a .tar.gz file.

          Type `make dist-zip' to create a .zip file.


PORTABILITY


        A compile error occurs when you use gcc < 3.0 and
        <stdbool.h> is included somewhere (e.g. in curses.h).

        Thanks to Kevin M. Rosenberg, apply the following patch:

            patch -p1 < patch/wcd_bool.diff

        --

        Conflicting curses.h ncurses.h

        On some systems curses.h is conflicting with ncurses.h. To
        compile wcd you can solve this by creating a symbolic link
        curses.h in the wcd source directory pointing to the ncurses.h
        file and adding -I. to CFLAGS in old/Makefile.ncurses.gcc.

        This problem was seen on a BSDI BSD/OS 4.0 system.
        /usr/local/include/ncurses.h


End of file
