#!/bin/sh
# Verification de l usage
case $# in
0|1|2) echo usage: config nom binaire configuration [tailles]; exit 1;;
*) nom=$1; bin=$2; conf=$3; shift; shift; shift;;
esac
# Le fichier de configuration est-il un path absolu
# ou bien un path relatif
case $conf in
/*) ;;
*) conf=conf/$conf ;;
esac
# Le fichier de configuration est-il la
if test ! -f $conf
then
echo Le fichier $conf n existe pas.
exit 1
fi
DIR=/tmp←mnt/net/chroma/rojo/franchi/CENTAUR/lelisp/v15.22
SYSDIR=/tmp←mnt/net/chroma/rojo/franchi/CENTAUR/lelisp/v15.22/sun4OS4
# Appeler ce script en initialisant eventuellement LLCORE pour
# changer la directory du core
: ${LLCORE=$SYSDIR/llcore/}
case $LLCORE in
*/ ) ;;
* ) LLCORE=$LLCORE/;;
esac
# Creation du script shell de commande
llcmd=/tmp/ll$$
trap "rm -f $llcmd;exit 1" 1 2 3 15
echo exec $SYSDIR/$bin \
$* -r $LLCORE/$nom.core \$\* > $llcmd
chmod +x $llcmd
# Creation de l image memoire
# Pour ne pas charger son .lelisp au moment de creer le core
HOME=qwerty
c=$SYSDIR/config
env - TERM=$TERM FOO="`cat $c $c $c $c $c $c`" $llcmd $DIR/llib/startup.ll <<EOF
(setq #:system:core-directory "$LLCORE")
(setq #:system:name (quote |$nom|))
`cat $conf`
(end)
EOF
cp $llcmd $nom
rm -f $llcmd