#!/bin/sh

echo ""
echo "******************************************************"
echo "* This is the AVS/Express startup script "run_xp.sh" *"
echo "* If you are working in one of your own AVS/Express  *"
echo "* projects don't forget to run this program FROM     *"
echo "* your project directory!!                           *"
echo "******************************************************"
echo ""

echo ""
echo "Setting the environment variables..."
echo ""

############################################################
# Set XPDIR to the AVS/Express installation directory name #
############################################################
XPDIR=/usr/local/express

#########################################################
# Set PROJDIR to the AVS/Express project directory name #
#########################################################
PROJDIR=/home/haupt/XPcrpc

########################################################
# Set the following to the appropriate architecture    #
# name that you selected when installing the software. #
# If you have already installed the software, you can  #
# look in the "bin" directory to see what architecture #
# is installed. Typically one of: sgi, sg6, sgN32,     #
# hp10, s7 or linux.                                   #
########################################################
MACHINE=sgN32

###########################################################
# Set one of the following to add the AVS/Express         #
# installation "lib/$MACHINE" directory to any existing   #
# definition of these variables. If you have compiled any #
# of your own code (modules) make sure to ALSO add your   #
# project's "lib/$MACHINE" directory to this variable!    #
#                                                         #
# Please remember to comment/uncomment the "export" line  #
# along with the variable definition!!!                   #
###########################################################

###############################
# "sgi" -- SGI 32-bit library #
###############################
#LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${XPDIR}/lib/$MACHINE:
#export LD_LIBRARY_PATH

#######################################
# "sgN32" -- SGI "new" 32-bit library #
#######################################
LD_LIBRARYN32_PATH=${LD_LIBRARYN32_PATH}:${XPDIR}/lib/$MACHINE:${PROJDIR}/lib/$MACHINE
export LD_LIBRARYN32_PATH

###############################
# "sg6" -- SGI 64-bit library #
###############################
#LD_LIBRARY64_PATH=${LD_LIBRARY64_PATH}:${XPDIR}/lib/$MACHINE:
#export LD_LIBRARY64_PATH

################################
# Hewlett-Packard UNIX library #
################################
#SHLIB_PATH=${SHLIB_PATH}:${XPDIR}/lib/$MACHINE:
#export SHLIB_PATH

##################
# All other UNIX #
##################
#LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${XPDIR}/lib/$MACHINE:
#export LD_LIBRARY_PATH


#################################################################
# Set the following to "EXPRESS" if you are using the Developer #
# Edition of AVS/Express. Otherwise, use "VIZ_EXPRESS".         #
# Remote OSC users of AVS/Express have only VIZ_EXPRESS as an   #
# option.                                                       #
#################################################################
XP_FEATURE=VIZ_EXPRESS

##################################################################
# AVS/Express is licensed software. The LM_LICENSE_FILE variable #
# is inspected by AVS/Express on startup for a valid license. We #
# have provided an AVS/Express license file location in the      #
# defininition of XPLICENSE below. DO NOT EDIT this variable!!   #
#                                                                #
# If you use other software that employs FLEXlm licensing (such  #
# (as SGI compilers) be sure to specify the location of the      #
# necessary license files in the OTHER_LICENSE variable. For     #
# example, if your SGI C compiler license was defined in the     #
# file /var/flexlm/license.dat (a typical location) and some     #
# additional software license was located in /home/doe/mylic.dat #
# you would set                                                  #
#     OTHER_LICENSE=/var/flexlm/license.dat:/home/doe/mylic.dat  #
##################################################################
XPLICENSE=1700@192.148.248.31
OTHER_LICENSE=
LM_LICENSE_FILE=${OTHER_LICENSE}:${XPLICENSE}

#########################
# Export all variables. #
#########################
export MACHINE XP_FEATURE LM_LICENSE_FILE 

####################
# Run the software #
####################
echo "You have set the following variables." 
echo "Please make sure they are correct!!"
echo ""
echo "** AVS/Express installation directory is $XPDIR"
echo "** Architecture is $MACHINE"
echo "** XP_FEATURE is $XP_FEATURE"
echo "** LM_LICENSE_FILE is $LM_LICENSE_FILE"
echo "** LD_LIBRARY_PATH is $LD_LIBRARY_PATH"
echo "** LD_LIBRARYN32_PATH is $LD_LIBRARYN32_PATH"
echo "** LD_LIBRARY64_PATH is $LD_LIBRARY64_PATH"
echo ""

echo ""
echo "Running AVS/Express..."
echo ""

$PROJDIR/bin/$MACHINE/express "$@"

