
                         Yorick installation mini-howto

                              by Eric Thibaut


This file explains how to build and install Yorick (version 1.5 or 1.6)
for various architectures and with optimizations (by default, Yorick
configuration script uses only '-O').

I assume you are using a Bourne-like shell.

Define the following variables and _customize_ them to match your needs:

  VERSION=1.6.02
  SHORT_VERSION=1.6
  OPTIM='-Wall -O2 -fomit-frame-pointer -fexpensive-optimizations -ffast-math -finline-functions -march=pentium4'
  ARCH=cygwin-pentium4

obvioulsy VERSION is the full Yorick version, SHORT_VERSION is Yorick's
version whitout the patchlevel, ARCH is the architecture of your machine
(anything you like, mostly used to avoid confusing different builds) OPTIM
are the optimization flags (to be used instead of the default '-O').

Now you have to decide where to install Yorick.  You have several choices:

  - installation into predefined directories

  - installation into relocatable directories

The only drawback of using the relocatable directories is that it requires
to install every Yorick files under a single (relocatable) directory
whereas if you use predefined installation directories, you can install
architecture dependent files and architecture independent files into
different directories (Y_HOME and Y_SITE respectively).  This is mainly a
disk space issue; but since Yorick's architecture independent files make
hardly more than 3 Mb, you can put everythings under a single directory for
every architecture without wasting to much space or use symbolic links.

My advice is that it is usually more convenient to use the 'relocatable'
scheme; that way you can pre-compile Yorick with no a priori about the
installation directories.

Whatever installation scheme you want to use, you must unpack Yorick's
archive:

  rm -rf yorick-${SHORT_VERSION}
  gzip -dc < yorick-${VERSION}.tgz | tar xvf - 
  cd yorick-${SHORT_VERSION}

The apply one of the following installation methods.


How to install all Yorick files under predefined directories
------------------------------------------------------------

First define variable Y_SITE as the directory name under which all
architecture independent files (i.e. documentation and script files) will
be installed and Y_HOME for architecture dependent files (executables,
binary libraries, ...).  For instance:

  Y_HOME=/usr/local/lib/yorick-${VERSION}
  Y_SITE=/usr/local/share/yorick-${VERSION}

Note that Y_SITE and Y_HOME must be _absolute_ paths (i.e. must start
with a /); also note that you can use the same path for Y_SITE and Y_HOME.

Then tell Yorick where you want to install it and run the
auto-configuration scripts:

  make Y_HOME=${Y_HOME} Y_SITE=${Y_SITE} ysite
  make config

Edit the file 'Make.cgf' to enable optimizations or tune configuration.  If
you have defined the OPTIM variable (as explained before), you can just do
for Yorick 1.6:

  sed <Make.cfg >Make.cfg.new "s|^ *COPT_DEFAULT *=.*|COPT_DEFAULT=$OPTIM|"
  mv -f Make.cfg.new Make.cfg

or for Yorick 1.5:

  sed <Make.cfg >Make.cfg.new "s|^ *COPTIONS *=.*|COPTIONS=$OPTIM|"
  mv -f Make.cfg.new Make.cfg

Then build and install Yorick:

  make
  make install

You can use Yorick where it is installed.  But before removing the
source and build directory of Yorick, you may want to fix/complete 
the installation by the following commands:

  cp -p play/libplay.a $Y_HOME/lib/.
  cp -p gist/libgist.a $Y_HOME/lib/.
  chmod 644 $Y_HOME/include/*.h
  mkdir -p $Y_SITE/contrib
  gzip -9f $Y_SITE/doc/*.ps
  mv $Y_SITE/doc/README $Y_SITE/doc/CONTENTS
  cp -p LEGAL NEWS README TODO VERSION $Y_SITE/doc/.
  cp -p gist/README $Y_SITE/doc/README.gist
  cp -p play/README $Y_SITE/doc/README.play
  mkdir -p $Y_SITE/emacs
  cp -p emacs/* $Y_SITE/emacs/.
  emacs --batch $Y_SITE/emacs/yorick.el -f emacs-lisp-byte-compile


How to install all Yorick files under a relocatable directory
-------------------------------------------------------------

This part explains how to build an (optimized) relocatable version of
Yorick (after having unpacked the source archive).

Then tell Yorick you want to install it under a relocatable directory and
run auto-configuration scripts:

  make Y_HOME=relocate ysite
  make config

Edit the file 'Make.cgf' to enable optimizations or tune configuration.  If
you have defined the OPTIM variable (as explained before), and if you are
installing Yorick-1.6, you can just do:

  sed <Make.cfg >Make.cfg.new "s|^ *COPT_DEFAULT *=.*|COPT_DEFAULT=$OPTIM|"
  mv -f Make.cfg.new Make.cfg

For yorick-1.5, the commands are:

  sed <Make.cfg >Make.cfg.new "s|^ *COPTIONS *=.*|COPTIONS=$OPTIM|"
  mv -f Make.cfg.new Make.cfg
  

Then build Yorick and install everythings in './relocate':

  make
  make install

Then fix/complete contents of './relocate' directory:

  cp -p install.rel relocate/README
  cp -p play/libplay.a relocate/lib/.
  cp -p gist/libgist.a relocate/lib/.
  chmod 644 relocate/include/*.h
  mkdir -p relocate/contrib
  gzip -9f relocate/doc/*.ps
  mv relocate/doc/README relocate/doc/CONTENTS
  cp -p LEGAL NEWS README TODO VERSION relocate/doc/.
  cp -p gist/README relocate/doc/README.gist
  cp -p play/README relocate/doc/README.play
  mkdir -p relocate/emacs
  cp -p emacs/* relocate/emacs/.
  emacs --batch relocate/emacs/yorick.el -f emacs-lisp-byte-compile

Now you can move the directory 'relocate' to where you want (you may also
change its name) and directly use the executable 'yorick' into the
subdirectory 'bin'.

You can also pack the contents of 'relocate' into an archive for further
installation.  The following commands will rename and archive './relocate'
directory:

  mv relocate yorick-${VERSION}
  tar cvf - yorick-${VERSION} | gzip -9 > ../yorick-${VERSION}-${ARCH}.tar.gz
  rm -rf yorick-${VERSION}

