diff run-octave.in @ 5814:67bf9b4f2ae2

[project @ 2006-05-11 21:58:34 by jwe]
author jwe
date Thu, 11 May 2006 21:58:34 +0000
parents 395382df0d8a
children e049385342f6
line wrap: on
line diff
--- a/run-octave.in	Thu May 11 19:46:15 2006 +0000
+++ b/run-octave.in	Thu May 11 21:58:34 2006 +0000
@@ -1,8 +1,19 @@
 #! /bin/sh
 top_srcdir=%abs_top_srcdir%
 builddir=%builddir%
-LOADPATH="$top_srcdir/test//:$top_srcdir/scripts//:$builddir/scripts//:$builddir/src//:";
-args="--path=$LOADPATH"
+## 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"