Mercurial > hg > octave-nkf
annotate run-octave.in @ 9613:16907d1153d1
attempt to fix LD_PRELOAD for Cygwin
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 04 Sep 2009 11:25:44 -0400 |
parents | f9ab19428cd8 |
children | 0d4613a736e9 |
rev | line source |
---|---|
5786 | 1 #! /bin/sh |
7016 | 2 ## |
7017 | 3 ## run-octave -- run Octave in the build tree. |
7016 | 4 ## |
8920 | 5 ## Copyright (C) 2006, 2007, 2008, 2009 John W. Eaton |
7017 | 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 |
9613
16907d1153d1
attempt to fix LD_PRELOAD for Cygwin
John W. Eaton <jwe@octave.org>
parents:
9381
diff
changeset
|
33 ldpreloadsep="%ldpreloadsep%" |
6155 | 34 liboctinterp="$builddir/src/%liboctinterp%" |
35 liboctave="$builddir/liboctave/%liboctave%" | |
36 libcruft="$builddir/libcruft/%libcruft%" | |
37 | |
6125 | 38 d1="$top_srcdir/test" |
39 d2="$top_srcdir/scripts" | |
40 d3="$builddir/scripts" | |
41 d4="$builddir/src" | |
42 | |
9381
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
9132
diff
changeset
|
43 d1_list=`$FIND "$d1" -type d -a ! \( \( -name private -o -name '@*' \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'` |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
9132
diff
changeset
|
44 d2_list=`$FIND "$d2" -type d -a ! \( \( -name private -o -name '@*' \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'` |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
9132
diff
changeset
|
45 d3_list=`$FIND "$d3" -type d -a ! \( \( -name private -o -name '@*' \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'` |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
9132
diff
changeset
|
46 d4_list=`$FIND "$d4" -type d -a ! \( \( -name private -o -name '@*' \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'` |
6125 | 47 |
6827 | 48 d1_path=`echo "$d1_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` |
49 d2_path=`echo "$d2_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` | |
50 d3_path=`echo "$d3_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` | |
51 d4_path=`echo "$d4_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` | |
6125 | 52 |
53 LOADPATH="$d1_path:$d2_path:$d3_path:$d4_path" | |
5814 | 54 IMAGEPATH="$top_srcdir/scripts/image" |
8940
6994961bf1f4
use doc-cache instead of DOC for doc cache file name
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
55 DOCFILE="$builddir/doc/interpreter/doc-cache" |
7579 | 56 INFOFILE="$builddir/doc/interpreter/octave.info" |
6125 | 57 |
5786 | 58 if [ $# -gt 0 ]; then |
59 if [ "x$1" = "x-g" ]; then | |
6987 | 60 driver="gdb --args" |
5786 | 61 shift |
62 elif [ "x$1" = "x-valgrind" ]; then | |
63 driver="valgrind --tool=memcheck" | |
64 shift | |
65 elif [ "x$1" = "x-strace" ]; then | |
66 driver="strace -o octave.trace" | |
67 shift | |
68 fi | |
69 fi | |
6125 | 70 |
7001 | 71 OCTAVE_SITE_INITFILE="$top_srcdir/scripts/startup/main-rcfile" \ |
9613
16907d1153d1
attempt to fix LD_PRELOAD for Cygwin
John W. Eaton <jwe@octave.org>
parents:
9381
diff
changeset
|
72 LD_PRELOAD="$libcruft$ldpreloadsep$liboctave$ldpreloadsep$liboctinterp" \ |
7001 | 73 %library_path_var%="$builddir/src:$builddir/liboctave:$builddir/libcruft:$%library_path_var%" \ |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
8940
diff
changeset
|
74 exec $driver "$builddir/src/octave" --no-init-path --path="$LOADPATH" --image-path="$IMAGEPATH" --doc-cache-file="$DOCFILE" --info-file="$INFOFILE" "$@" |
7001 | 75 |