#######################################################################
# 
#
#	lic_setup is a file to be sourced by all scripts 
#       which need to setup the license environment for MSI
#       products
#
#######################################################################

#Set location of release specific license data
setenv MSI_LIC_INFO_DIR /usr/global/msi/cerius2_4.2MS/CHECKSUM


### License Pack setup ###

#Set location of license pack (release-independent license data)
if ($?LP_OVERRIDE) then
   setenv MSI_LIC_PACK_DIR $LP_OVERRIDE
else if (-e /usr/global/msi/License_Pack) then
   setenv MSI_LIC_PACK_DIR /usr/global/msi/License_Pack
endif

if ($?MSI_LIC_PACK_DIR) then
   source $MSI_LIC_PACK_DIR/msi_lic_cshrc
   goto skip
endif

### Non-license pack setup ###

#Use LM_OVERRIDE if exists otherwise set LM_LICENSE_FILE
if ($?LM_OVERRIDE) then
   setenv LM_LICENSE_FILE "$LM_OVERRIDE"
else if !($?LM_LICENSE_FILE) then
   setenv LM_LICENSE_FILE "/usr/global/msi/cerius2_4.2MS/license/msilicense.dat:/usr/global/msi/cerius2_4.2MS/license/msilicense.demo"
else
   setenv LM_LICENSE_FILE "${LM_LICENSE_FILE}:/usr/global/msi/cerius2_4.2MS/license/msilicense.dat:/usr/global/msi/cerius2_4.2MS/license/msilicense.demo"
endif

if (-e /usr/global/msi/cerius2_4.2MS/libs/libpub_lic.so) then
   set lic_ldpath  = "/usr/global/msi/cerius2_4.2MS/libs"
endif

#Set library path to find licensing dsos
if ($?LD_LIBRARY_PATH) then
   echo $LD_LIBRARY_PATH | grep ${lic_ldpath}  >& /dev/null
   if ($status) then
      setenv LD_LIBRARY_PATH "${lic_ldpath}:${LD_LIBRARY_PATH}"
   endif
else if ($lic_ldpath != "") then
   setenv LD_LIBRARY_PATH "${lic_ldpath}"
endif

### If license pack exists then above section is skipped

skip:
