#!/bin/sh

TEXSRC="/users/heinz/src/tex/TeX3.14"
TEXDIR=$TEXSRC/tex
WEBDIR=$TEXSRC/web
WEB2CDIR=$TEXSRC/web2c
SISISIDIR="/users/heinz/src/tex/sisisi"

echo
echo "Do not forget to copy the files *.sty and *.tex"
echo "from $SISISIDIR to your TEXINPUTS-Directory."
echo
echo "Press 'q' to interrupt this installation and do it now, <cr> to continue"
read x
if [ "$x" = "q" ]
then
       exit
fi

cd $TEXSRC

( cd $SISISIDIR; uncompress <sitex.web.Z >$TEXDIR/tex.web;\
 cp web2c* $WEB2CDIR; \
 cp tangle.ch $WEBDIR; cp makefile $TEXSRC; cp Makefile ctex.ch $TEXDIR )

make "CC=gcc" TeX
if [ ! -f $TEXDIR/stamp-convert ]
then
       echo "*** SISISI: tex.p not converted. Something's gone wrong. Stop." 1>&2
       exit 1
fi

( cd $SISISIDIR; cp tex6.c texd.h coerce.h $TEXDIR )

make "CC=gcc" TeX
if [ ! -f $TEXDIR/virtex ]
then
       echo "*** SISISI: make failed. Stop." 1>&2
       exit 2
fi

( cd $TEXDIR; mv tex.pool sitex.pool )

make formats
if [ ! -f $TEXSRC/stamp-formats ]
then
       echo "*** SISISI: make formats failed. Stop." 1>&2
       exit 2
fi

echo
echo "SISISI has been successfully compiled, and the format files have been"
echo "generated. Now follow the guidelines from the README file for further"
echo "installation. Do not forget to copy $TEXDIR/sitex.pool"
echo "to your TEXPOOL-Directory, and $TEXDIR/hf3 to your"
echo "TEXINPUTS-Directory."
echo

exit 0