
Simple end user installation:
=============================
$ tar xzf matcompat.tar.gz
$ cd matcompat
$ make
$ make install path=~/matcompat

Remove anything from ~/matcompat/FIXES that are superceded by recent versions
of Octave.

Add the following to ~/.octaverc:

    LOADPATH = [ getenv("HOME"), "/matcompat//:", LOADPATH ];
    EXEC_PATH = [ getenv("HOME"), "/matcompat/bin:", EXEC_PATH ];

Simple system installation:
===========================
$ tar xzf matcompat.tar.gz
$ cd matcompat
$ make
$ su
root$ cd .../matcompat
root$ make install

Remove anything from ~/matcompat/FIXES that are superceded by recent versions
of Octave.

Details:
========
Unpack the archive using
	$ tar xzf matcompat.tar.gz
or if you are not using GNU tar
	$ gunzip -c matcompat.tar.gz | tar xf -
Then change to the matcompat directory
	$ cd matcompat

Next build the oct-files:
	$ make MKOCTFILE=mkoctfile XFLAGS="-L/usr/X11R6/lib -lX11"

Normally, you will not have to specify mkoctfile, but if you are
maintaining two versions of octave, you may have something like
mkoctfile-2.0.16.91 and mkoctfile-2.1.33 instead.

There are as of this writing two functions which require X11.  If these
fail to compile (e.g., because the libraries or headers are unavailable)
then you can specify the appropriate linkage information with XFLAGS.
If you set XFLAGS= , then make will skip the X11-based functions.

After compiling, install the m-files, oct-files, data files and
executables.  You cannot simply set LOADPATH to matcompat since Octave
2.0 files are mixed with Octave 2.1 files, so you must install.  Use the 
following:

  $ make install path=m-files opath=oct-files xpath=bin MKOCTFILE=mkoctfile

The default path, opath, and xpath are extracted from <octave/defaults.h>
 and will depend on how your version of Octave was built.  Watch the
output of make install to see which paths it uses.  If your system is
set up correctly, you will not need to specify them, and upon install
all the scripts will be available to you.  Note that by default the
scripts are all placed in the version-specific directories of Octave, so
if you upgrade to a new version of Octave, you will need to rebuild
and reinstall matcompat.  Any data files (e.g., scripts/*/data/*) are
installed with the associated m-files.  If path is specified, opath
defaults to $(path)/oct and xpath defaults to $(path)/bin

The need for MKOCTFILE during installation is unexpected, but it makes
sense if you remember that the version number is determined from
mkoctfile and that you need the version number to determine which
m-files to install.  Similarly, it is needed to construct the default
paths.  If you say, for example, path=~/matcompat ver=20, then you will
not need MKOCTFILE.

You may need to point your load and exec paths to the new functions.
If you are installing in a system-wide directory, then update the
octave startup file to set the loadpath. This is usually
   /usr/local/share/octave/<version>/m/startup/octaverc.m
or something similar.  If you are installing as an end user set the
loadpath in your .octaverc file.  Since I'm running two versions of
octave, I use the following:
	HOME = getenv("HOME");
	str2num (split (OCTAVE_VERSION, '.'));
	if all (ans (1:2) == [2;0])
	   LOADPATH = [ HOME, '/matcompat20//:', LOADPATH];
	   EXEC_PATH = [ HOME, '/matcompat20//:', LOADPATH];
	else
	   LOADPATH = [ HOME, '/matcompat21//:', LOADPATH];
	   EXEC_PATH = [ HOME, '/matcompat21//:', LOADPATH];
	endif

Functions which are fixes to m-files distributed with Octave are
included in the directory scripts/FIXES.  If you have a bleeding edge
version of Octave, chances are good that the fixes have already been
incorporated and you can simply delete them from the installed tree
<path>/FIXES.  Or you can leave them in place and live with a
potentially out of date function.  If you find a bug in FIXES, check
if it has been fixed in the latest distribution of Octave before
reporting it.

*** NOTE *** As functions move from matcompat into Octave proper, we
are going to have trouble keeping track of them.  Perhaps if we list
which version of Octave incorporates the fixes, then we can using
octave -v to check if the target installation version already includes
it and customize the installation accordingly.

Sorry, there is no uninstall target.  make install will tell you where
it put things.  Remember it, so you can remove them later when you
upgrade octave or matcompat.

Extras:
=======

The build process does not modify octave itself, but there are a
number of patches included in the directory patches/ which you could
apply to the octave sources by hand.  Many of the patches will have
already been applied if you are using the bleeding-edge octave.  Most
of them will not apply if you are using the 2.0 series.  The chances
are great that the patches will not apply cleanly and even conflict
with each other.  Just get the recent sources and skip the patches,
otherwise good luck to you.  *** NOTE *** It would be nice to separate
patches into those which are known to have been applied (in some form
or another) and those which have been rejected or ignored.

Functions specific to windows are in the directory Windows/.  These
are things like image, which load a different image display program
than the default unix image display programs.  Copy this directory
somewhere and put it ahead of all the Octave system directories in
the LOADPATH.

To build a browsable version of the compatibility database, use:
	$ make HTML/index.html 
This will not be installed anywhere. To make your own version of the 
tar ball, use:
	$ make dist
The tar ball is placed in the parent directory.  To do both, use:
	$ make web
