~gabriel1984sibiu/octave/octave

« back to all changes in this revision

Viewing changes to run-octave.in

  • Committer: Grevutiu Gabriel
  • Date: 2014-01-02 13:05:54 UTC
  • Revision ID: gabriel1984sibiu@gmail.com-20140102130554-3r7ivdjln1ni6kcg
New version (3.8.0) from upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
##
 
3
## run-octave -- run Octave in the build tree.
 
4
## 
 
5
## Copyright (C) 2006-2013 John W. Eaton
 
6
##
 
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/>.
 
22
 
 
23
AWK=%AWK%
 
24
FIND=%FIND%
 
25
SED=%SED%
 
26
 
 
27
# FIXME -- is there a better way to handle the possibility of spaces
 
28
# in these names? 
 
29
 
 
30
top_srcdir='%abs_top_srcdir%'
 
31
builddir='%builddir%'
 
32
 
 
33
d1="$top_srcdir/scripts"
 
34
d2="$builddir/scripts"
 
35
d3="$builddir/libinterp"
 
36
 
 
37
d1_list=`$FIND "$d1" -type d -a ! \( \( -name private -o -name '@*' \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'`
 
38
d2_list=`$FIND "$d2" -type d -a ! \( \( -name private -o -name '@*' \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'`
 
39
d3_list=`$FIND "$d3" -type d -a ! \( \( -name private -o -name '@*' \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'`
 
40
 
 
41
d1_path=`echo "$d1_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'`
 
42
d2_path=`echo "$d2_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'`
 
43
d3_path=`echo "$d3_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'`
 
44
 
 
45
octave_executable="$builddir/src/octave"
 
46
 
 
47
LOADPATH="$d1_path:$d2_path:$d3_path"
 
48
IMAGEPATH="$top_srcdir/scripts/image"
 
49
DOCFILE="$builddir/doc/interpreter/doc-cache"
 
50
BUILT_IN_DOCSTRINGS_FILE="$builddir/libinterp/DOCSTRINGS"
 
51
TEXIMACROSFILE="$top_srcdir/doc/interpreter/macros.texi"
 
52
INFOFILE="$top_srcdir/doc/interpreter/octave.info"
 
53
 
 
54
## Checking for string equality below with prepended x's in order to
 
55
## handle problems with empty strings.
 
56
if [ $# -gt 0 ]; then
 
57
  if [ "x$1" = "x-g" ]; then
 
58
    driver="gdb --args"
 
59
    shift
 
60
  elif [ "x$1" = "x-gud" ]; then
 
61
    ## Frontends for gdb (e.g. Emacs's GUD mode) need --annotate=3
 
62
    driver="gdb --annotate=3 --args"
 
63
    shift
 
64
  elif [ "x$1" = "x-gud2" ]; then
 
65
    ## The latest version of gud needs -i=mi. There isn't a good way to check
 
66
    ## this at configure time, so we just add a gud2 flag
 
67
    driver="gdb -i=mi --args"
 
68
    shift
 
69
  elif [ "x$1" = "x-valgrind" ]; then
 
70
    driver="valgrind --tool=memcheck"
 
71
    shift
 
72
  elif [ "x$1" = "x-strace" ]; then
 
73
    driver="strace -o octave.trace"
 
74
    shift
 
75
  elif [ "x$1" = "x-cli" ]; then
 
76
    octave_executable="$builddir/src/octave-cli"
 
77
    shift
 
78
  fi
 
79
fi
 
80
 
 
81
## We set OCTAVE_ARCHLIBDIR so that the wrapper program can find the
 
82
## octave-gui program in the build tree.  That will fail if we ever
 
83
## need Octave to find other things in ARCHLIBDIR that are not built
 
84
## in the $builddir/src directory.
 
85
 
 
86
OCTAVE_BINDIR="$builddir/src" \
 
87
OCTAVE_ARCHLIBDIR="$builddir/src" \
 
88
OCTAVE_SITE_INITFILE="$top_srcdir/scripts/startup/main-rcfile" \
 
89
OCTAVE_DEFAULT_QT_SETTINGS="$builddir/libgui/default-qt-settings" \
 
90
OCTAVE_LOCALE_DIR="$builddir/libgui/languages" \
 
91
OCTAVE_JAVA_DIR="$builddir/scripts/java" \
 
92
  exec $builddir/libtool --mode=execute $driver \
 
93
    "$octave_executable" --no-init-path --path="$LOADPATH" \
 
94
    --image-path="$IMAGEPATH" --doc-cache-file="$DOCFILE" \
 
95
    --built-in-docstrings-file="$BUILT_IN_DOCSTRINGS_FILE" \
 
96
    --texi-macros-file="$TEXIMACROSFILE" --info-file="$INFOFILE" "$@"