home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume4 / se / part1 / where < prev   
Text File  |  1986-11-30  |  1KB  |  62 lines

  1. #! /bin/sh
  2.  
  3. # where --- shell file to determine what kind of environment we are in
  4.  
  5. if test -r /bin/universe    # on a pyramid
  6. then
  7.     OPATH=$PATH
  8.     PATH=/bin
  9.     case `universe` in    # universe is dumb, looking only at argv[0]
  10.     att)    echo "-DUSG -UBSD -UBSD4_2"
  11.         if grep LOBLK /usr/include/sys/termio.h > /dev/null
  12.         then
  13.             echo -DS5R2
  14.         else
  15.             echo -US5R2
  16.         fi
  17.         ;;
  18.  
  19.     ucb)    echo "-UUSG -DBSD -DBSD4_2 -US5R2"
  20.         ;;
  21.  
  22.     *)    echo unknown operating system! 1>&2
  23.         echo "-UUSG -UBSD -UBSD4_2"    # undefine them all
  24.         echo "-US5R2"
  25.         ;;
  26.     esac
  27.     PATH=$OPATH
  28.     echo -UGITVAX    # pyramid is never GITVAX
  29. else        # on something that is not a pyrmaid
  30.     if grep SIGTSTP /usr/include/signal.h > /dev/null
  31.     then        # berkeley unix
  32.         if test -r /usr/include/whoami.h    # 4.1
  33.         then
  34.             echo "-UUSG -DBSD -UBSD4_2"
  35.             host="`sed 's/[^\"]*\"\([^\"]*\)\"/\1/' < /usr/include/whoami.h`"
  36.         else                    # 4.2
  37.             echo "-UUSG -DBSD -DBSD4_2"
  38.             host=`hostname`
  39.         fi
  40.         case $host in
  41.         gatech | \
  42.         gt-nimbus | nimbus | \
  43.         gt-cirrus | cirrus | \
  44.         gt-stratus | stratus)    echo -DGITVAX
  45.                 ;;
  46.         
  47.         *)    echo -UGITVAX
  48.             ;;
  49.         esac
  50.         echo -US5R2
  51.     else            # ATT unix
  52.         echo "-DUSG -UBSD -UBSD4_2"
  53.         if grep LOBLK /usr/include/sys/termio.h > /dev/null
  54.         then
  55.             echo -DS5R2
  56.         else
  57.             echo -US5R2
  58.         fi
  59.         echo -UGITVAX
  60.     fi
  61. fi
  62.