#!/bin/sh

attach -h -n -q tcl

# Add paths to libraries python is linked against.

# ...this gets around the fact that the paths to the tcl and gdbm
# libraries are not compiled into the run path of the python
# executable.  The right way to do this would be to add -R <path> to
# the linking command at build time.
paths=/mit/python/lib:/mit/tcl/arch/${ATHENA_SYS}/lib

# ...some silly futzing around so that I don't end up with an initial
# colon in LD_LIBRARY_PATH
if test "x${LD_LIBRARY_PATH}" != x ; then 
    paths=:${paths}
fi

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}${paths}

# ...this needs to be exported so that the above library directories
# are accessible to the python process.  If you don't do that, and
# LD_LIBRARY_PATH is not set, then the value will not be passed to the
# python process.
export LD_LIBRARY_PATH

exec /bin/athena/attachandrun python python2.1 python "$@"
