Mercurial > hg > octave-lojdl
comparison run-octave.in @ 6125:a1754033bc6c
[project @ 2006-10-29 17:05:53 by jwe]
author | jwe |
---|---|
date | Sun, 29 Oct 2006 17:05:53 +0000 |
parents | 1839d551521b |
children | 3e7802d42172 |
comparison
equal
deleted
inserted
replaced
6124:58f46c6f0d51 | 6125:a1754033bc6c |
---|---|
1 #! /bin/sh | 1 #! /bin/sh |
2 top_srcdir=%abs_top_srcdir% | 2 |
3 builddir=%builddir% | 3 AWK=${AWK:-'awk'} |
4 ## FIXME -- this will fail for filenames with embedded spaces... | 4 |
5 dirs="$top_srcdir/test $top_srcdir/scripts $builddir/scripts $builddir/src" | 5 # FIXME -- is there a better way to handle the possibility of spaces |
6 dirs=$(find $dirs -type d -a ! \( \( -name CVS -o -name private \) -a -prune \)) | 6 # in these names? |
7 for d in $dirs; do | 7 |
8 LOADPATH=$LOADPATH:$d | 8 top_srcdir="%abs_top_srcdir%" |
9 done | 9 builddir="%builddir%" |
10 LOADPATH=$(echo $LOADPATH | sed 's|^:||') | 10 |
11 d1="$top_srcdir/test" | |
12 d2="$top_srcdir/scripts" | |
13 d3="$builddir/scripts" | |
14 d4="$builddir/src" | |
15 | |
16 d1_list=$(find "$d1" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}': ';') | |
17 d2_list=$(find "$d2" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}': ';') | |
18 d3_list=$(find "$d3" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}': ';') | |
19 d4_list=$(find "$d4" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}': ';') | |
20 | |
21 d1_path=$(echo "$d1_list" | $AWK '{ s = sprintf ("%s%s", s, $0); } END { sub (/:$/, "", s); print s; }') | |
22 d2_path=$(echo "$d2_list" | $AWK '{ s = sprintf ("%s%s", s, $0); } END { sub (/:$/, "", s); print s; }') | |
23 d3_path=$(echo "$d3_list" | $AWK '{ s = sprintf ("%s%s", s, $0); } END { sub (/:$/, "", s); print s; }') | |
24 d4_path=$(echo "$d4_list" | $AWK '{ s = sprintf ("%s%s", s, $0); } END { sub (/:$/, "", s); print s; }') | |
25 | |
26 LOADPATH="$d1_path:$d2_path:$d3_path:$d4_path" | |
11 IMAGEPATH="$top_srcdir/scripts/image" | 27 IMAGEPATH="$top_srcdir/scripts/image" |
12 args="--path=$LOADPATH --image-path=$IMAGEPATH" | 28 |
29 args="--path=\"$LOADPATH\" --image-path=\"$IMAGEPATH\"" | |
30 | |
13 if [ $# -gt 0 ]; then | 31 if [ $# -gt 0 ]; then |
14 if [ "x$1" = "x-g" ]; then | 32 if [ "x$1" = "x-g" ]; then |
15 driver="gdb" | 33 driver="gdb" |
16 if [ $(/bin/pwd) = "$builddir" ]; then | 34 if [ $(/bin/pwd) = "$builddir" ]; then |
17 sed "s|^set args.*$|set args $args|" .gdbinit > .gdbinit-tmp | 35 sed "s|^set args.*$|set args $args|" .gdbinit > .gdbinit-tmp |
25 elif [ "x$1" = "x-strace" ]; then | 43 elif [ "x$1" = "x-strace" ]; then |
26 driver="strace -o octave.trace" | 44 driver="strace -o octave.trace" |
27 shift | 45 shift |
28 fi | 46 fi |
29 fi | 47 fi |
30 OCTAVE_SITE_INITFILE=$top_srcdir/scripts/startup/main-rcfile \ | 48 |
49 OCTAVE_SITE_INITFILE="$top_srcdir/scripts/startup/main-rcfile" \ | |
31 %library_path_var%="$builddir/src:$builddir/liboctave:$builddir/libcruft:$%library_path_var%" \ | 50 %library_path_var%="$builddir/src:$builddir/liboctave:$builddir/libcruft:$%library_path_var%" \ |
32 exec $driver $builddir/src/octave $args "$@" | 51 exec $driver "$builddir/src/octave" "$args" "$@" |
33 | 52 |