diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /pkg/ecl/cl.csh.SSOL | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/ecl/cl.csh.SSOL')
-rwxr-xr-x | pkg/ecl/cl.csh.SSOL | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/pkg/ecl/cl.csh.SSOL b/pkg/ecl/cl.csh.SSOL new file mode 100755 index 00000000..cf898de9 --- /dev/null +++ b/pkg/ecl/cl.csh.SSOL @@ -0,0 +1,94 @@ +#! /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 |