annotate libinterp/corefcn/defaults.cc @ 25460:627d6bde9b8d

solve installation info initialization problem differently Back out changesets 893344cee100 and 69fc8935020b. * defaults.h, defaults.cc: Instead of storing installation info like include_dir, data_dir, info_dir, etc., in file-scope static variables or a class object owned by the interpreter, store the initialized values as constants inside the functions that return them. This way they are initialized on demand and we don't have to worry about initialization order of static data. It's OK for these to be static because even though they may require some computation to intialize (looking at environment variables or substituting the value of OCTAVE_HOME), they are constants for any given installation of Octave and will be the same for any instantiation of the interpreter. Only include defaults.h in files that actually need it.
author John W. Eaton <jwe@octave.org>
date Tue, 12 Jun 2018 13:03:04 -0400
parents
children c71d13bf2b63
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25460
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 /*
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 Copyright (C) 1996-2018 John W. Eaton
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5 This file is part of Octave.
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7 Octave is free software: you can redistribute it and/or modify it
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 under the terms of the GNU General Public License as published by
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 the Free Software Foundation, either version 3 of the License, or
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 (at your option) any later version.
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 WITHOUT ANY WARRANTY; without even the implied warranty of
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 GNU General Public License for more details.
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, see
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 <https://www.gnu.org/licenses/>.
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
21 */
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
23 #if defined (HAVE_CONFIG_H)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
24 # include "config.h"
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25 #endif
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 #include <cstdlib>
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 #include <algorithm>
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30 #include <string>
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 #include "dir-ops.h"
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 #include "file-ops.h"
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 #include "oct-env.h"
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 #include "defaults.h"
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 #include "defun.h"
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38 #include "error.h"
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 #include "file-ops.h"
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 #include "ovl.h"
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41 #include "ov.h"
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42 #include "variables.h"
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43 #include "version.h"
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45 #include "default-defs.h"
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47 namespace octave
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49 namespace config
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51 // Variables that name directories or files are substituted into source
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 // files with "${prefix}/" stripped from the beginning of the string.
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 // All configure variables of this form should be specified as absolute
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55 // directory names. The only ones that should not be absolute here are
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56 // ones that have had "${prefix}/" or "${exec_prefix} stripped.
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58 static std::string
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 prepend_home_dir (const std::string& hd, const std::string& s)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61 std::string retval = s;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
63 char dir_sep_char = sys::file_ops::dir_sep_char ();
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
64
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
65 if (! sys::env::absolute_pathname (retval))
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
66 retval = hd + dir_sep_char + s;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
67
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68 if (dir_sep_char != '/')
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
69 std::replace (retval.begin (), retval.end (), '/', dir_sep_char);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71 return retval;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74 static std::string get_octave_home (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
76 std::string op = OCTAVE_PREFIX;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
77
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78 std::string oh = sys::env::getenv ("OCTAVE_HOME");
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
79
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
80 // If OCTAVE_HOME is set in the enviornment, use that. Otherwise,
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
81 // default to ${prefix} from configure.
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
82
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
83 return oh.empty () ? op : oh;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
84 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
85
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
86 static std::string get_octave_exec_home (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
87 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
88 std::string op = OCTAVE_PREFIX;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
89 std::string oep = OCTAVE_EXEC_PREFIX;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
90
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
91 std::string oh = sys::env::getenv ("OCTAVE_HOME");
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
92 std::string oeh = sys::env::getenv ("OCTAVE_EXEC_HOME");
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
93
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
94 // If OCTAVE_EXEC_HOME is set in the environment, use that.
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
95 // Otherwise, if ${prefix} and ${exec_prefix} from configure are set
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
96 // to the same value, use OCTAVE_HOME from the environment if it is set.
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
97 // Othewise, default to ${exec_prefix} from configure.
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
98
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
99 if (! oeh.empty ())
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
100 return oeh;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
101
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
102 if (op == oep && ! oh.empty ())
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
103 return oh;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
104
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
105 return oep;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
106 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
107
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
108 static std::string get_local_site_defaults_file (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
109 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
110 std::string lsf = sys::env::getenv ("OCTAVE_SITE_INITFILE");
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
111
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
112 return lsf.empty () ? local_startupfile_dir () + "/octaverc" : lsf;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
113 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
114
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
115 static std::string get_site_defaults_file (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
116 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
117 std::string sf = sys::env::getenv ("OCTAVE_VERSION_INITFILE");
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
118
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
119 return sf.empty () ? startupfile_dir () + "/octaverc" : sf;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
120 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
121
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
122 std::string prepend_octave_home (const std::string& s)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
123 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
124 return prepend_home_dir (octave_home (), s);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
125 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
126
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
127 std::string prepend_octave_exec_home (const std::string& s)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
128 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
129 return prepend_home_dir (octave_exec_home (), s);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
130 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
131
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
132 std::string canonical_host_type (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
133 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
134 static const std::string s_canonical_host_type
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
135 = OCTAVE_CANONICAL_HOST_TYPE;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
136
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
137 return s_canonical_host_type;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
138 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
139
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
140 std::string release (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
141 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
142 static const std::string s_octave_release = OCTAVE_RELEASE;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
143
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
144 return s_octave_release;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
145 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
146
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
147 std::string default_pager (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
148 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
149 static const std::string s_default_pager = OCTAVE_DEFAULT_PAGER;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
150
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
151 return s_default_pager;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
152 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
153
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
154 std::string octave_home (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
155 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
156 static const std::string s_octave_home = get_octave_home ();
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
157
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
158 return s_octave_home;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
159 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
160
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
161 std::string octave_exec_home (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
162 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
163 static const std::string s_octave_exec_home = get_octave_exec_home ();
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
164
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
165 return s_octave_exec_home;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
166 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
167
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
168 std::string bin_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
169 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
170 static const std::string s_bin_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
171 = prepend_octave_exec_home (OCTAVE_BINDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
172
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
173 return s_bin_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
174 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
175
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
176 std::string data_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
177 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
178 static const std::string s_data_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
179 = prepend_octave_home (OCTAVE_DATADIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
180
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
181 return s_data_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
182 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
183
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
184 std::string dataroot_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
185 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
186 static const std::string s_dataroot_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
187 = prepend_octave_home (OCTAVE_DATAROOTDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
188
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
189 return s_dataroot_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
190 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
191
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
192 std::string include_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
193 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
194 static const std::string s_include_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
195 = prepend_octave_home (OCTAVE_INCLUDEDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
196
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
197 return s_include_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
198 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
199
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
200 std::string lib_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
201 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
202 static const std::string s_lib_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
203 = prepend_octave_exec_home (OCTAVE_LIBDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
204
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
205 return s_lib_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
206 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
207
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
208 std::string libexec_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
209 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
210 static const std::string s_libexec_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
211 = prepend_octave_exec_home (OCTAVE_LIBEXECDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
212
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
213 return s_libexec_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
214 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
215
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
216 std::string arch_lib_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
217 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
218 static const std::string s_arch_lib_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
219 = prepend_octave_exec_home (OCTAVE_ARCHLIBDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
220
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
221 return s_arch_lib_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
222 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
223
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
224 std::string info_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
225 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
226 static const std::string s_info_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
227 = prepend_octave_exec_home (OCTAVE_INFODIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
228
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
229 return s_info_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
230 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
231
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
232 std::string local_ver_arch_lib_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
233 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
234 static const std::string s_local_ver_arch_lib_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
235 = prepend_octave_exec_home (OCTAVE_LOCALVERARCHLIBDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
236
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
237 return s_local_ver_arch_lib_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
238 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
239
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
240 std::string local_api_arch_lib_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
241 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
242 static const std::string s_local_api_arch_lib_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
243 = prepend_octave_exec_home (OCTAVE_LOCALAPIARCHLIBDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
244
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
245 return s_local_api_arch_lib_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
246 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
247
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
248 std::string local_arch_lib_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
249 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
250 static const std::string s_local_arch_lib_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
251 = prepend_octave_exec_home (OCTAVE_LOCALARCHLIBDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
252
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
253 return s_local_arch_lib_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
254 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
255
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
256 std::string local_ver_oct_file_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
257 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
258 static const std::string s_local_ver_oct_file_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
259 = prepend_octave_exec_home (OCTAVE_LOCALVEROCTFILEDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
260
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
261 return s_local_ver_oct_file_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
262 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
263
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
264 std::string local_api_oct_file_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
265 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
266 static const std::string s_local_api_oct_file_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
267 = prepend_octave_exec_home (OCTAVE_LOCALAPIOCTFILEDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
268
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
269 return s_local_api_oct_file_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
270 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
271
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
272 std::string local_oct_file_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
273 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
274 static const std::string s_local_oct_file_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
275 = prepend_octave_exec_home (OCTAVE_LOCALOCTFILEDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
276
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
277 return s_local_oct_file_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
278 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
279
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
280 std::string oct_file_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
281 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
282 static const std::string s_oct_file_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
283 = prepend_octave_exec_home (OCTAVE_OCTFILEDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
284
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
285 return s_oct_file_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
286 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
287
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
288 std::string local_ver_fcn_file_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
289 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
290 static const std::string s_local_ver_fcn_file_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
291 = prepend_octave_home (OCTAVE_LOCALVERFCNFILEDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
292
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
293 return s_local_ver_fcn_file_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
294 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
295
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
296 std::string local_api_fcn_file_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
297 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
298 static const std::string s_local_api_fcn_file_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
299 = prepend_octave_home (OCTAVE_LOCALAPIFCNFILEDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
300
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
301 return s_local_api_fcn_file_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
302 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
303
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
304 std::string local_fcn_file_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
305 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
306 static const std::string s_local_fcn_file_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
307 = prepend_octave_home (OCTAVE_LOCALFCNFILEDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
308
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
309 return s_local_fcn_file_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
310 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
311
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
312 std::string fcn_file_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
313 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
314 static const std::string s_fcn_file_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
315 = prepend_octave_home (OCTAVE_FCNFILEDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
316
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
317 return s_fcn_file_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
318 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
319
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
320 std::string oct_data_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
321 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
322 static const std::string s_oct_data_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
323 = prepend_octave_home (OCTAVE_OCTDATADIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
324
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
325 return s_oct_data_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
326 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
327
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
328 std::string oct_doc_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
329 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
330 static const std::string s_oct_doc_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
331 = prepend_octave_home (OCTAVE_OCTDOCDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
332
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
333 return s_oct_doc_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
334 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
335
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
336 std::string oct_etc_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
337 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
338 static const std::string s_oct_etc_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
339 = prepend_octave_home (OCTAVE_OCTETCDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
340
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
341 return s_oct_etc_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
342 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
343
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
344 std::string oct_fonts_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
345 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
346 static const std::string s_oct_fonts_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
347 = prepend_octave_home (OCTAVE_OCTFONTSDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
348
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
349 return s_oct_fonts_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
350 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
351
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
352 std::string oct_include_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
353 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
354 static const std::string s_oct_include_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
355 = prepend_octave_home (OCTAVE_OCTINCLUDEDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
356
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
357 return s_oct_include_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
358 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
359
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
360 std::string oct_lib_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
361 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
362 static const std::string s_oct_lib_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
363 = prepend_octave_exec_home (OCTAVE_OCTLIBDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
364
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
365 return s_oct_lib_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
366 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
367
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
368 std::string oct_locale_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
369 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
370 static const std::string s_oct_locale_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
371 = prepend_octave_home (OCTAVE_OCTLOCALEDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
372
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
373 return s_oct_locale_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
374 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
375
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
376 std::string oct_tests_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
377 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
378 static const std::string s_oct_tests_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
379 = prepend_octave_home (OCTAVE_OCTTESTSDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
380
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
381 return s_oct_tests_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
382 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
383
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
384 std::string man_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
385 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
386 static const std::string s_man_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
387 = prepend_octave_home (OCTAVE_MANDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
388
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
389 return s_man_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
390 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
391
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
392 std::string man1_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
393 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
394 static const std::string s_man1_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
395 = prepend_octave_home (OCTAVE_MAN1DIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
396
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
397 return s_man1_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
398 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
399
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
400 std::string man1_ext (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
401 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
402 static const std::string s_man1_ext = OCTAVE_MAN1EXT;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
403
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
404 return s_man1_ext;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
405 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
406
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
407 std::string image_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
408 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
409 static const std::string s_image_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
410 = prepend_octave_home (OCTAVE_IMAGEDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
411
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
412 return s_image_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
413 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
414
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
415 std::string local_startupfile_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
416 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
417 static const std::string s_local_startupfile_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
418 = prepend_octave_home (OCTAVE_LOCALSTARTUPFILEDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
419
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
420 return s_local_startupfile_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
421 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
422
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
423 std::string startupfile_dir (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
424 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
425 static const std::string s_startupfile_dir
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
426 = prepend_octave_home (OCTAVE_STARTUPFILEDIR);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
427
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
428 return s_startupfile_dir;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
429 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
430
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
431 std::string local_site_defaults_file (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
432 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
433 static const std::string s_local_site_defaults_file
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
434 = get_local_site_defaults_file ();
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
435
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
436 return s_local_site_defaults_file;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
437 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
438
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
439 std::string site_defaults_file (void)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
440 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
441 static const std::string s_site_defaults_file
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
442 = get_site_defaults_file ();
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
443
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
444 return s_site_defaults_file;
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
445 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
446 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
447 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
448
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
449
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
450 DEFUN (OCTAVE_HOME, args, ,
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
451 doc: /* -*- texinfo -*-
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
452 @deftypefn {} {} OCTAVE_HOME ()
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
453 Return the name of the top-level Octave installation directory.
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
454 OCTAVE_HOME corresponds to the configuration variable @var{prefix}.
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
455 @seealso{EXEC_PATH, IMAGE_PATH, OCTAVE_EXEC_HOME}
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
456 @end deftypefn */)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
457 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
458 if (args.length () != 0)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
459 print_usage ();
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
460
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
461 return ovl (octave::config::octave_home ());
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
462 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
463
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
464 /*
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
465 %!assert (ischar (OCTAVE_HOME ()))
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
466 %!error OCTAVE_HOME (1)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
467 */
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
468
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
469 DEFUN (OCTAVE_EXEC_HOME, args, ,
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
470 doc: /* -*- texinfo -*-
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
471 @deftypefn {} {} OCTAVE_HOME ()
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
472 Return the name of the top-level Octave installation directory for
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
473 architecture-dependent files. If not specified separately, the value
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
474 is the same as OCTAVE_HOME@. OCTAVE_EXEC_HOME corresponds to the
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
475 configuration variable @var{exec_prefix}.
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
476 @seealso{EXEC_PATH, IMAGE_PATH, OCTAVE_HOME}
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
477 @end deftypefn */)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
478 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
479 if (args.length () != 0)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
480 print_usage ();
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
481
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
482 return ovl (octave::config::octave_exec_home ());
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
483 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
484
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
485 /*
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
486 %!assert (ischar (OCTAVE_EXEC_HOME ()))
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
487 %!error OCTAVE_EXEC_HOME (1)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
488 */
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
489
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
490 DEFUNX ("OCTAVE_VERSION", FOCTAVE_VERSION, args, ,
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
491 doc: /* -*- texinfo -*-
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
492 @deftypefn {} {} OCTAVE_VERSION ()
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
493 Return the version number of Octave as a string.
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
494 @seealso{ver, version}
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
495 @end deftypefn */)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
496 {
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
497 if (args.length () != 0)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
498 print_usage ();
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
499
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
500 return ovl (OCTAVE_VERSION);
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
501 }
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
502
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
503 /*
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
504 %!assert (ischar (OCTAVE_VERSION ()))
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
505 %!error OCTAVE_VERSION (1)
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents:
diff changeset
506 */