Rewrite startup/unix.csh

Remove extraneous things unrelated to EPICS Base.

Make it behave consistently with the other startup scripts.

Make it easy to configure both for a human and a program.
This commit is contained in:
2018-07-20 17:29:47 -05:00
parent 8f161f9463
commit 31844af88e

View File

@ -1,4 +1,3 @@
#!/bin/csh -f
#*************************************************************************
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
# National Laboratory.
@ -8,111 +7,90 @@
# and higher are distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************
# Site-specific EPICS environment settings
#
# sites should modify these definitions
# Location of epics base
if ( ! $?EPICS_BASE ) then
set EPICS_BASE=/usr/local/epics/base
endif
# Location of epics extensions
if ( ! $?EPICS_EXTENSIONS ) then
setenv EPICS_EXTENSIONS /usr/local/epics/extensions
endif
# Postscript printer definition needed by some extensions (eg medm, dp, dm, ...)
if ( ! $?PSPRINTTER ) then
setenv PSPRINTER lp
endif
# Needed only by medm extension
#setenv EPICS_DISPLAY_PATH
# Needed only by medm extension
setenv BROWSER firefox
# Needed only by orbitscreen extension
if ( ! $?ORBITSCREENHOME ) then
setenv ORBITSCREENHOME $EPICS_EXTENSIONS/src/orbitscreen
endif
# Needed only by adt extension
if ( ! $?ADTHOME ) then
setenv ADTHOME /usr/local/oag/apps/src/appconfig/adt
echo $ADTHOME
endif
# Needed only by ar extension (archiver)
setenv EPICS_AR_PORT 7002
# Needed for java extensions
if ( $?CLASSPATH ) then
setenv CLASSPATH "${CLASSPATH}:${EPICS_EXTENSIONS}/javalib"
else
setenv CLASSPATH "${EPICS_EXTENSIONS}/javalib"
endif
# Allow private versions of extensions without a bin subdir
if ( $?EPICS_EXTENSIONS_PVT ) then
set path = ( $path $EPICS_EXTENSIONS_PVT)
endif
##################################################################
# Start of set R3.14 environment variables
setenv EPICS_HOST_ARCH `$EPICS_BASE/startup/EpicsHostArch.pl`
# Allow private versions of base
if ( $?EPICS_BASE_PVT ) then
if ( -e $EPICS_BASE_PVT/bin/$EPICS_HOST_ARCH ) then
set path = ( $path $EPICS_BASE_PVT/bin/$EPICS_HOST_ARCH)
endif
endif
# Allow private versions of extensions
if ( $?EPICS_EXTENSIONS_PVT ) then
if ( -e $EPICS_EXTENSIONS_PVT/bin/$EPICS_HOST_ARCH ) then
set path = ( $path $EPICS_EXTENSIONS_PVT/bin/$EPICS_HOST_ARCH)
endif
endif
set path = ( $path $EPICS_EXTENSIONS/bin/$EPICS_HOST_ARCH )
# End of set R3.14 environment variables
##################################################################
## Start of set pre R3.14 environment variables
# Site-specific EPICS environment settings
#
## Time service:
## EPICS_TS_MIN_WEST the local time difference from GMT.
#setenv EPICS_TS_MIN_WEST 360
# Attempts to set EPICS_HOST_ARCH. Optionally, adds the EPICS Base
# install host architecture bin directory to PATH.
#
#if ( -e /usr/local/etc/setup/HostArch.pl ) then
# setenv HOST_ARCH `/usr/local/etc/setup/HostArch.pl`
#else
# setenv HOST_ARCH `/usr/local/epics/startup/HostArch.pl`
#endif
#
## Allow private versions of extensions
#if ( $?EPICS_EXTENSIONS_PVT ) then
# if ( -e $EPICS_EXTENSIONS_PVT/bin/$HOST_ARCH ) then
# set path = ( $path $EPICS_EXTENSIONS_PVT/bin/$HOST_ARCH)
# endif
# # Needed if shared extension libraries are built
# if ( -e $EPICS_EXTENSIONS_PVT/lib/$HOST_ARCH ) then
# if ( $?LD_LIBRARY_PATH ) then
# setenv LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:${EPICS_EXTENSIONS_PVT}/lib/${HOST_ARCH}"
# else
# setenv LD_LIBRARY_PATH "${EPICS_EXTENSIONS_PVT}/lib/${HOST_ARCH}"
# endif
# endif
#endif
#
#set path = ( $path $EPICS_EXTENSIONS/bin/$HOST_ARCH )
## Needed if shared extension libraries are built
#setenv LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:${EPICS_EXTENSIONS}/lib/${HOST_ARCH}"
# End of set pre R3.14 environment variables
##################################################################
#-----------------------------------------------------------------------
# Site serviceable parts (These definitions may be modified)
#-----------------------------------------------------------------------
# Automatically set up the environment when possible ("yes" or "no").
# If set to yes, as much of the environment will be set up as possible.
# If set to no, just the minimum environment will be set up. More
# specific _auto_* definitions take precedence over this definition.
set _auto=no
# Automatically append to PATH ("yes" or "no"). If set to yes, the
# EPICS Base install host architecture bin directory will be added to
# PATH if possible. If set to no, the bin directory will not be added
# to PATH.
set _auto_path_append=$_auto
# The program used to run Perl scripts (pathname).
set _perl_prog=perl
# The EPICS host architecture specification for EPICS_HOST_ARCH
# (<os>-<arch>[-<toolset>] as defined in configure/CONFIG_SITE). If
# nonempty, the value will be used as the value of EPICS_HOST_ARCH. If
# empty, an attempt will be made to automatically determine the value
# with EpicsHostArch.pl.
set _epics_host_arch=
# The install location of EPICS Base (pathname). If nonempty, the
# EpicsHostArch.pl script from it, if it exists, will be used to
# determine EPICS_HOST_ARCH. If nonempty and EPICS_HOST_ARCH was
# determined successfully, it will be used to add the host architecture
# bin directory to PATH if _auto_path_append is yes.
set _epics_base=
# The source location of EPICS Base (pathname). If nonempty, the
# EpicsHostArch.pl script from it, if it exists and _epics_base is empty
# or it did not exist in the _epics_base location, will be used to
# determine EPICS_HOST_ARCH.
set _epics_base_src=
#-----------------------------------------------------------------------
# Internal parts (There is typically no need to modify these)
#-----------------------------------------------------------------------
# Define the possible locations of EpicsHostArch.pl
set _epics_host_arch_pl=
set _src_epics_host_arch_pl=
if ("$_epics_base" != '') then
set _epics_host_arch_pl="$_epics_base/lib/perl/EpicsHostArch.pl"
endif
if ("$_epics_base_src" != '') then
set _src_epics_host_arch_pl="$_epics_base_src/src/tools/EpicsHostArch.pl"
endif
# Set the EPICS host architecture specification
if ("$_epics_host_arch" != '') then
setenv EPICS_HOST_ARCH "$_epics_host_arch"
else if (-e "$_epics_host_arch_pl") then
set _epics_host_arch=`"$_perl_prog" "$_epics_host_arch_pl"`
setenv EPICS_HOST_ARCH "$_epics_host_arch"
else if (-e "$_src_epics_host_arch_pl") then
set _epics_host_arch=`"$_perl_prog" "$_src_epics_host_arch_pl"`
setenv EPICS_HOST_ARCH "$_epics_host_arch"
endif
# Add the EPICS Base host architecture bin directory to PATH
if ("$_auto_path_append" == yes) then
if ("$_epics_base" != '' && "$_epics_host_arch" != '') then
setenv PATH "${PATH}:$_epics_base/bin/$_epics_host_arch"
endif
endif
# Don't leak variables into the environment
unset _auto
unset _auto_path_append
unset _perl_prog
unset _epics_host_arch
unset _epics_base
unset _epics_base_src
unset _epics_host_arch_pl
unset _src_epics_host_arch_pl