Mercurial > hg > octave-nkf
annotate run-octave.in @ 20772:bc6daa38ff50
eliminate more simple uses of error_state
* graphics.cc: Eliminate simple uses of error_state.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 06 Oct 2015 14:47:41 -0400 |
parents | ac0f7acdc3fd |
children | 000893937291 |
rev | line source |
---|---|
5786 | 1 #! /bin/sh |
7016 | 2 ## |
7017 | 3 ## run-octave -- run Octave in the build tree. |
19790
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
18168
diff
changeset
|
4 ## |
19898
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19793
diff
changeset
|
5 ## Copyright (C) 2006-2015 John W. Eaton |
7017 | 6 ## |
7016 | 7 ## This file is part of Octave. |
19790
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
18168
diff
changeset
|
8 ## |
7016 | 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. | |
19790
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
18168
diff
changeset
|
13 ## |
7016 | 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. | |
19790
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
18168
diff
changeset
|
18 ## |
7016 | 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 |
20640
a63f9cb609a1
run-octave: Use portable shell constructs
Mike Miller <mtmiller@octave.org>
parents:
19898
diff
changeset
|
23 : ${AWK=%AWK%} |
a63f9cb609a1
run-octave: Use portable shell constructs
Mike Miller <mtmiller@octave.org>
parents:
19898
diff
changeset
|
24 : ${FIND=%FIND%} |
a63f9cb609a1
run-octave: Use portable shell constructs
Mike Miller <mtmiller@octave.org>
parents:
19898
diff
changeset
|
25 : ${SED=%SED%} |
6125 | 26 |
27 # FIXME -- is there a better way to handle the possibility of spaces | |
19790
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
18168
diff
changeset
|
28 # in these names? |
6125 | 29 |
6131 | 30 top_srcdir='%abs_top_srcdir%' |
31 builddir='%builddir%' | |
6125 | 32 |
13187
12814f1fbbd2
Omit $top_srcdir/test directory tree from Octave's path in run-octave script
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
33 d1="$top_srcdir/scripts" |
12814f1fbbd2
Omit $top_srcdir/test directory tree from Octave's path in run-octave script
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
34 d2="$builddir/scripts" |
15195 | 35 d3="$builddir/libinterp" |
19224
d902542221c8
new data directory for storing data files we distribute
John W. Eaton <jwe@octave.org>
parents:
18168
diff
changeset
|
36 d4="$top_srcdir/examples/data" |
6125 | 37 |
9381
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
9132
diff
changeset
|
38 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
|
39 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
|
40 d3_list=`$FIND "$d3" -type d -a ! \( \( -name private -o -name '@*' \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'` |
19224
d902542221c8
new data directory for storing data files we distribute
John W. Eaton <jwe@octave.org>
parents:
18168
diff
changeset
|
41 d4_list=`$FIND "$d4" -type d -exec echo '{}' ';' | $SED 's/$/:/'` |
6125 | 42 |
6827 | 43 d1_path=`echo "$d1_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` |
44 d2_path=`echo "$d2_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` | |
45 d3_path=`echo "$d3_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` | |
19224
d902542221c8
new data directory for storing data files we distribute
John W. Eaton <jwe@octave.org>
parents:
18168
diff
changeset
|
46 d4_path=`echo "$d4_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` |
6125 | 47 |
15137
16a6b0a6855d
GUI: support for octave arguments and integrate with run-octave.
John W. Eaton <jwe@octave.org>
parents:
14614
diff
changeset
|
48 octave_executable="$builddir/src/octave" |
16a6b0a6855d
GUI: support for octave arguments and integrate with run-octave.
John W. Eaton <jwe@octave.org>
parents:
14614
diff
changeset
|
49 |
19224
d902542221c8
new data directory for storing data files we distribute
John W. Eaton <jwe@octave.org>
parents:
18168
diff
changeset
|
50 LOADPATH="$d1_path:$d2_path:$d3_path:$d4_path" |
5814 | 51 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
|
52 DOCFILE="$builddir/doc/interpreter/doc-cache" |
15470
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15335
diff
changeset
|
53 BUILT_IN_DOCSTRINGS_FILE="$builddir/libinterp/DOCSTRINGS" |
14614
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
54 TEXIMACROSFILE="$top_srcdir/doc/interpreter/macros.texi" |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9613
diff
changeset
|
55 INFOFILE="$top_srcdir/doc/interpreter/octave.info" |
6125 | 56 |
11452
e1a5bf3ea1d9
Add a GUD mode option to run-octave.in
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
9794
diff
changeset
|
57 ## Checking for string equality below with prepended x's in order to |
e1a5bf3ea1d9
Add a GUD mode option to run-octave.in
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
9794
diff
changeset
|
58 ## handle problems with empty strings. |
5786 | 59 if [ $# -gt 0 ]; then |
60 if [ "x$1" = "x-g" ]; then | |
6987 | 61 driver="gdb --args" |
5786 | 62 shift |
11452
e1a5bf3ea1d9
Add a GUD mode option to run-octave.in
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
9794
diff
changeset
|
63 elif [ "x$1" = "x-gud" ]; then |
e1a5bf3ea1d9
Add a GUD mode option to run-octave.in
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
9794
diff
changeset
|
64 ## Frontends for gdb (e.g. Emacs's GUD mode) need --annotate=3 |
e1a5bf3ea1d9
Add a GUD mode option to run-octave.in
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
9794
diff
changeset
|
65 driver="gdb --annotate=3 --args" |
e1a5bf3ea1d9
Add a GUD mode option to run-octave.in
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
9794
diff
changeset
|
66 shift |
15335
5187c3ea5a68
run-octave.in: Add -gud2 option to support new versions of gud
Max Brister <max@2bass.com>
parents:
15249
diff
changeset
|
67 elif [ "x$1" = "x-gud2" ]; then |
5187c3ea5a68
run-octave.in: Add -gud2 option to support new versions of gud
Max Brister <max@2bass.com>
parents:
15249
diff
changeset
|
68 ## The latest version of gud needs -i=mi. There isn't a good way to check |
16036
dd583c258cf9
Fix trivial typo in run-octave.in comment
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
15971
diff
changeset
|
69 ## this at configure time, so we just add a gud2 flag |
15335
5187c3ea5a68
run-octave.in: Add -gud2 option to support new versions of gud
Max Brister <max@2bass.com>
parents:
15249
diff
changeset
|
70 driver="gdb -i=mi --args" |
5187c3ea5a68
run-octave.in: Add -gud2 option to support new versions of gud
Max Brister <max@2bass.com>
parents:
15249
diff
changeset
|
71 shift |
5786 | 72 elif [ "x$1" = "x-valgrind" ]; then |
73 driver="valgrind --tool=memcheck" | |
74 shift | |
19351
eeb22763138b
Add --callgrind option to run-octave to run with profiling.
Rik <rik@octave.org>
parents:
19224
diff
changeset
|
75 elif [ "x$1" = "x-callgrind" ]; then |
eeb22763138b
Add --callgrind option to run-octave to run with profiling.
Rik <rik@octave.org>
parents:
19224
diff
changeset
|
76 driver="valgrind --tool=callgrind" |
eeb22763138b
Add --callgrind option to run-octave to run with profiling.
Rik <rik@octave.org>
parents:
19224
diff
changeset
|
77 shift |
5786 | 78 elif [ "x$1" = "x-strace" ]; then |
79 driver="strace -o octave.trace" | |
80 shift | |
15139
bfc220d1de67
include gui in default Octave binary
John W. Eaton <jwe@octave.org>
parents:
15137
diff
changeset
|
81 elif [ "x$1" = "x-cli" ]; then |
bfc220d1de67
include gui in default Octave binary
John W. Eaton <jwe@octave.org>
parents:
15137
diff
changeset
|
82 octave_executable="$builddir/src/octave-cli" |
15137
16a6b0a6855d
GUI: support for octave arguments and integrate with run-octave.
John W. Eaton <jwe@octave.org>
parents:
14614
diff
changeset
|
83 shift |
5786 | 84 fi |
85 fi | |
6125 | 86 |
18168
525af54479eb
allow run-octave to find octave-gui program
John W. Eaton <jwe@octave.org>
parents:
17778
diff
changeset
|
87 ## We set OCTAVE_ARCHLIBDIR so that the wrapper program can find the |
525af54479eb
allow run-octave to find octave-gui program
John W. Eaton <jwe@octave.org>
parents:
17778
diff
changeset
|
88 ## octave-gui program in the build tree. That will fail if we ever |
525af54479eb
allow run-octave to find octave-gui program
John W. Eaton <jwe@octave.org>
parents:
17778
diff
changeset
|
89 ## need Octave to find other things in ARCHLIBDIR that are not built |
525af54479eb
allow run-octave to find octave-gui program
John W. Eaton <jwe@octave.org>
parents:
17778
diff
changeset
|
90 ## in the $builddir/src directory. |
525af54479eb
allow run-octave to find octave-gui program
John W. Eaton <jwe@octave.org>
parents:
17778
diff
changeset
|
91 |
20640
a63f9cb609a1
run-octave: Use portable shell constructs
Mike Miller <mtmiller@octave.org>
parents:
19898
diff
changeset
|
92 OCTAVE_ARCHLIBDIR="$builddir/src"; export OCTAVE_ARCHLIBDIR |
a63f9cb609a1
run-octave: Use portable shell constructs
Mike Miller <mtmiller@octave.org>
parents:
19898
diff
changeset
|
93 OCTAVE_BINDIR="$builddir/src"; export OCTAVE_BINDIR |
a63f9cb609a1
run-octave: Use portable shell constructs
Mike Miller <mtmiller@octave.org>
parents:
19898
diff
changeset
|
94 OCTAVE_DEFAULT_QT_SETTINGS="$builddir/libgui/default-qt-settings"; export OCTAVE_DEFAULT_QT_SETTINGS |
a63f9cb609a1
run-octave: Use portable shell constructs
Mike Miller <mtmiller@octave.org>
parents:
19898
diff
changeset
|
95 OCTAVE_JAVA_DIR="$builddir/scripts/java"; export OCTAVE_JAVA_DIR |
a63f9cb609a1
run-octave: Use portable shell constructs
Mike Miller <mtmiller@octave.org>
parents:
19898
diff
changeset
|
96 OCTAVE_LOCALE_DIR="$builddir/libgui/languages"; export OCTAVE_LOCALE_DIR |
20689
ac0f7acdc3fd
avoid executing startup file twice when using run-octave script (bug #45872)
John W. Eaton <jwe@octave.org>
parents:
20640
diff
changeset
|
97 OCTAVE_SITE_INITFILE="$top_srcdir/scripts/startup/site-rcfile"; export OCTAVE_SITE_INITFILE |
ac0f7acdc3fd
avoid executing startup file twice when using run-octave script (bug #45872)
John W. Eaton <jwe@octave.org>
parents:
20640
diff
changeset
|
98 OCTAVE_VERSION_INITFILE="$top_srcdir/scripts/startup/version-rcfile"; export OCTAVE_VERSION_INITFILE |
20640
a63f9cb609a1
run-octave: Use portable shell constructs
Mike Miller <mtmiller@octave.org>
parents:
19898
diff
changeset
|
99 |
a63f9cb609a1
run-octave: Use portable shell constructs
Mike Miller <mtmiller@octave.org>
parents:
19898
diff
changeset
|
100 exec $builddir/libtool --mode=execute $driver \ |
a63f9cb609a1
run-octave: Use portable shell constructs
Mike Miller <mtmiller@octave.org>
parents:
19898
diff
changeset
|
101 "$octave_executable" --no-init-path --path="$LOADPATH" \ |
a63f9cb609a1
run-octave: Use portable shell constructs
Mike Miller <mtmiller@octave.org>
parents:
19898
diff
changeset
|
102 --image-path="$IMAGEPATH" --doc-cache-file="$DOCFILE" \ |
a63f9cb609a1
run-octave: Use portable shell constructs
Mike Miller <mtmiller@octave.org>
parents:
19898
diff
changeset
|
103 --built-in-docstrings-file="$BUILT_IN_DOCSTRINGS_FILE" \ |
a63f9cb609a1
run-octave: Use portable shell constructs
Mike Miller <mtmiller@octave.org>
parents:
19898
diff
changeset
|
104 --texi-macros-file="$TEXIMACROSFILE" --info-file="$INFOFILE" "$@" |