Mercurial > octave
annotate libinterp/corefcn/toplev.cc @ 26826:20881d195d20
fix handling of SIGTSTP (bug #51903)
* interpreter.cc (interpreter::interpreter): Unblock SIGTSTP signal in
interpreter thread.
* toplev.cc (Fsystem): Unblock SIGTSTP before creating a subprocess.
* main.in.cc (main): Block SIGTSTP when starting Octave process so it
is blocked in all threads.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 03 Mar 2019 19:20:50 +0000 |
parents | 8af641520aa9 |
children | 711f23332204 |
rev | line source |
---|---|
1683 | 1 /* |
2 | |
26376
00f796120a6d
maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents:
26229
diff
changeset
|
3 Copyright (C) 1995-2019 John W. Eaton |
1683 | 4 |
5 This file is part of Octave. | |
6 | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24009
diff
changeset
|
7 Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22501
diff
changeset
|
8 under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24009
diff
changeset
|
9 the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22501
diff
changeset
|
10 (at your option) any later version. |
1683 | 11 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22501
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22501
diff
changeset
|
13 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22501
diff
changeset
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22501
diff
changeset
|
15 GNU General Public License for more details. |
1683 | 16 |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24009
diff
changeset
|
19 <https://www.gnu.org/licenses/>. |
1683 | 20 |
21 */ | |
22 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21618
diff
changeset
|
23 #if defined (HAVE_CONFIG_H) |
21301
40de9f8f23a6
Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents:
21253
diff
changeset
|
24 # include "config.h" |
1683 | 25 #endif |
26 | |
4489 | 27 #include <cerrno> |
1683 | 28 #include <cstdlib> |
25438
cb1606f78f6b
prefer <istream>, <ostream>, or <iosfwd> to <iostream> where possible
John W. Eaton <jwe@octave.org>
parents:
25284
diff
changeset
|
29 |
4221 | 30 #include <new> |
5765 | 31 #include <sstream> |
1728 | 32 #include <string> |
33 | |
21979
d04da18a407a
use OCTAVE_USE_WINDOWS_API more consistently
John W. Eaton <jwe@octave.org>
parents:
21966
diff
changeset
|
34 #if defined (OCTAVE_USE_WINDOWS_API) |
21949
baeffde5c87d
fix build for Windows systems
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
35 # define WIN32_LEAN_AND_MEAN 1 |
baeffde5c87d
fix build for Windows systems
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
36 # include <windows.h> |
baeffde5c87d
fix build for Windows systems
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
37 #endif |
baeffde5c87d
fix build for Windows systems
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
38 |
22264
9b78fda78300
fix build failure for --without-z (bug #48757)
John W. Eaton <jwe@octave.org>
parents:
22094
diff
changeset
|
39 #include "async-system-wrapper.h" |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
22091
diff
changeset
|
40 #include "child-list.h" |
1683 | 41 #include "lo-error.h" |
21600
184b85b31e03
more updates for version function
mmuetzel <markus.muetzel@gmx.de>
parents:
21598
diff
changeset
|
42 #include "oct-fftw.h" |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
13981
diff
changeset
|
43 #include "oct-locbuf.h" |
21921
ecfcc8527661
hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
21907
diff
changeset
|
44 #include "oct-syscalls.h" |
25284
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
45 #include "signal-wrappers.h" |
1755 | 46 #include "str-vec.h" |
21899 | 47 #include "wait-for-input.h" |
1683 | 48 |
21220
d78e45987d6a
rename octave::build_env namespace from octave::config
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
49 #include "build-env.h" |
21607
37f6ed8a6f1b
store liboctave and liboctinterp hg ids separately
John W. Eaton <jwe@octave.org>
parents:
21605
diff
changeset
|
50 #include "liboctinterp-build-info.h" |
22091
0f6fc2ec3b1a
move call_stack class to a separate file
John W. Eaton <jwe@octave.org>
parents:
22089
diff
changeset
|
51 #include "call-stack.h" |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
13981
diff
changeset
|
52 #include "defaults.h" |
1683 | 53 #include "defun.h" |
54 #include "error.h" | |
55 #include "file-io.h" | |
23712
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23577
diff
changeset
|
56 #include "help.h" |
24734
5d8c4cbc56d7
don't use singleton pattern for child_list
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
57 #include "interpreter-private.h" |
22089
c2c668b3051b
use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents:
22051
diff
changeset
|
58 #include "octave.h" |
2162 | 59 #include "oct-map.h" |
20940
48b2ad5ee801
maint: Rename oct-obj.[cc|h] to ovl.[cc|h] for clarity.
Rik <rik@octave.org>
parents:
20939
diff
changeset
|
60 #include "ovl.h" |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
13981
diff
changeset
|
61 #include "ov.h" |
1683 | 62 #include "pager.h" |
63 #include "procstream.h" | |
64 #include "sysdep.h" | |
65 #include "unwind-prot.h" | |
66 #include "utils.h" | |
23466
5da300c55e89
use "" instead of <> for including defaults.h and version.h
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
67 #include "version.h" |
1683 | 68 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21618
diff
changeset
|
69 #if ! defined (SHELL_PATH) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
21182
diff
changeset
|
70 # define SHELL_PATH "/bin/sh" |
15756
ea1a1fb00744
Make the path to the shell interpreter configuable
Mike Miller <mtmiller@ieee.org>
parents:
15596
diff
changeset
|
71 #endif |
ea1a1fb00744
Make the path to the shell interpreter configuable
Mike Miller <mtmiller@ieee.org>
parents:
15596
diff
changeset
|
72 |
1957 | 73 DEFUN (warranty, , , |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
74 doc: /* -*- texinfo -*- |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
75 @deftypefn {} {} warranty () |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
76 Describe the conditions for copying and distributing Octave. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
77 @end deftypefn */) |
1683 | 78 { |
17510
7542f4496974
eliminate some macros in version.h
John W. Eaton <jwe@octave.org>
parents:
17281
diff
changeset
|
79 octave_stdout << "\n" << octave_name_version_and_copyright () << "\n\ |
3922 | 80 \n\ |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24009
diff
changeset
|
81 GNU Octave is free software: you can redistribute it and/or modify it\n\ |
24007
e8a74d95b4f3
maint: Use same format for Copyright statement throught code base.
Rik <rik@octave.org>
parents:
23990
diff
changeset
|
82 under the terms of the GNU General Public License as published by\n\ |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24009
diff
changeset
|
83 the Free Software Foundation, either version 3 of the License, or\n\ |
1683 | 84 (at your option) any later version.\n\ |
85 \n\ | |
26177
f2d795f07c84
maint: Use standard copyright phrasing in all files.
Rik <rik@octave.org>
parents:
25931
diff
changeset
|
86 GNU Octave is distributed in the hope that it will be useful, but\n\ |
f2d795f07c84
maint: Use standard copyright phrasing in all files.
Rik <rik@octave.org>
parents:
25931
diff
changeset
|
87 WITHOUT ANY WARRANTY; without even the implied warranty of\n\ |
1683 | 88 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\ |
89 GNU General Public License for more details.\n\ | |
90 \n\ | |
91 You should have received a copy of the GNU General Public License\n\ | |
24007
e8a74d95b4f3
maint: Use same format for Copyright statement throught code base.
Rik <rik@octave.org>
parents:
23990
diff
changeset
|
92 along with GNU Octave; see the file COPYING. If not, see\n\ |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24009
diff
changeset
|
93 <https://www.gnu.org/licenses/>.\n\ |
1683 | 94 \n"; |
95 | |
21078
49852ff04747
maint: Remove unnecessary declarations of retval.
Rik <rik@octave.org>
parents:
21055
diff
changeset
|
96 return ovl (); |
1683 | 97 } |
98 | |
99 // Execute a shell command. | |
100 | |
2086 | 101 static octave_value_list |
3523 | 102 run_command_and_return_output (const std::string& cmd_str) |
2083 | 103 { |
2086 | 104 octave_value_list retval; |
21743
f4d7d0eb5b0c
use namespace for unwind_protect class
John W. Eaton <jwe@octave.org>
parents:
21739
diff
changeset
|
105 octave::unwind_protect frame; |
2083 | 106 |
107 iprocstream *cmd = new iprocstream (cmd_str.c_str ()); | |
24734
5d8c4cbc56d7
don't use singleton pattern for child_list
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
108 frame.add_delete (cmd); |
2083 | 109 |
24734
5d8c4cbc56d7
don't use singleton pattern for child_list
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
110 octave::child_list& kids |
5d8c4cbc56d7
don't use singleton pattern for child_list
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
111 = octave::__get_child_list__ ("run_command_and_return_output"); |
5d8c4cbc56d7
don't use singleton pattern for child_list
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
112 frame.add_method (kids, &octave::child_list::remove, cmd->pid ()); |
3060 | 113 |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
114 if (! *cmd) |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
115 error ("system: unable to start subprocess for '%s'", cmd_str.c_str ()); |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
116 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
117 int fid = cmd->file_number (); |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
118 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
119 std::ostringstream output_buf; |
2095 | 120 |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
121 char ch; |
4494 | 122 |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
123 for (;;) |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
124 { |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
125 if (cmd->get (ch)) |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
126 output_buf.put (ch); |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
127 else |
10212
56f7734f5448
fix process creation failure handling in system()
Jaroslav Hajek <highegg@gmail.com>
parents:
10186
diff
changeset
|
128 { |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
129 if (! cmd->eof () && errno == EAGAIN) |
10212
56f7734f5448
fix process creation failure handling in system()
Jaroslav Hajek <highegg@gmail.com>
parents:
10186
diff
changeset
|
130 { |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
131 cmd->clear (); |
3147 | 132 |
21899 | 133 if (octave_wait_for_input (fid) != 1) |
10212
56f7734f5448
fix process creation failure handling in system()
Jaroslav Hajek <highegg@gmail.com>
parents:
10186
diff
changeset
|
134 break; |
56f7734f5448
fix process creation failure handling in system()
Jaroslav Hajek <highegg@gmail.com>
parents:
10186
diff
changeset
|
135 } |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
136 else |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
137 break; |
10212
56f7734f5448
fix process creation failure handling in system()
Jaroslav Hajek <highegg@gmail.com>
parents:
10186
diff
changeset
|
138 } |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
139 } |
3147 | 140 |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
141 int cmd_status = cmd->close (); |
2083 | 142 |
21921
ecfcc8527661
hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
21907
diff
changeset
|
143 if (octave::sys::wifexited (cmd_status)) |
ecfcc8527661
hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
21907
diff
changeset
|
144 cmd_status = octave::sys::wexitstatus (cmd_status); |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
145 else |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
146 cmd_status = 127; |
2083 | 147 |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
148 retval = ovl (cmd_status, output_buf.str ()); |
2083 | 149 |
150 return retval; | |
151 } | |
152 | |
25284
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
153 // Combine alloc+get in one action. |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
154 |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
155 static void * |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
156 get_signal_mask (void) |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
157 { |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
158 void *mask = octave_alloc_signal_mask (); |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
159 |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
160 octave_get_signal_mask (mask); |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
161 |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
162 return mask; |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
163 } |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
164 |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
165 // Combine set+free in one action. |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
166 |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
167 static void |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
168 restore_signal_mask (void *mask) |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
169 { |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
170 octave_set_signal_mask (mask); |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
171 |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
172 octave_free_signal_mask (mask); |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
173 } |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
174 |
5285 | 175 enum system_exec_type { et_sync, et_async }; |
176 | |
1957 | 177 DEFUN (system, args, nargout, |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
178 doc: /* -*- texinfo -*- |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
179 @deftypefn {} {} system ("@var{string}") |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
180 @deftypefnx {} {} system ("@var{string}", @var{return_output}) |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
181 @deftypefnx {} {} system ("@var{string}", @var{return_output}, @var{type}) |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
182 @deftypefnx {} {[@var{status}, @var{output}] =} system (@dots{}) |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
183 Execute a shell command specified by @var{string}. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
184 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
185 If the optional argument @var{type} is @qcode{"async"}, the process is |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
186 started in the background and the process ID of the child process is |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
187 returned immediately. Otherwise, the child process is started and Octave |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
188 waits until it exits. If the @var{type} argument is omitted, it defaults to |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
189 the value @qcode{"sync"}. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
190 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
191 If @var{system} is called with one or more output arguments, or if the |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
192 optional argument @var{return_output} is true and the subprocess is started |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
193 synchronously, then the output from the command is returned as a variable. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
194 Otherwise, if the subprocess is executed synchronously, its output is sent |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
195 to the standard output. To send the output of a command executed with |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
196 @code{system} through the pager, use a command like |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
197 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
198 @example |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
199 @group |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
200 [~, text] = system ("cmd"); |
24801
daf61c7dfcae
Change default status of pager to "off" (bug #53217).
Rik <rik@octave.org>
parents:
24734
diff
changeset
|
201 more on; |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
202 disp (text); |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
203 @end group |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
204 @end example |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
205 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
206 @noindent |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
207 or |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
208 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
209 @example |
24801
daf61c7dfcae
Change default status of pager to "off" (bug #53217).
Rik <rik@octave.org>
parents:
24734
diff
changeset
|
210 @group |
daf61c7dfcae
Change default status of pager to "off" (bug #53217).
Rik <rik@octave.org>
parents:
24734
diff
changeset
|
211 more on; |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
212 printf ("%s\n", nthargout (2, "system", "cmd")); |
24801
daf61c7dfcae
Change default status of pager to "off" (bug #53217).
Rik <rik@octave.org>
parents:
24734
diff
changeset
|
213 @end group |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
214 @end example |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
215 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
216 The @code{system} function can return two values. The first is the |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
217 exit status of the command and the second is any output from the |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
218 command that was written to the standard output stream. For example, |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
219 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
220 @example |
24009
eef8c31ffe97
Document that the shell for system() differs between OS (bug #49825).
Rik <rik@octave.org>
parents:
24007
diff
changeset
|
221 [status, output] = system ("echo foo & exit 2"); |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
222 @end example |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
223 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
224 @noindent |
25472
9771111f04f4
doc: Use @var rather than @code to mark inputs to functions in docstrings.
Rik <rik@octave.org>
parents:
25284
diff
changeset
|
225 will set the variable @var{output} to the string @samp{foo}, and the |
9771111f04f4
doc: Use @var rather than @code to mark inputs to functions in docstrings.
Rik <rik@octave.org>
parents:
25284
diff
changeset
|
226 variable @var{status} to the integer @samp{2}. |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
227 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
228 For commands run asynchronously, @var{status} is the process id of the |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
229 command shell that is started to run the command. |
24009
eef8c31ffe97
Document that the shell for system() differs between OS (bug #49825).
Rik <rik@octave.org>
parents:
24007
diff
changeset
|
230 |
eef8c31ffe97
Document that the shell for system() differs between OS (bug #49825).
Rik <rik@octave.org>
parents:
24007
diff
changeset
|
231 The shell used for executing commands varies with operating system and is |
25003
2365c2661b3c
doc: Spellcheck documentation ahead of 4.4 release.
Rik <rik@octave.org>
parents:
24899
diff
changeset
|
232 typically @file{/bin/sh} for UNIX systems and @nospell{@file{cmd.exe}} for |
2365c2661b3c
doc: Spellcheck documentation ahead of 4.4 release.
Rik <rik@octave.org>
parents:
24899
diff
changeset
|
233 Windows |
24009
eef8c31ffe97
Document that the shell for system() differs between OS (bug #49825).
Rik <rik@octave.org>
parents:
24007
diff
changeset
|
234 systems. |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
235 @seealso{unix, dos} |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
236 @end deftypefn */) |
1683 | 237 { |
238 int nargin = args.length (); | |
239 | |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
240 if (nargin == 0 || nargin > 3) |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
241 print_usage (); |
2083 | 242 |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
243 system_exec_type type = et_sync; |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
244 if (nargin == 3) |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
245 { |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
246 std::string type_str = args(2).xstring_value ("system: TYPE must be a string"); |
11123
fbec4b3be59f
toplev.cc (Fsystem): allow optional return_output and type arguments to be specified independently
John W. Eaton <jwe@octave.org>
parents:
11104
diff
changeset
|
247 |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
248 if (type_str == "sync") |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
249 type = et_sync; |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
250 else if (type_str == "async") |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
251 type = et_async; |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
252 else |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23721
diff
changeset
|
253 error (R"(system: TYPE must be "sync" or "async")"); |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
254 } |
11123
fbec4b3be59f
toplev.cc (Fsystem): allow optional return_output and type arguments to be specified independently
John W. Eaton <jwe@octave.org>
parents:
11104
diff
changeset
|
255 |
20939
b17fda023ca6
maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents:
20923
diff
changeset
|
256 octave_value_list retval; |
b17fda023ca6
maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents:
20923
diff
changeset
|
257 |
b17fda023ca6
maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents:
20923
diff
changeset
|
258 bool return_output = (nargin == 1 && nargout > 1); |
b17fda023ca6
maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents:
20923
diff
changeset
|
259 |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
260 if (nargin > 1) |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
261 { |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
262 try |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
263 { |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
264 return_output = args(1).is_true (); |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
265 } |
22327
d0562b3159c7
move more classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
266 catch (octave::execution_exception& e) |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
267 { |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
268 error (e, "system: RETURN_OUTPUT must be boolean value true or false"); |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
269 } |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
270 } |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
271 |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
272 if (return_output && type == et_async) |
20831
35241c4b696c
eliminate return statements after calls to error
John W. Eaton <jwe@octave.org>
parents:
20799
diff
changeset
|
273 error ("system: can't return output from commands run asynchronously"); |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
274 |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
275 std::string cmd_str = args(0).xstring_value ("system: first argument must be a string"); |
1683 | 276 |
21979
d04da18a407a
use OCTAVE_USE_WINDOWS_API more consistently
John W. Eaton <jwe@octave.org>
parents:
21966
diff
changeset
|
277 #if defined (OCTAVE_USE_WINDOWS_API) |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
278 // Work around weird double-quote handling on Windows systems. |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
279 if (type == et_sync) |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23721
diff
changeset
|
280 cmd_str = '"' + cmd_str + '"'; |
7104 | 281 #endif |
282 | |
25284
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
283 octave::unwind_protect frame; |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
284 |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
285 frame.add_fcn (restore_signal_mask, get_signal_mask ()); |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
286 |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
287 octave_unblock_async_signals (); |
26826
20881d195d20
fix handling of SIGTSTP (bug #51903)
John W. Eaton <jwe@octave.org>
parents:
26603
diff
changeset
|
288 octave_unblock_signal_by_name ("SIGTSTP"); |
25284
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
289 |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
290 if (type == et_async) |
22264
9b78fda78300
fix build failure for --without-z (bug #48757)
John W. Eaton <jwe@octave.org>
parents:
22094
diff
changeset
|
291 retval(0) = octave_async_system_wrapper (cmd_str.c_str ()); |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
292 else if (return_output) |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
293 retval = run_command_and_return_output (cmd_str); |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
294 else |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
295 { |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
296 int status = system (cmd_str.c_str ()); |
2321 | 297 |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
298 // The value in status is as returned by waitpid. If |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
299 // the process exited normally, extract the actual exit |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
300 // status of the command. Otherwise, return 127 as a |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
301 // failure code. |
20582
ba2b07c13913
use new string_value method to handle value extraction errors
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
302 |
21921
ecfcc8527661
hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
21907
diff
changeset
|
303 if (octave::sys::wifexited (status)) |
ecfcc8527661
hide sys/wait.h header and provide wrappers for waitpid macros
John W. Eaton <jwe@octave.org>
parents:
21907
diff
changeset
|
304 status = octave::sys::wexitstatus (status); |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
305 |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
306 retval(0) = status; |
1683 | 307 } |
308 | |
309 return retval; | |
310 } | |
311 | |
12846
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
312 /* |
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
313 %!test |
14018
5d5685216876
Deprecate shell_cmd function and update system, dos, unix commands
Rik <octave@nomad.inbox5.com>
parents:
14016
diff
changeset
|
314 %! cmd = ls_command (); |
12846
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
315 %! [status, output] = system (cmd); |
14018
5d5685216876
Deprecate shell_cmd function and update system, dos, unix commands
Rik <octave@nomad.inbox5.com>
parents:
14016
diff
changeset
|
316 %! assert (status, 0); |
12846
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
317 %! assert (ischar (output)); |
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
318 %! assert (! isempty (output)); |
14018
5d5685216876
Deprecate shell_cmd function and update system, dos, unix commands
Rik <octave@nomad.inbox5.com>
parents:
14016
diff
changeset
|
319 |
5d5685216876
Deprecate shell_cmd function and update system, dos, unix commands
Rik <octave@nomad.inbox5.com>
parents:
14016
diff
changeset
|
320 %!error system () |
5d5685216876
Deprecate shell_cmd function and update system, dos, unix commands
Rik <octave@nomad.inbox5.com>
parents:
14016
diff
changeset
|
321 %!error system (1, 2, 3) |
12846
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
322 */ |
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
323 |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
324 static octave_value |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
325 find_config_info (const octave_scalar_map& m, const std::string& key) |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
326 { |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
327 if (m.isfield (key)) |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
328 { |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
329 Cell c = m.contents (key); |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
330 |
23577
80c42f4cca13
maint: Deprecate is_empty and replace with isempty.
Rik <rik@octave.org>
parents:
23487
diff
changeset
|
331 if (! c.isempty ()) |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
332 return c(0); |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
333 } |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
334 |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
335 return octave_value (); |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
336 } |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
337 |
21434
1da428cbf401
deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents:
21421
diff
changeset
|
338 DEFUN (__octave_config_info__, args, , |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
339 doc: /* -*- texinfo -*- |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
340 @deftypefn {} {} __octave_config_info__ () |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
341 @deftypefnx {} {} __octave_config_info__ (@var{option}) |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
342 Return a structure containing configuration and installation information for |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
343 Octave. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
344 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
345 If @var{option} is a string, return the configuration information for the |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
346 specified option. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
347 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
348 @seealso{computer} |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
349 @end deftypefn */) |
2162 | 350 { |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
351 static octave_scalar_map config; |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
352 static octave_scalar_map build_env; |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
353 static octave_scalar_map build_features; |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
354 |
4357 | 355 static bool initialized = false; |
2162 | 356 |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
357 if (! initialized) |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
358 { |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
359 std::map<std::string, octave_value> conf_info_map |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
360 = {{ "DEFAULT_PAGER", octave::config::default_pager () }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
361 |
21229
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
21226
diff
changeset
|
362 #if defined (OCTAVE_ENABLE_64) |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
363 { "ENABLE_64", true }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
364 #else |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
365 { "ENABLE_64", false }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
366 #endif |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
367 |
21229
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
21226
diff
changeset
|
368 #if defined (OCTAVE_ENABLE_ATOMIC_REFCOUNT) |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
369 { "ENABLE_ATOMIC_REFCOUNT", true }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
370 #else |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
371 { "ENABLE_ATOMIC_REFCOUNT", false }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
372 #endif |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
373 |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
374 #if defined (ENABLE_DOCS) |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
375 { "ENABLE_DOCS", true }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
376 #else |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
377 { "ENABLE_DOCS", false }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
378 #endif |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
379 |
21229
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
21226
diff
changeset
|
380 #if defined (OCTAVE_ENABLE_FLOAT_TRUNCATE) |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
381 { "ENABLE_FLOAT_TRUNCATE", true }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
382 #else |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
383 { "ENABLE_FLOAT_TRUNCATE", false }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
384 #endif |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
385 |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
386 #if defined (ENABLE_JIT) |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
387 { "ENABLE_JIT", true }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
388 #else |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
389 { "ENABLE_JIT", false }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
390 #endif |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
391 |
21229
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
21226
diff
changeset
|
392 #if defined (OCTAVE_ENABLE_OPENMP) |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
393 { "ENABLE_OPENMP", true }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
394 #else |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
395 { "ENABLE_OPENMP", false }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
396 #endif |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
397 |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
398 { "api_version", OCTAVE_API_VERSION }, |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
399 { "archlibdir", octave::config::arch_lib_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
400 { "bindir", octave::config::bin_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
401 { "canonical_host_type", octave::config::canonical_host_type () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
402 { "datadir", octave::config::data_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
403 { "datarootdir", octave::config::dataroot_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
404 { "fcnfiledir", octave::config::fcn_file_dir () }, |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
405 { "fftw_version", octave::fftw_version () }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
406 { "fftwf_version", octave::fftwf_version () }, |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
407 { "imagedir", octave::config::image_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
408 { "includedir", octave::config::include_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
409 { "infodir", octave::config::info_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
410 { "libdir", octave::config::lib_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
411 { "libexecdir", octave::config::libexec_dir () }, |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
412 // Each library and executable has its own definition of the hg |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
413 // id. We check for consistency when Octave starts so we just |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
414 // store and report one of them here. |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
415 { "hg_id", liboctinterp_hg_id () }, |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
416 { "localapiarchlibdir", octave::config::local_api_arch_lib_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
417 { "localapifcnfiledir", octave::config::local_api_fcn_file_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
418 { "localapioctfiledir", octave::config::local_api_oct_file_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
419 { "localarchlibdir", octave::config::local_arch_lib_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
420 { "localfcnfiledir", octave::config::local_fcn_file_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
421 { "localoctfiledir", octave::config::local_oct_file_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
422 { "localstartupfiledir", octave::config::local_startupfile_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
423 { "localverarchlibdir", octave::config::local_ver_arch_lib_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
424 { "localverfcnfiledir", octave::config::local_ver_fcn_file_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
425 { "localveroctfiledir", octave::config::local_ver_oct_file_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
426 { "man1dir", octave::config::man1_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
427 { "man1ext", octave::config::man1_ext () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
428 { "mandir", octave::config::man_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
429 { "octdatadir", octave::config::oct_data_dir () }, |
24876
a41e264609c0
Fix misconfigured OCTAVE_DOCDIR (bug #53006)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24801
diff
changeset
|
430 { "octdocdir", octave::config::oct_doc_dir () }, |
24899
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24876
diff
changeset
|
431 { "octetcdir", octave::config::oct_etc_dir () }, |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
432 { "octfiledir", octave::config::oct_file_dir () }, |
24899
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24876
diff
changeset
|
433 { "octfontsdir", octave::config::oct_fonts_dir () }, |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
434 { "octincludedir", octave::config::oct_include_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
435 { "octlibdir", octave::config::oct_lib_dir () }, |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
436 { "octtestsdir", octave::config::oct_tests_dir () }, |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
437 { "release_date", OCTAVE_RELEASE_DATE }, |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23715
diff
changeset
|
438 { "startupfiledir", octave::config::startupfile_dir () }, |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
439 { "version", OCTAVE_VERSION }}; |
4357 | 440 |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
441 std::map<std::string, octave_value> build_env_map |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
442 = {{ "AMD_CPPFLAGS", octave::build_env::AMD_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
443 { "AMD_LDFLAGS", octave::build_env::AMD_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
444 { "AMD_LIBS", octave::build_env::AMD_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
445 { "AR", octave::build_env::AR }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
446 { "ARFLAGS", octave::build_env::ARFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
447 { "ARPACK_CPPFLAGS", octave::build_env::ARPACK_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
448 { "ARPACK_LDFLAGS", octave::build_env::ARPACK_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
449 { "ARPACK_LIBS", octave::build_env::ARPACK_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
450 { "BLAS_LIBS", octave::build_env::BLAS_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
451 { "CAMD_CPPFLAGS", octave::build_env::CAMD_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
452 { "CAMD_LDFLAGS", octave::build_env::CAMD_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
453 { "CAMD_LIBS", octave::build_env::CAMD_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
454 { "CARBON_LIBS", octave::build_env::CARBON_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
455 { "CC", octave::build_env::CC }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
456 { "CCOLAMD_CPPFLAGS", octave::build_env::CCOLAMD_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
457 { "CCOLAMD_LDFLAGS", octave::build_env::CCOLAMD_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
458 { "CCOLAMD_LIBS", octave::build_env::CCOLAMD_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
459 { "CFLAGS", octave::build_env::CFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
460 { "CHOLMOD_CPPFLAGS", octave::build_env::CHOLMOD_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
461 { "CHOLMOD_LDFLAGS", octave::build_env::CHOLMOD_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
462 { "CHOLMOD_LIBS", octave::build_env::CHOLMOD_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
463 { "COLAMD_CPPFLAGS", octave::build_env::COLAMD_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
464 { "COLAMD_LDFLAGS", octave::build_env::COLAMD_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
465 { "COLAMD_LIBS", octave::build_env::COLAMD_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
466 { "CPICFLAG", octave::build_env::CPICFLAG }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
467 { "CPPFLAGS", octave::build_env::CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
468 { "CURL_CPPFLAGS", octave::build_env::CURL_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
469 { "CURL_LDFLAGS", octave::build_env::CURL_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
470 { "CURL_LIBS", octave::build_env::CURL_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
471 { "CXSPARSE_CPPFLAGS", octave::build_env::CXSPARSE_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
472 { "CXSPARSE_LDFLAGS", octave::build_env::CXSPARSE_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
473 { "CXSPARSE_LIBS", octave::build_env::CXSPARSE_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
474 { "CXX", octave::build_env::CXX }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
475 { "CXXCPP", octave::build_env::CXXCPP }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
476 { "CXXFLAGS", octave::build_env::CXXFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
477 { "CXXPICFLAG", octave::build_env::CXXPICFLAG }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
478 { "DEFS", octave::build_env::DEFS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
479 { "DL_LD", octave::build_env::DL_LD }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
480 { "DL_LDFLAGS", octave::build_env::DL_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
481 { "GCC_VERSION", octave::build_env::GCC_VERSION }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
482 { "GXX_VERSION", octave::build_env::GXX_VERSION }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
483 { "EXEEXT", octave::build_env::EXEEXT }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
484 { "F77", octave::build_env::F77 }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
485 { "F77_FLOAT_STORE_FLAG", octave::build_env::F77_FLOAT_STORE_FLAG }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
486 { "F77_INTEGER_8_FLAG", octave::build_env::F77_INTEGER_8_FLAG }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
487 { "FFLAGS", octave::build_env::FFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
488 { "FFTW3_CPPFLAGS", octave::build_env::FFTW3_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
489 { "FFTW3_LDFLAGS", octave::build_env::FFTW3_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
490 { "FFTW3_LIBS", octave::build_env::FFTW3_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
491 { "FFTW3F_CPPFLAGS", octave::build_env::FFTW3F_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
492 { "FFTW3F_LDFLAGS", octave::build_env::FFTW3F_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
493 { "FFTW3F_LIBS", octave::build_env::FFTW3F_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
494 { "FLIBS", octave::build_env::FLIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
495 { "FLTK_CPPFLAGS", octave::build_env::FLTK_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
496 { "FLTK_LDFLAGS", octave::build_env::FLTK_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
497 { "FLTK_LIBS", octave::build_env::FLTK_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
498 { "FONTCONFIG_CPPFLAGS", octave::build_env::FONTCONFIG_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
499 { "FONTCONFIG_LIBS", octave::build_env::FONTCONFIG_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
500 { "FPICFLAG", octave::build_env::FPICFLAG }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
501 { "FT2_CPPFLAGS", octave::build_env::FT2_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
502 { "FT2_LIBS", octave::build_env::FT2_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
503 { "GLPK_CPPFLAGS", octave::build_env::GLPK_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
504 { "GLPK_LDFLAGS", octave::build_env::GLPK_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
505 { "GLPK_LIBS", octave::build_env::GLPK_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
506 { "GNUPLOT", octave::build_env::GNUPLOT }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
507 { "HDF5_CPPFLAGS", octave::build_env::HDF5_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
508 { "HDF5_LDFLAGS", octave::build_env::HDF5_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
509 { "HDF5_LIBS", octave::build_env::HDF5_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
510 { "LAPACK_LIBS", octave::build_env::LAPACK_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
511 { "LDFLAGS", octave::build_env::LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
512 { "LD_CXX", octave::build_env::LD_CXX }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
513 { "LD_STATIC_FLAG", octave::build_env::LD_STATIC_FLAG }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
514 { "LEX", octave::build_env::LEX }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
515 { "LEXLIB", octave::build_env::LEXLIB }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
516 { "LFLAGS", octave::build_env::LFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
517 { "LIBOCTAVE", octave::build_env::LIBOCTAVE }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
518 { "LIBOCTINTERP", octave::build_env::LIBOCTINTERP }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
519 { "LIBS", octave::build_env::LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
520 { "LLVM_CPPFLAGS", octave::build_env::LLVM_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
521 { "LLVM_LDFLAGS", octave::build_env::LLVM_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
522 { "LLVM_LIBS", octave::build_env::LLVM_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
523 { "LN_S", octave::build_env::LN_S }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
524 { "MAGICK_CPPFLAGS", octave::build_env::MAGICK_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
525 { "MAGICK_LDFLAGS", octave::build_env::MAGICK_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
526 { "MAGICK_LIBS", octave::build_env::MAGICK_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
527 { "MKOCTFILE_DL_LDFLAGS", octave::build_env::MKOCTFILE_DL_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
528 { "OCTAVE_LINK_DEPS", octave::build_env::OCTAVE_LINK_DEPS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
529 { "OCTAVE_LINK_OPTS", octave::build_env::OCTAVE_LINK_OPTS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
530 { "OCT_LINK_DEPS", octave::build_env::OCT_LINK_DEPS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
531 { "OCT_LINK_OPTS", octave::build_env::OCT_LINK_OPTS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
532 { "OPENGL_LIBS", octave::build_env::OPENGL_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
533 { "PCRE_CPPFLAGS", octave::build_env::PCRE_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
534 { "PCRE_LDFLAGS", octave::build_env::PCRE_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
535 { "PCRE_LIBS", octave::build_env::PCRE_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
536 { "PTHREAD_CFLAGS", octave::build_env::PTHREAD_CFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
537 { "PTHREAD_LIBS", octave::build_env::PTHREAD_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
538 { "QHULL_CPPFLAGS", octave::build_env::QHULL_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
539 { "QHULL_LDFLAGS", octave::build_env::QHULL_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
540 { "QHULL_LIBS", octave::build_env::QHULL_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
541 { "QRUPDATE_CPPFLAGS", octave::build_env::QRUPDATE_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
542 { "QRUPDATE_LDFLAGS", octave::build_env::QRUPDATE_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
543 { "QRUPDATE_LIBS", octave::build_env::QRUPDATE_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
544 { "QT_CPPFLAGS", octave::build_env::QT_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
545 { "QT_LDFLAGS", octave::build_env::QT_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
546 { "QT_LIBS", octave::build_env::QT_LIBS }, |
25931
332be8be16eb
dynamically load qt graphics
John W. Eaton <jwe@octave.org>
parents:
25882
diff
changeset
|
547 { "QT_OPENGL_LIBS", octave::build_env::QT_OPENGL_LIBS }, |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
548 { "RANLIB", octave::build_env::RANLIB }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
549 { "RDYNAMIC_FLAG", octave::build_env::RDYNAMIC_FLAG }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
550 { "READLINE_LIBS", octave::build_env::READLINE_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
551 { "SHARED_LIBS", octave::build_env::SHARED_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
552 { "SH_LD", octave::build_env::SH_LD }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
553 { "SH_LDFLAGS", octave::build_env::SH_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
554 { "STATIC_LIBS", octave::build_env::STATIC_LIBS }, |
23990
6f56efc098bd
check for suitesparse config library before other suitesparse libraries
John W. Eaton <jwe@octave.org>
parents:
23878
diff
changeset
|
555 { "SUITESPARSECONFIG_LIBS", octave::build_env::SUITESPARSECONFIG_LIBS }, |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
556 { "TERM_LIBS", octave::build_env::TERM_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
557 { "UMFPACK_CPPFLAGS", octave::build_env::UMFPACK_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
558 { "UMFPACK_LDFLAGS", octave::build_env::UMFPACK_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
559 { "UMFPACK_LIBS", octave::build_env::UMFPACK_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
560 { "WARN_CFLAGS", octave::build_env::WARN_CFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
561 { "WARN_CXXFLAGS", octave::build_env::WARN_CXXFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
562 { "X11_INCFLAGS", octave::build_env::X11_INCFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
563 { "X11_LIBS", octave::build_env::X11_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
564 { "XTRA_CFLAGS", octave::build_env::XTRA_CFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
565 { "XTRA_CXXFLAGS", octave::build_env::XTRA_CXXFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
566 { "YACC", octave::build_env::YACC }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
567 { "YFLAGS", octave::build_env::YFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
568 { "Z_CPPFLAGS", octave::build_env::Z_CPPFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
569 { "Z_LDFLAGS", octave::build_env::Z_LDFLAGS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
570 { "Z_LIBS", octave::build_env::Z_LIBS }, |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
571 { "config_opts", octave::build_env::config_opts }}; |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
572 |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
573 config = octave_scalar_map (conf_info_map); |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
574 build_env = octave_scalar_map (build_env_map); |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
575 build_features = octave::build_env::features (); |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
576 |
4691 | 577 bool unix_system = true; |
7013 | 578 bool mac_system = false; |
4691 | 579 bool windows_system = false; |
580 | |
21979
d04da18a407a
use OCTAVE_USE_WINDOWS_API more consistently
John W. Eaton <jwe@octave.org>
parents:
21966
diff
changeset
|
581 #if defined (__WIN32__) |
4691 | 582 windows_system = true; |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
20785
diff
changeset
|
583 #if ! defined (__CYGWIN__) |
4691 | 584 unix_system = false; |
585 #endif | |
586 #endif | |
587 | |
8574
83b8c739d626
toplev.cc: check OCTAVE_USE_OS_X_API instead of __APPLE__ && __MACH__
John W. Eaton <jwe@octave.org>
parents:
8377
diff
changeset
|
588 #if defined (OCTAVE_USE_OS_X_API) |
7010 | 589 mac_system = true; |
590 #endif | |
591 | |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
592 config.assign ("unix", octave_value (unix_system)); |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
593 config.assign ("mac", octave_value (mac_system)); |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
594 config.assign ("windows", octave_value (windows_system)); |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
595 |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
596 octave::mach_info::float_format ff = octave::mach_info::native_float_format (); |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
597 config.assign ("float_format", |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
598 octave_value (octave::mach_info::float_format_as_string (ff))); |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
599 |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
600 config.assign ("words_big_endian", |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
601 octave_value (octave::mach_info::words_big_endian ())); |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
602 |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
603 config.assign ("words_little_endian", |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
604 octave_value (octave::mach_info::words_little_endian ())); |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
605 |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
606 config.assign ("build_environment", octave_value (build_env)); |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
607 |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
608 config.assign ("build_features", octave_value (build_features)); |
4691 | 609 |
4357 | 610 initialized = true; |
611 } | |
2162 | 612 |
2689 | 613 int nargin = args.length (); |
614 | |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
615 if (nargin > 1) |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
616 print_usage (); |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
617 |
20939
b17fda023ca6
maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents:
20923
diff
changeset
|
618 octave_value_list retval; |
b17fda023ca6
maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents:
20923
diff
changeset
|
619 |
2689 | 620 if (nargin == 1) |
621 { | |
21434
1da428cbf401
deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents:
21421
diff
changeset
|
622 std::string arg = args(0).xstring_value ("__octave_config_info__: OPTION argument must be a string"); |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
623 |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
624 octave_value info = find_config_info (config, arg); |
2689 | 625 |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
626 if (info.is_undefined ()) |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
627 info = find_config_info (build_env, arg); |
20939
b17fda023ca6
maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents:
20923
diff
changeset
|
628 |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
629 if (info.is_undefined ()) |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
630 info = find_config_info (build_features, arg); |
5199 | 631 |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
632 if (info.is_undefined ()) |
21434
1da428cbf401
deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents:
21421
diff
changeset
|
633 error ("__octave_config_info__: no info for '%s'", arg.c_str ()); |
20939
b17fda023ca6
maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents:
20923
diff
changeset
|
634 |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
635 return info; |
2689 | 636 } |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
637 else |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
638 retval = ovl (config); |
2689 | 639 |
640 return retval; | |
2162 | 641 } |
642 | |
12846
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
643 /* |
21434
1da428cbf401
deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents:
21421
diff
changeset
|
644 %!assert (ischar (__octave_config_info__ ("version"))) |
22751
e078f5607762
Fix failing BIST test in toplev.cc (bug #49575).
Rik <rik@octave.org>
parents:
22501
diff
changeset
|
645 %!assert (__octave_config_info__ ("version"), OCTAVE_VERSION ()) |
12846
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
646 %!test |
21434
1da428cbf401
deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents:
21421
diff
changeset
|
647 %! x = __octave_config_info__ (); |
12846
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
648 %! assert (isstruct (x)); |
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
649 %! assert (! isempty (x)); |
22751
e078f5607762
Fix failing BIST test in toplev.cc (bug #49575).
Rik <rik@octave.org>
parents:
22501
diff
changeset
|
650 %! assert (x.version, OCTAVE_VERSION ()); |
21603
37cbdf7bffa9
Add fftwf_version (bug #45659)
mmuetzel <markus.muetzel@gmx.de>
parents:
21600
diff
changeset
|
651 |
21434
1da428cbf401
deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents:
21421
diff
changeset
|
652 %!error __octave_config_info__ (1, 2) |
12846
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
653 */ |
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
654 |
1683 | 655 #if defined (__GNUG__) && defined (DEBUG_NEW_DELETE) |
2806 | 656 |
1683 | 657 int debug_new_delete = 0; |
658 | |
659 typedef void (*vfp)(void); | |
660 extern vfp __new_handler; | |
661 | |
662 void * | |
663 __builtin_new (size_t sz) | |
664 { | |
665 void *p; | |
666 | |
20946 | 667 // malloc (0) is unpredictable; avoid it. |
1683 | 668 if (sz == 0) |
669 sz = 1; | |
21942
aab79a1885cc
limit gnulib headers to liboctave/wrappers directory
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
670 p = std::malloc (sz); |
1683 | 671 while (p == 0) |
672 { | |
673 (*__new_handler) (); | |
21942
aab79a1885cc
limit gnulib headers to liboctave/wrappers directory
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
674 p = std::malloc (sz); |
1683 | 675 } |
676 | |
677 if (debug_new_delete) | |
5629 | 678 std::cerr << "__builtin_new: " << p << std::endl; |
1683 | 679 |
680 return p; | |
681 } | |
682 | |
683 void | |
684 __builtin_delete (void *ptr) | |
685 { | |
686 if (debug_new_delete) | |
5629 | 687 std::cerr << "__builtin_delete: " << ptr << std::endl; |
1683 | 688 |
23878
889b8262e661
maint: eliminate useless if (p) before free (p)
Mike Miller <mtmiller@octave.org>
parents:
23803
diff
changeset
|
689 free (ptr); |
1683 | 690 } |
2806 | 691 |
1683 | 692 #endif |