#!/usr/bin/csh -f # # This script starts the Solaris 2.5 SDK Intro. # # check if we have uname if ( ! -x /bin/uname ) then echo "" echo "INTRO: Can not determine what operating system you are on." echo " The Solaris 2.5 SDK Intro requires Solaris 2.5" echo "" exit 1 endif # check for proper architecture switch ( `uname -p` ) case ppc: setenv ARTICLEFILE ARTICLES.ppc breaksw default: setenv ARTICLEFILE ARTICLES breaksw endsw switch ( `uname -r` ) case 4.*: echo "" echo "INTRO: The Solaris 2.5 SDK Intro requires Solaris 2.5" echo "" exit 2 breaksw case 5.*: breaksw default: breaksw endsw # get usr supplied path set DIR = `dirname $0`/intro # change usr supplied path to absolute path # remove automounter bs in the process set DIR = `cd $DIR ; pwd | sed -e 's/\/tmp_mnt//'` # set the home directory for the 'cd' setenv CDHOME $DIR cd $CDHOME # set more stuff set BASE = `basename $0` set OS = `uname` set OSVERSION = `uname -r | sed -e 's/^5\..*/5.x/' -e 's/^4\.1\..*/4.1.x/'` set MACH = `uname -m | sed -e 's/sun4.*/sun4/'` set EXE = bin/exe/$OS-$OSVERSION.$MACH set MACHINENAME = `uname -n` # # PEX prefers a DISPLAY with a hostname prepended (ie. "foo:0"), # so add it here if necessary. # if ($?DISPLAY) then test `echo $DISPLAY | grep "^:"` if ($status == "0") then setenv DISPLAY "$MACHINENAME$DISPLAY" endif else echo "DISPLAY environment variable must be set to run this demo" exit 1 endif # # LIBDIR contains the SDK_INTRO specific libraries that aren't part # of the end-user cluster. # set LIBDIR = $CDHOME/lib/$OS-$OSVERSION.$MACH setenv MOTIFHOME $LIBDIR # # Some default (and required) library locations # setenv XGLHOME /opt/SUNWits/Graphics-sw/xgl setenv XILHOME /opt/SUNWits/Graphics-sw/xil setenv X11HOME $OPENWINHOME # # Now check for required libraries (in required locations) # if ( ! -r $XGLHOME/lib/libxgl.so ) then echo "INTRO: XGL doesn't seem to be installed in /opt/SUNWits/Graphics-sw." echo " The Solaris 2.5 SDK Intro requires the XGL runtimes to be " echo " installed in /opt/SUNWits/Graphics-sw. Please pkgadd them and" echo " try again." exit 12 endif if ( ! -r $XILHOME/lib/libxil.so ) then echo "INTRO: XIL doesn't seem to be installed in /opt/SUNWits/Graphics-sw." echo " The Solaris 2.5 SDK Intro requires the XIL runtimes to be " echo " installed in /opt/SUNWits/Graphics-sw. Please pkgadd them and" echo " try again." exit 12 endif # # /dev/audio support is required. # #if ( ! -w /dev/audio ) then # echo "INTRO: There doesn't appear to be an audio device on this system." # echo " The Solaris 2.5 SDK Intro requires a Solaris supported audio" # echo " device. Please run the Intro on a system with an audio device." # exit 14 #endif setenv LD_LIBRARY_PATH $XGLHOME/lib:$XILHOME/lib:$OPENWINHOME/lib:$LIBDIR/lib setenv SUNPEX_DIRECT_ENABLE # # We'll only support English for the moment. # set CDTIMES_LANG = "en" set CDTIMES_LANG_EXT = . # set location for resource files switch ( `$OPENWINHOME/bin/xwininfo -root | grep Depth | sed -e 's/^.*Depth: //'` ) case 8: case 24: setenv XAPPLRESDIR $DIR/.resources/$CDTIMES_LANG_EXT breaksw default: echo "Unsupported Display Type" echo "Must run on 8 or 24 bit color systems only." exit 1 endsw # start it up rm -f /tmp/intro.log touch /tmp/intro.log chmod 666 /tmp/intro.log if ( `/bin/uname -p` == sparc ) then exec $DIR/$EXE/cbrowser -geometry 582x760+150+5 $DIR >>& /tmp/intro.log else exec $DIR/$EXE/cbrowser -geometry 582x730+10+5 $DIR >>& /tmp/intro.log endif