# Appendix D - Compiling HTMLDOC from Source

This chapter describes the steps needed to install HTMLDOC on your system from the source distributions.

## Requirements

HTMLDOC requires ANSI C and C++ compilers - recent versions of GCC/EGCS work fine. To build the GUI you'll also need:

- Fast Light Tool Kit ("FLTK"), version 1.1 or higher.
- X11 libraries, R5 or higher (needed to build under UNIX and OS/2 only.)

Secure (https) URL support can be enabled via the OpenSSL library. You should use at least version 0.9.6l.

## Compiling under UNIX/Linux

HTMLDOC uses a configuration script produced by GNU autoconf to configure itself for your system. If your ANSI C compiler is not called cc or gcc, set the `CC` environment variable to the name and path of your ANSI C compiler:

        % setenv CC /path/to/compiler ENTER         [C Shell]
        % CC=/path/to/compiler; export CC ENTER     [Bourne/Korn Shell]

Similarly, if your C++ compiler is not called CC, gcc, c++, or g++, set the `CXX` environment variable to the name and path of your C++ compiler:

        % setenv CXX /path/to/compiler ENTER        [C Shell]
        % CXX=/path/to/compiler; export CXX ENTER   [Bourne/Korn Shell]

Then run the following command to configure HTMLDOC for installation in the default directories:

        % ./configure ENTER

The default configuration will install HTMLDOC in the /usr/bin directory with the data files under /usr/share/htmldoc and the documentation and on-line help under /usr/share/doc/htmldoc. Use the `--prefix` option to change the installation prefix to a different directory such as /usr/local:

        % ./configure --prefix=/usr/local ENTER

If the OpenSSL library is not installed in a standard location for your compilers, use the `--with-openssl-includes` and `--with-openssl-libs` options to point to the OpenSSL library:

        % ./configure --with-openssl-libs=/path/to/openssl/lib \
            --with-openssl-includes=/path/to/openssl ENTER

HTMLDOC is built from a Makefile in the distribution's main directory. Simply run the "make" command to build HTMLDOC:

        % make ENTER

If you get any fatal errors, please report them on the `htmldoc.general` newsgroup at:

        http://www.easysw.com/newsgroups.php

Please note the version of HTMLDOC that you are using as well as any pertinent system information such as the operating system, OS version, compiler, and so forth. Omitting this information may delay or prevent a solution to your problem.

Once you have compiled the software successfully, you may install HTMLDOC by running the following command:

        % make install ENTER

If you are installing in a restricted directory like /usr then you'll need to be logged in as root.

## Compiling on Windows Using Visual C++

A Visual C++ 6.0 workspace file and associated project files are included in the source distribution under the "visualc" directory. Open the workspace file "htmldoc.dsw", adjust the FLTK include and project file locations, and then build the HTMLDOC target.

Note: You also need to download the OpenSSL and FLTK libraries in order to compile HTMLDOC with Visual C++.

## Installing with Visual C++

To install HTMLDOC with Visual C++, create an installation directory and copy the ghtmldoc.exe and htmldoc.exe executables, the afm directoryj, the data directory, and the doc directory to it.

Then use the regedit program to create the following two string entries:

`HKEY_LOCAL_MACHINE\Software\Easy Software Products\HTMLDOC\data`
  C:\installation\directory
`HKEY_LOCAL_MACHINE\Software\Easy Software Products\HTMLDOC\doc`
  C:\installation\directory\doc