#!/bin/bash # # determine the LOGON root directory, assuming this script resides in a # `bin' sub-directory that is shared across platforms. # if [ -z "${LOGONROOT}" ]; then path=$(dirname $0) if [ "${path#./}" != "${path}" ]; then path="$(pwd)/${path#./}" fi if [ "${path#/}" = "${path}" ]; then if [ "${path}" = "." ]; then path="$(pwd)"; else path="$(pwd)/${path}" fi fi LOGONROOT="${path%/bin}"; export LOGONROOT; fi # # include a shared set of shell functions and global parameters, including the # architecture identifier .LOGONOS. # . ${LOGONROOT}/etc/library.bash; # # as of mid-2011, the standard (i.e. more or less supported) LOGON binaries # are always 32-bit; why duplicate the build effort, for no obvious benefit in # in running 64-bit PET binaries? (5-aug-11; oe) # if [ "${1}" == "-s" -o "${1}" == "--stable" ]; then # # for legacy users, a 'stable' binary, compiled off release 1.0 # shift 1; LOGONOS=linux.x86.32; binary=${LOGONROOT}/uio/bin/${LOGONOS}/sflop; elif [ "${1}" == "-t" -o "${1}" == "--test" ]; then # # for developers, a 'testing' binary (possibly compiled off some branch) # shift 1; LOGONOS=linux.x86.32; binary=${LOGONROOT}/uio/bin/${LOGONOS}/tflop; elif [ "${1}" == "-l" -o "${1}" == "--local" ]; then # # use a locally compiled binary, external to the LOGON tree # shift 1; binary=${HOME}/src/pet/trunk/debug/flop/flop; else # # the 'standard' binary, compiled off the (latest and greatest) trunk # binary=${LOGONROOT}/uio/bin/${LOGONOS}/flop; fi # # set up dynamic linker search path, so as to find our shared libraries # if [ "${LOGONOS%%.*}" == "linux" ]; then if [ -z "${LD_LIBRARY_PATH}" ]; then LD_LIBRARY_PATH=${LOGONROOT}/uio/lib/${LOGONOS}; else LD_LIBRARY_PATH=${LOGONROOT}/uio/lib/${LOGONOS}:${LD_LIBRARY_PATH}; fi export LD_LIBRARY_PATH; fi [ -x "${binary}" ] || binary=${LOGONROOT}/uio/bin/${LOGONOS}/flop; exec ${binary} "$@"