		   HOW TO BUILD ARDOUR FROM SOURCE
                   -------------------------------

Please: before you do anything else, take a moment to go and join the
ardour-dev mailing list (members only).  It is very important that the
community of people using, testing and developing this software are on
the list, and I will NOT deal with questions relating to Ardour's
compilation or bugs that are not sent to that list.  See
http://ardour.org/ for details on joining the mailing list.
You can also get in touch with developers and users by joining
#ardour at irc.freenode.net. The core developers and several key users
hang out here on IRC, at pretty much any hour of the night or day. 

This document is written for an audience that is familiar with
compiling software that uses the GNU automake/autoconf system.  If you
are not, you should probably wait till binary releases of Ardour
emerge. 

1) GNU AUTOCONF RATIONALIZATION
-------------------------------
 
GNU autoconf is a clever system, but it has at least one major flaw.
By default, autoconf (actually, aclocal) looks in only ONE directory
for files that it needs.  That might be OK, except that when other
software packages are installed, they sometimes put their autoconf
files in /usr/local/lib/share/aclocal and sometimes in
/usr/lib/share/aclocal.

As a result, autoconf often cannot find the files it needs to build
Ardour, since many people have a mixture of libraries installed from
source (autoconf files typically ended up in /usr/local/lib...) and from
pre-built packages (autoconf files typically ended up on /usr/lib...).

The recommended way to tell autoconf where your aclocal directories are is to
define ACLOCAL_FLAGS to include the additional search directories.
First try to find all your aclocal directories:
 $ locate /aclocal/
and check for all the different aclocal directories with ".m4" files. Then
define the environment variable ACLOCAL_FLAGS like this (example only):

 export ACLOCAL_FLAGS="-I /usr/share/aclocal -I /usr/local/share/aclocal -I /opt/gnome/share/aclocal"

You can add this to your .bashrc or .profile file in your home directory, so it gets
executed everytime you login.  

-----
An uglier and more indelicate approach is described below, which merges all
your aclocal directories.  This is no longer recommended, but it will also
work.

Please check the contents of both directories before
doing this "merge" so that you don't accidentally wipe out the correct
version of a duplicated autoconf file:

 * If you have both directories:

    cd /usr/lib/share/aclocal
    cp *.m4 /usr/local/lib/share/aclocal
    cd ..
    rm -rf aclocal
    ln -s /usr/local/lib/share/aclocal .

 * If you have only /usr/lib/share/aclocal

    cd /usr/local/lib
    ln -s /usr/lib/share/aclocal .

Some distributions have aclocal in a different place.  YMMV. 


2. COMPILING
------------

Please ensure that before attempting to compile Ardour, you have
installed:

* Tools:

       gcc/g++ 3.x or above
       autoconf 2.52 or above
       automake 1.7 or above
       libtool 1.4.2 or above
	   gettext 0.11.5 or above
       pkgconfig 0.8.0 or above 
	   		http://www.freedesktop.org/software/pkgconfig/
	   
	   lex and yacc are also required.
	   		any verison of bison >= 1.35 should work fine.

* Libraries:

Recommended versions, where applicable, are shown under the general
requirement. 

       ALSA 0.9.X (CVS or snapshot release) (http://www.alsa-project.org)

       JACK 0.99.50 (CVS or snapshot release) (http://jackit.sourceforge.net)

       libxml2 2.5.X (http://xmlsoft.org/)

       libart_lgpl 2.3.X

       - available as part of gnome-libs, which you may already
	     have on your system.

	   - also available via download from GNOME source FTP sites.
	   - see ftp://ftp.gnome.org/pub/GNOME/MIRRORS.html
	      and then follow to sources/libart_lgpl
	    
       glib 1.2   (http://www.gtk.org)
	glib-1.2.8 (included with most distributions)

       GTK+ 1.2   (http://www.gtk.org)
	gtk+-1.2.8 (included with most distributions)

       libsndfile (http://www.mega-nerd.com/libsndfile/)
	libsndfile-1.0 or higher

       libsamplerate (http://www.mega-nerd.com/SRC/)
         libsamplerate 0.0.13 or higher

       the LADSPA SDK (http://www.ladspa.org/)
	(See below)

       raptor (http://librdf.org/raptor/)

       lrdf  (needs raptor) (http://plugin.org.uk/lrdf/)
         liblrdf 0.3.1 or higher

Getting LADSPA
---------------

The Linux Audio Developers Simple Plugin API (LADSPA) really only
consists of a header file, which is already included in the Ardour
source tree.

However, you may want the plugins that come the "full" LADSPA "SDK",
so go ahead and download the whole package (it's not big) from
www.ladspa.org. 

I would also recommend getting Steve Harris' excellent set of LADSPA
plugins from http://plugin.org.uk/.  They make Ardour into a truly
useful application.  Other LADSPA plugins will be appearing - be sure
to watch the Linux Audio Development mailing list for announcements.

2A) COMPILING FROM CVS
---------------------

Checkout the source from Ardour CVS (the `%' here is meant to be your
shell prompt):

% cd /usr/local/src    # just an example, it can be anywhere
% cvs -d:pserver:anoncvs@ardour.org:/cvsroot/ardour login
                       # you will need to contact 
                       # paul at linuxaudiosystems dot com
                       # to get the passphrase. See
                       # http://ardour.org/download.html
                       # for details on why this is.
% cvs -d:pserver:anoncvs@ardour.org:/cvsroot/ardour -z3 co ardour

2A.1) WHAT KIND OF CVS BUILD?
-----------------------------
Next, you need to decide whether you are an ardour developer or
user. If you are a developer, it may speed your work to build
libardour as a shared library, thus avoiding a executable relink step
whenever you change the library. If you are a user, this will
only make your life more difficult. So, if you are a developer, do the
following:

   touch ardour/libs/ardour/BUILD_FOR_DEVELOPMENT

This will cause libardour to be built as a shared library. You should
then also use the --enable-development-build when running
configure. 

2A.2) PREPARE THE BUILD SYSTEM
------------------------------

Now build the autoconf/automake files:

% cd ardour
% sh autogen.sh

Now proceed to step 3.

2B) COMPILING FROM A TARBALL
----------------------------

As usual, fetch and unpack the tarball.  The directory it creates,
ardour-<version>, is referred to below as "$AD".

3) HOW TO COMPILE
-----------------

    ./configure  (with any options you might want)
    make
    make install

If you are a developer intending to work on libardour, you may wish to
use the --enable-development-build option, which will dynamically link the
ardour executable and libardour, saving a great deal of time by
avoiding a slow static link every time you change libardour's
implementation. 

If you want to build ardour so that it can be debugged, you may wish
to use the --disable-optimize option. Without it, ardour is built with
extreme optimization turned on and the result cannot be debugged
effectively. 

As usual with configure scripts, if you don't want the installation to
happen in the "usual place", add a --prefix option to ./configure. You
may want to set --sysconfdir as well, since "make install" will
attempt to put in a location based on this.

Compilation takes a while.  Running with make -j3 on a dual PII-450,
the entire build takes about 20 minutes.


