#! /bin/csh # CL.CSH -- Startup the version of the CL executable compiled for the # architecture or floating point hardware appropriate for the current # machine. #set echo # Determine platform architecture. setenv OSVERSION `uname -r | cut -c1` if ($OSVERSION == 5) then set MACH = `uname -p` switch ($MACH) case sparc: set MACH = ssol breaksw endsw else set MACH = `mach` endif # Determine CL binary to run based on how we were called. set cl_binary = "cl.e" if (`echo $0 | egrep ecl` != "") then set cl_binary = "ecl.e" else if ($#argv > 0) then if ("$argv[1]" == "-ecl" || "$argv[1]" == "-e") then set cl_binary = "ecl.e" endif else if ($#argv > 0) then if ("$argv[1]" == "-old" || "$argv[1]" == "-o") then set cl_binary = "cl.e" endif endif # Determine IRAF root directory (value set in install script). set d_iraf = "/iraf/iraf/" if ($?iraf) then if (! -e $iraf) then echo "Warning: iraf=$iraf does not exist (check .cshrc or .login)" echo "Session will default to iraf=$d_iraf" unsetenv iraf ; sleep 3 endif endif if ($?iraf == 0) then setenv iraf "$d_iraf" endif # Check for obsolete IRAFBIN definition. if ($?IRAFBIN && !($?IRAFARCH)) then echo "Use IRAFARCH rather than IRAFBIN to specify the machine architecture" echo "IRAFARCH, if defined, should be one of ffpa,f68881,i386,sparc, etc." endif # Just run the CL if IRAFARCH already defined. if ($?IRAFARCH) then if ($IRAFARCH == "") then setenv arch "" else setenv arch ".$IRAFARCH" endif setenv IRAFBIN ${iraf}bin$arch/ set file = ${IRAFBIN}$cl_binary if (-e $file) then exec $file else echo "$file not found" endif endif # Determine the architecture to be used. if ("$MACH" == "ssol") then setenv IRAFARCH "ssun" else if ("$MACH" == "sparc") then setenv IRAFARCH "sparc" else if ("$MACH" == "i386") then setenv IRAFARCH "i386" else if (-e /dev/fpa && -e ${iraf}bin.ffpa/cl.e) then setenv IRAFARCH "ffpa" else setenv IRAFARCH "f68881" endif setenv arch .$IRAFARCH setenv IRAFBIN ${iraf}bin$arch/ set file = ${IRAFBIN}$cl_binary # Run the desired CL. exec $file