#!/bin/bash # # first, work out the current operating system, one of `linux' (x86), `solaris' # (sparc), or `windows' (x86); anything else will require manual installation. # if [ "$OSTYPE" = "linux" -o "$OSTYPE" = "linux-gnu" ]; then # # apparently, (some) Debian installations come with an older uname(1), where # `-i' is not available :-{. (11-mar-05; oe) # if uname -i > /dev/null 2>&1; then cpu=$(uname -i) if [ "${cpu}" = "unknown" ]; then cpu=$(uname -m); fi else cpu=$(uname -m) fi case "${cpu}" in i?86) os="linux.x86.32" ;; x86_64) os="linux.x86.64" ;; *) echo "lkb: unknown Linux variant (check \`uname -m'); exit." exit 1; esac elif [ "$OSTYPE" = "solaris" -o "${OSTYPE%%?.?}" = "solaris" ]; then os="solaris"; elif [ "$OSTYPE" = "cygwin" ]; then os="windows"; fi # # 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 exec ${LOGONROOT}/bin/java -jar ${LOGONROOT}/coli/Utool-3.1.1.jar "$@" # # set up dynamic linker search path, so as to find our shared libraries # if [ "${os%%.*}" == "linux" -o "$os" == "solaris" ]; then # # also, add the OS-specific DELPH-IN library directory to the dynamic linker # path; put ourselves at the front to avoid collisions with other libraries. # if [ -z "${LD_LIBRARY_PATH}" ]; then LD_LIBRARY_PATH=${LOGONROOT}/coli/lib/${os}; else LD_LIBRARY_PATH=${LOGONROOT}/coli/lib/${os}:${LD_LIBRARY_PATH}; fi export LD_LIBRARY_PATH; fi exec ${LOGONROOT}/coli/bin/${os}/utool "$@"