Mercurial > hg > octave-lyh
annotate run-octave.in @ 8005:c0d7eb662384
run-octave.in: use sed to append : to path elements
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 04 Aug 2008 22:15:34 -0400 |
parents | a74f9679535f |
children | 31f864877246 |
rev | line source |
---|---|
5786 | 1 #! /bin/sh |
7016 | 2 ## |
7017 | 3 ## run-octave -- run Octave in the build tree. |
7016 | 4 ## |
7017 | 5 ## Copyright (C) 2006, 2007 John W. Eaton |
6 ## | |
7016 | 7 ## This file is part of Octave. |
8 ## | |
9 ## Octave is free software; you can redistribute it and/or modify it | |
10 ## under the terms of the GNU General Public License as published by the | |
11 ## Free Software Foundation; either version 3 of the License, or (at | |
12 ## your option) any later version. | |
13 ## | |
14 ## Octave is distributed in the hope that it will be useful, but WITHOUT | |
15 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
16 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
17 ## for more details. | |
18 ## | |
19 ## You should have received a copy of the GNU General Public License | |
20 ## along with Octave; see the file COPYING. If not, see | |
21 ## <http://www.gnu.org/licenses/>. | |
6125 | 22 |
7244 | 23 AWK=%AWK% |
24 FIND=%FIND% | |
8005
c0d7eb662384
run-octave.in: use sed to append : to path elements
John W. Eaton <jwe@octave.org>
parents:
7579
diff
changeset
|
25 SED=%SED% |
6125 | 26 |
27 # FIXME -- is there a better way to handle the possibility of spaces | |
28 # in these names? | |
29 | |
6131 | 30 top_srcdir='%abs_top_srcdir%' |
31 builddir='%builddir%' | |
6125 | 32 |
6155 | 33 liboctinterp="$builddir/src/%liboctinterp%" |
34 liboctave="$builddir/liboctave/%liboctave%" | |
35 libcruft="$builddir/libcruft/%libcruft%" | |
36 | |
6125 | 37 d1="$top_srcdir/test" |
38 d2="$top_srcdir/scripts" | |
39 d3="$builddir/scripts" | |
40 d4="$builddir/src" | |
41 | |
8005
c0d7eb662384
run-octave.in: use sed to append : to path elements
John W. Eaton <jwe@octave.org>
parents:
7579
diff
changeset
|
42 d1_list=`$FIND "$d1" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'` |
c0d7eb662384
run-octave.in: use sed to append : to path elements
John W. Eaton <jwe@octave.org>
parents:
7579
diff
changeset
|
43 d2_list=`$FIND "$d2" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'` |
c0d7eb662384
run-octave.in: use sed to append : to path elements
John W. Eaton <jwe@octave.org>
parents:
7579
diff
changeset
|
44 d3_list=`$FIND "$d3" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'` |
c0d7eb662384
run-octave.in: use sed to append : to path elements
John W. Eaton <jwe@octave.org>
parents:
7579
diff
changeset
|
45 d4_list=`$FIND "$d4" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'` |
6125 | 46 |
6827 | 47 d1_path=`echo "$d1_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` |
48 d2_path=`echo "$d2_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` | |
49 d3_path=`echo "$d3_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` | |
50 d4_path=`echo "$d4_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` | |
6125 | 51 |
52 LOADPATH="$d1_path:$d2_path:$d3_path:$d4_path" | |
5814 | 53 IMAGEPATH="$top_srcdir/scripts/image" |
7579 | 54 INFOFILE="$builddir/doc/interpreter/octave.info" |
6125 | 55 |
5786 | 56 if [ $# -gt 0 ]; then |
57 if [ "x$1" = "x-g" ]; then | |
6987 | 58 driver="gdb --args" |
5786 | 59 shift |
60 elif [ "x$1" = "x-valgrind" ]; then | |
61 driver="valgrind --tool=memcheck" | |
62 shift | |
63 elif [ "x$1" = "x-strace" ]; then | |
64 driver="strace -o octave.trace" | |
65 shift | |
66 fi | |
67 fi | |
6125 | 68 |
7001 | 69 OCTAVE_SITE_INITFILE="$top_srcdir/scripts/startup/main-rcfile" \ |
70 LD_PRELOAD="$liboctinterp $liboctave $libcruft" \ | |
71 %library_path_var%="$builddir/src:$builddir/liboctave:$builddir/libcruft:$%library_path_var%" \ | |
7016 | 72 exec $driver "$builddir/src/octave" --no-initial-path --path="$LOADPATH" --image-path="$IMAGEPATH" --info-file="$INFOFILE" "$@" |
7001 | 73 |