#!/bin/sh
##
##  TSM Run-Time Executable Wrapper Script
##

prog="`echo $0 | sed -e 's;.*/\([^/]*\)$;\1;'`"

prefix="@l_prefix@"

if [ ! -f "$prefix/libexec/tsmc/$prog" ]; then
    echo "TSM: invalid program name" 1>&2
    exit 1
fi

LD_LIBRARY_PATH=""
for dir in /lib /usr/lib /usr/ccs/lib; do
    if [ -d $dir ]; then
        if [ ".$LD_LIBRARY_PATH" = . ]; then
            LD_LIBRARY_PATH="$dir"
        else
            LD_LIBRARY_PATH="$dir:${LD_LIBRARY_PATH}"
        fi
    fi
done
export LD_LIBRARY_PATH

DSM_DIR="$prefix/libexec/tsmc"
export DSM_DIR

DSM_CONFIG="$prefix/libexec/tsmc/dsm.opt"
export DSM_CONFIG

LANG="en_US"
export LANG

exec $prefix/libexec/tsmc/$prog "$@"

