  This file describes how to compile the editor for UNIX systems using
GNU tools. I personaly use "Debian GNU/Linux" but the code successfuly
compiled for Darwin, FreeBSD, NetBSD, OpenBSD, QNX and Solaris.
Instructions specific for Linux systems can be found in the
doc/install/linux.txt but this instructions are also valid for Linux and
in fact the Linux file refers to this one for the "manual" installation
mechanism.

$Id$

1. INTRODUCTION
2. IMPORTANT NOTE
3. CONFIGURING
4. COMPILING
5. INSTALLING


1. INTRODUCTION

  FreeBSD systems seems to have all the needed GNU tools (GNU/FreeBSD ;-).
FreeBSD details were contributed by Andrew 'Onyx' Shevtsov (miniEleph)
<nyxo@dnuc.polyn.kiae.su>.
  NetBSD and OpenBSD machines that I tested at Source Forge Compile Farm
also have GNU tools available.
  Darwin is the core of MacOS X 10.x, it have some bizarre GNU tools modified
by Apple. So even when Darwin is an *BSD system it is a little bit
complicated. The code included in the 2.0.3 release compiled ok.
  QNX systems are a little bit more problematic but they also contain the
needed tools. QNX details were contributed by Mike Gorchak <mike@malva.ua>.
  Solaris doesn't have all the needed GNU tools so you must get them from
internet. You should get at least make, gcc/g++ and perl, I'm not sure what
else is needed. I have a Solaris 2.7 (Ultra 60 machine) at work with the
needed tools installed. I also succeed using Solaris 9 at Source Forge.
  I failed to compile using Tru64 (OSF1) v5.1b. The installed GNU
tools (from a package identified as TWWfsw with gcc 3.3r) have some major
limitations: 1) The native assembler (as) is wrongly called by gcc and it
gets the code without preprocessing. 2) Complex tree structures as declared
in keyval.cc generates invalid assembler. 3) Pure C++ code that doesn't
include the Standard C++ library headers doesn't compile, libmigdb is an
example. 4) unistd and stdio defines a macro in different way. That's invalid
for C++ code (cusedid or something like this). If these "limitations" are
fixed you'll be able to compile ;-)
  If you are dealing with other UNIX box the first step will be to get the
most common GNU tools used for development and then start trying. Contact me
if you need help or want to contribute changes needed to compile for your
UNIX box.
  For a list of tools and libraries you should have in your system please read
the doc/install/tools.txt file.

2. IMPORTANT NOTE

  I noticed that a lot of UNIX machines that have GNU tools installed are
wrongly configured. Here are some details you must check:

A) The PATH must include the directory where GNU tools are installed. Some
times the tools aren't installed in the same directory. So you have to
double check that all the tools can be started without specifying its full
path. Example (bash):
$ export PATH=$PATH:/usr/local/bin

B) All the support libraries must be in the linker path. This can be
configured at system level or just using the LD_LIBRARY_PATH environment
variable. I saw too much systems where you can't even create a simple C++
program because the libraries aren't in the linker path. Example (bash):
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/opt/TWWfsw/gcc33r/lib

3. CONFIGURING

  The first step is the configuration, this is a Perl script so you must have
Perl in your system:

$ ./configure

  This script will inform you what was found in your system and what wasn't.
If the missing component is vital the script will stop. Read the output of
the script carefuly. Unlike the traditional configure scripts created by GNU
autoconf this script doesn't print useless information (like if your system
have 20 of the string functions needed), so the output is not too big.
  If your system and/or CPU can't be detected please take a look at the
conflib.pl file. The DetectOS function determines the OS using the output of
uname command. The DetectCPU function determines the CPU by actually
compiling a small program with conditionals for all the architectures I
currently tested. If you need to add something there just contact me.
  If the script fails install the missing component and run it again. If
optional components are missing the script will suggest installing them.
  Once you successfuly configured the package you can go to the next step.
  If you want to change any of the default compilation options run:

$ ./configure --help

  It will inform all the available options. The --prefix=... is something you
could want to use.
  If you want to make changes to the code and contribute to the project I
recommend configuring the editor using the same options I use:

$ ./configset

  This enables some maintainance stuff that you'll need for development. The
most important detail are header dependencies.

4. COMPILING

  Just use the make command. If your system must use gmake the configureation
will inform it.
  The makefile have various targets so you can compile the editor, infview
and libset individually. It also contains targets to create the distribution
(distrib) and cleaning (clean).

5. INSTALLING

  Use the install target, you'll most probably need to switch to "root" to
run this step:

# make install

  You can change the destination prefix using:

# make prefix=/path_you_want install

  But I recommend doing it during the configuration step because in this way
the code will search for configuration files in the desired destination and
you won't need to define the SET_FILES environment variable.

