#!/bin/csh -f
############################################################################
#
#				setos.src
#				S.L.Freeland - 29-July-1992
#					(SLF) -  1-Oct-1993 (add OS env)
#					(SLF) - 19-Nov-1993 (add Solaris)
#                                       (DMZ) - 12-May-1994 (add OSF)
#					(BNH) - 22-May-1996 (add Linux)
#							    (add FreeBSD)
#                                       (SLF) - 25-jun-2007(!) null OS protect
#
#############################################################################
# Determine Operating System based on configuration files 
# Sets variable and environmental OS
# (Logic for determination based on existing directories/files borrowed
# from RSI supplied /bin/sh script [$IDL_DIR/bin/idl]
##############################################################################
unset OS					# Start with Clean Slate

if ( -e /bin/arch ) then			# SunOS
	set OS="sunos"
else if (-e /osf_boot) then                     # Osf
        set OS="osf"                          
else if (-e /usr/ucb/arch) then			# Solaris 2.2 (SunOS)
	set OS="sunos"
else if (-e /bin/machine ) then			# DEC Ultrix (sometimes)
	set OS="ultrix"
else if ( -e /hp-ux ) then			# HP-UX
	set OS="hp"
else if (-e /bin/4d ) then			# SGI Irix
	set OS="sgi"
else if (-e /dev/root ) then			# Mips
	set OS="mips"
else if (-e /vmunix ) then			# DEC Ultrix
	OS="ultrix"
else if (-e /bin/smit ) then			# IBM
	set OS="ibm"
else if (-e /dev/root ) then			# Mips
	OS="mips"
else if (-e /kernel ) then                      # FreeBSD
        set OS="linux"
else if (-e /vmlinuz ) then                     # Linux
        set OS="linux"
else set OS=""
endif

setenv OS $OS
exit
############################################################################
