#!/bin/sh
# @(#)LOCALOS.cpp version 3.30 created 4/16/96
# @(#)Copyright (c), 1987, 1996 StatSci, Inc.  All rights reserved.
# Make the $INC/local_os.h file.
: ${SHOME?}
SCRIPT_NAME=LOCALOS.cpp
OUTFILE=$SHOME/include/local_os.h
exec >$OUTFILE
at=@	# hide expanded SCCS magic string from checkin script 
echo "/* $at(#)Copyright (c), 1987, `date | awk '{print $6}'` StatSci, Inc.  All rights reserved. */"
echo '/* DO NOT EDIT THIS FILE!!! IT IS AUTO-GENERATED BY $A/LOCALOS. */'
echo
echo '#ifndef LOCAL_OS_H'
echo '#define LOCAL_OS_H'
echo '#ifndef NOT_C_SOURCE'
echo '#include <sccs.h>'
: SCCS version number and last-edit date for local_os.h defined to be those
: of LOCALOS.cpp:
echo "SCCS_ID_C(0180,$at(#)local_os.h 3.30 last edit 4/16/96 StatSci)"
echo '#endif'
echo 
if [ -x /bin/uname ]
then rev=`/bin/uname -r`
elif [ -x /usr/5bin/uname ]
then rev=`/usr/5bin/uname`
else rev=3.5
fi
case "$rev" in
   *5.[0-9]*)
      echo '#define SUNOS5'
      echo '#ifndef __svr4__'
      echo '#define __svr4__'
      echo '#endif'
      # At the moment, we're trying to maintain both 'cc' and 'gcc' compiled live
      # SHOME directories. Use the name of the SHOME directory to distinguish the
      # two.
      case "$SHOME/" in
         *_gcc/*)
            echo
            echo '/* This SHOME dir name ends in _gcc, so try to use the alternate'
            echo ' * set of compilers (gcc/f2c). This is to get around the single'
            echo " * user license that we have on Sun's SPARCworks compilers."
            echo ' */'
            echo '#define ALTERNATE_COMPILERS'
         ;;
      esac
   ;;
   *4.[0-9]*) echo '#define SUNOS4';;
   *3.[0-9]*) echo '#define SUNOS3';;
esac
# The SUNOS_REV is <major rev> * 100 + minor1 * 10 + minor2.
# (e.g. 4.1.1 == 411)
echo
echo '/* The SUNOS_REV is <major rev> * 100 + minor1 * 10 + minor2. */'
echo '/* (e.g. 4.1.1 == 411)                                        */'
echo '#define SUNOS_REV '`uname -r | sed -e 's/[^0-9]//g' -e 's/^\(...\).*/\1/' -e '/^.$/s/$/00/' -e '/^..$/s/$/0/'`
echo; echo "#ifdef sparc"; echo "#define SPARC"; echo "#endif"
echo
echo '#endif'
