#!/bin/sh
#
# Write a version stamp into $1.  $2 is the version string and $3 the
# compiler name.  Works on Linux; not tested on any other system.
#
# Last edited: Sun Jun 20 20:25:50 1999 by piumarta (Ian Piumarta) on clotho

if [ -f $1 ]; then
  SERIAL=`head -1 sqUnixVersion.c | cut -d ' ' -f 3 | sed 's/;//'`
  SERIAL=`expr $SERIAL + 1`
else
  SERIAL=1
fi

#3 -v >

if expr "$3" : ".*gcc" >/dev/null ; then
  CC=`$3 -v 2>&1 | tail -1 | awk '{print $1 , $3} '`
else
  CC=$3
fi

cat <<_EOF > $1
int vm_serial= $SERIAL;
char *vm_version= "$2";
char *vm_date= "`date`";
char *cc_version= "$CC";
char *ux_version= "`uname -a`";
_EOF
