view run-octave.in @ 5851:acb4a1e0b311 ss-2-9-6

[project @ 2006-06-09 16:34:42 by jwe]
author jwe
date Fri, 09 Jun 2006 16:37:20 +0000
parents 67bf9b4f2ae2
children e049385342f6
line wrap: on
line source

#! /bin/sh
top_srcdir=%abs_top_srcdir%
builddir=%builddir%
## FIXME -- this will fail for filenames with embedded spaces...
dirs="$top_srcdir/test $top_srcdir/scripts $builddir/scripts $builddir/src"
dirs=$(find $dirs -type d -a ! \( \( -name CVS -o -name private \) -a -prune \))
for d in $dirs; do
  LOADPATH=$LOADPATH:$d
done
LOADPATH=$(echo $LOADPATH | sed 's|^:||')
IMAGEPATH="$top_srcdir/scripts/image"
args="--path=$LOADPATH --image-path=$IMAGEPATH"
if [ $(pwd) = "$builddir" ]; then
  sed "s|^set args.*$|set args $args|" .gdbinit > .gdbinit-tmp
  mv .gdbinit-tmp .gdbinit
fi
if [ $# -gt 0 ]; then
  if [ "x$1" = "x-g" ]; then
    driver="gdb"
    args=""
    shift
  elif [ "x$1" = "x-valgrind" ]; then
    driver="valgrind --tool=memcheck"
    shift
  elif [ "x$1" = "x-strace" ]; then
    driver="strace -o octave.trace"
    shift
  fi
fi
OCTAVE_SITE_INITFILE=$top_srcdir/scripts/startup/main-rcfile \
LD_LIBRARY_PATH="$builddir/src:$builddir/liboctave:$builddir/libcruft" \
  exec $driver $builddir/src/octave $args "$@"