Go to the first, previous, next, last section, table of contents.


Configure

Nana uses a standard GNU autoconf generated configure script. The configure script checks the setup on your machine and then generates the appropriate Makefiles. Some of the things checked by configure include:

  1. Which compiler, compiler flags and libraries to use, e.g. you might need to include a -lposix flag to the linker to build programs on your machine.
  2. Which header (.h) files are available on this machine, e.g. is unistd.h available on this machine.
  3. Where to install programs, header file, man pages, etc.

In addition `configure' uses the host architecture and operating system to generate the `nana-config.h' file. This file contains some macro definitions which define how nana works on particular operating systems and hardware architectures.

For example on `i386' machines we would use the `asm("hlt")' instruction whenever an assertion fails, on a `sparc' we would use `asm("stp")'. Otherwise we would default to a plain C call to `abort()' If `configure' does not recognise your machine it uses plain C code.

You may wish to change these defaults on installation, one method is to edit a local copy of the `nana-config.h' file. Alternately you can define the code yourself in the call to `configure'. For example to redefine the action we take when an error is detected by the I macro we can use:

I_DEFAULT_HANDLER="restart_system()" ./configure

As well as simple calls to routines various other bits of information are passed off to the `I_DEFAULT_HANDLER' such as the expression that failure and a failure code. For example:

% I_DEFAULT_HANDLER="restart(line,file,param)" ./configure

The default for `I_DEFAULT_HANDLER' calls a function which prints a message and then dumps core. Different behaviour on failure can be organised by setting the `I_DEFAULT' to `fast', i.e. plain core dump or `verbose' which prints an error messsage and then does the core dump.

% I_DEFAULT=fast ./configure   

For nana the following examples may be useful:

  1. ./configure Accept the default values for everything. In particular the files will be installed in: `/usr/local/{bin,include,lib,man,info}'
  2. ./configure --prefix=~project/tools Install the files into: `~project/tools/{bin,include,lib,man,info}'
  3. ./configure --bindir=~project/bin --libdir=~/project/lib \
    --includedir=~/project/headers --infodir=/usr/local/info \
    --mandir=~/project/doc
    The install directory for program (`bin'), etc can all be set with command line arguments to`configure'.
  4. CC=xacc LIBS=-lposix ./configure sun3 If the defaults chosen by `configure' are not correct you can override them by setting variables such as CC before calling `configure'. The `sun3' argument is used to identify the machine we are running on and may be necessary on some machines.
  5. ./configure --help And of course when in doubt ask for help.

For even more details see the file `INSTALL.con' which contains the generic instructions for use with `autoconf' generated `configure' scripts.


Go to the first, previous, next, last section, table of contents.