Next: Variables, Previous: Optional Software, Up: Installation
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:
-lposix
flag to the linker to build programs
on your machine.
unistd.h
available on this machine.
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("unimp")’. 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:
./configure
Accept the default values for everything. In particular the files will be installed in:
./configure --prefix=~project/tools
Install the files into:
./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’.
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.
./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.