Kerrighed - Installation notes
==============================

This is a brief document about Kerrighed Installation.
For more complete informations, please refer to the online documentation:
http://kerrighed.org/wiki/index.php/UserDoc

Table of contents
=================

1/ Pre-requisites
2/ Quick install
3/ Detailed configuration
3.1/ Generic configure options
3.2/ Installation Names
3.3/ Operation Controls
3.4/ Configure the whole distribution
3.5/ Configure libs
3.6/ Configure tools
3.7/ Configure tests
3.8/ Build from outside of source dir

1/ Pre-requisites
=================

   Kerrighed requires the following to be built and installed:

- automake      : version >= 1.9
- autoconf      : version >= 2.59
- Various standard tools: 
		libtool, pkg-config, awk (GNU awk is preferred), bzip2, rsync
- gcc           : 3.3.x is the recommended compiler for Linux Kernel. 
  		  Kerrighed is reported to build with 4.1 series.
- linux sources : Kerrighed is available for following versions of Linux:
  		  - 2.6.20

   Optional features requires the following:

- lsb_release	: to install Kerrighed startup scripts into /etc/init.d
- xmlto         : a tool to create manpages from docbook

   To compile out of source dir, you need the following tools:
- lsdiff
- lndir

2/ Quick install
================

   If you have a compatible Linux source tree in 
`/lib/modules/`uname -r`/source`, type the following in the base 
directory of the Kerrighed distribution:

	  % ./configure
	  % make kernel
	  % make
	  % make kernel-install
	  % make install

3/ Detailed configuration
=========================

   Kerrighed is made of several parts which can be built and installed
independently:

- kernel patch
- kernel module
- libs
- tools
- tests

3.1/ Generic configure options
==============================

   The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation.  It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions.  Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').

   If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release.  If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.

   The file `configure.in' is used to create `configure' by a program
called `autoconf'.  You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.

3.2/ Installation Names
=======================

   By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc.  You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.

3.3/ Operation Controls
=======================

   `configure' recognizes the following options to control how it
operates.

`--cache-file=FILE'
     Use and save the results of the tests in FILE instead of
     `./config.cache'.  Set FILE to `/dev/null' to disable caching, for
     debugging `configure'.

`--help'
     Print a summary of the options to `configure', and exit.

`--quiet'
`--silent'
`-q'
     Do not print messages saying which checks are being made.

`--srcdir=DIR'
     Look for the package's source code in directory DIR.  Usually
     `configure' can determine that directory automatically.

`--version'
     Print the version of Autoconf used to generate the `configure'
     script, and exit.

3.4/ Configure the whole distribution
=====================================

   Following options can be passed to the toplevel configure script:

  --disable-linux-check   Check for the Linux sources to be compatible with
                          Kerrighed (!!! disable at your own risk !!!)
                          [default=enable]
  --disable-module        Patch the kernel with Kerrighed and build the module
                          [default=enable]
  --disable-libkerrighed  Disable libkerrighed [default=enable]
  --disable-libkrgthread  Disable libkrgthread [default=enable]
  --disable-tools         Disable tools [default=enable]
  --disable-service       Do not install kerrighed service [default: enable if
                          lsb found]
  --disable-tests         Disable tests [default=enable]

  --with-kernel=PATH      Path to kernel source [default=/lib/modules/`uname
                          -r`/source]
  --with-kernel-config=PATH
                          Path to a kernel .config file. Sample files are
                          provided in 'samples' directory.

3.5/ Configure libs
===================

   Following options can be passed to the libs configure script:

  --enable-libkerrighed   Enable libkerrighed [default=enable]
  --with-kernel=PATH      Path to kernel kernel source
                          [default=/lib/modules/`uname -r`/source]
  --with-kerrighed=PATH   Path to Kerrighed module headers
                          [default=../kerrighed]

3.6/ Configure tools
====================

   Following options can be passed to the tools configure script:

  --enable-external-kerrighed
                          Compile with external libkerrighed [default: use
                          internal if present]
  --disable-service       Do not install kerrighed service [default: enable]

3.7/ Configure tests
====================

   Following options can be passed to the tests configure script:

  --enable-external-kerrighed
                          Compile with external libkerrighed [default: use
                          internal if present]
  --disable-ktp           Disable 'ktp' part [default: enable]
  --disable-apps          Disable 'apps' part [default: enable]
  --disable-proc          Disable 'proc' part [default: enable]

3.8/ Build from outside of source tree
======================================

   Compilation and installation can be done from outside of source dir.
 Just create a new directory where you want to build and cd into it. Call
 configure script from this dir.
 All make targets can be used as usual.