Mercurial > octave
annotate libinterp/corefcn/toplev.cc @ 31605:e88a07dec498 stable
maint: Use macros to begin/end C++ namespaces.
* oct-conf-post-public.in.h: Define two macros (OCTAVE_BEGIN_NAMESPACE,
OCTAVE_END_NAMESPACE) that can be used to start/end a namespace.
* mk-opts.pl, build-env.h, build-env.in.cc, __betainc__.cc, __contourc__.cc,
__dsearchn__.cc, __eigs__.cc, __expint__.cc, __ftp__.cc, __gammainc__.cc,
__ichol__.cc, __ilu__.cc, __isprimelarge__.cc, __lin_interpn__.cc,
__magick_read__.cc, __pchip_deriv__.cc, __qp__.cc, amd.cc, auto-shlib.cc,
auto-shlib.h, balance.cc, base-text-renderer.cc, base-text-renderer.h,
besselj.cc, bitfcns.cc, bsxfun.cc, c-file-ptr-stream.cc, c-file-ptr-stream.h,
call-stack.cc, call-stack.h, ccolamd.cc, cellfun.cc, chol.cc, colamd.cc,
colloc.cc, conv2.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc, data.h, debug.cc,
defaults.cc, defaults.h, defun-int.h, defun.cc, det.cc, dirfns.cc, display.cc,
display.h, dlmread.cc, dmperm.cc, dot.cc, dynamic-ld.cc, dynamic-ld.h, eig.cc,
ellipj.cc, environment.cc, environment.h, error.cc, error.h, errwarn.h,
event-manager.cc, event-manager.h, event-queue.cc, event-queue.h, fcn-info.cc,
fcn-info.h, fft.cc, fft2.cc, fftn.cc, file-io.cc, filter.cc, find.cc,
ft-text-renderer.cc, ft-text-renderer.h, gcd.cc, getgrent.cc, getpwent.cc,
getrusage.cc, givens.cc, gl-render.cc, gl-render.h, gl2ps-print.cc,
gl2ps-print.h, graphics-toolkit.cc, graphics-toolkit.h, graphics.cc,
graphics.in.h, gsvd.cc, gtk-manager.cc, gtk-manager.h, hash.cc, help.cc,
help.h, hess.cc, hex2num.cc, hook-fcn.cc, hook-fcn.h, input.cc, input.h,
interpreter-private.cc, interpreter-private.h, interpreter.cc, interpreter.h,
inv.cc, jsondecode.cc, jsonencode.cc, kron.cc, latex-text-renderer.cc,
latex-text-renderer.h, load-path.cc, load-path.h, load-save.cc, load-save.h,
lookup.cc, ls-ascii-helper.cc, ls-ascii-helper.h, ls-oct-text.cc, ls-utils.cc,
ls-utils.h, lsode.cc, lu.cc, mappers.cc, matrix_type.cc, max.cc, mex-private.h,
mex.cc, mgorth.cc, nproc.cc, oct-fstrm.cc, oct-fstrm.h, oct-hdf5-types.cc,
oct-hdf5-types.h, oct-hist.cc, oct-hist.h, oct-iostrm.cc, oct-iostrm.h,
oct-opengl.h, oct-prcstrm.cc, oct-prcstrm.h, oct-procbuf.cc, oct-procbuf.h,
oct-process.cc, oct-process.h, oct-stdstrm.h, oct-stream.cc, oct-stream.h,
oct-strstrm.cc, oct-strstrm.h, oct-tex-lexer.in.ll, oct-tex-parser.yy,
ordqz.cc, ordschur.cc, pager.cc, pager.h, pinv.cc, pow2.cc, pr-flt-fmt.cc,
pr-output.cc, procstream.cc, procstream.h, psi.cc, qr.cc, quad.cc, quadcc.cc,
qz.cc, rand.cc, rcond.cc, regexp.cc, schur.cc, settings.cc, settings.h,
sighandlers.cc, sighandlers.h, sparse-xdiv.cc, sparse-xdiv.h, sparse-xpow.cc,
sparse-xpow.h, sparse.cc, spparms.cc, sqrtm.cc, stack-frame.cc, stack-frame.h,
stream-euler.cc, strfind.cc, strfns.cc, sub2ind.cc, svd.cc, sylvester.cc,
symbfact.cc, syminfo.cc, syminfo.h, symrcm.cc, symrec.cc, symrec.h,
symscope.cc, symscope.h, symtab.cc, symtab.h, syscalls.cc, sysdep.cc, sysdep.h,
text-engine.cc, text-engine.h, text-renderer.cc, text-renderer.h, time.cc,
toplev.cc, tril.cc, tsearch.cc, typecast.cc, url-handle-manager.cc,
url-handle-manager.h, urlwrite.cc, utils.cc, utils.h, variables.cc,
variables.h, xdiv.cc, xdiv.h, xnorm.cc, xnorm.h, xpow.cc, xpow.h,
__delaunayn__.cc, __fltk_uigetfile__.cc, __glpk__.cc, __init_fltk__.cc,
__init_gnuplot__.cc, __ode15__.cc, __voronoi__.cc, audiodevinfo.cc,
audioread.cc, convhulln.cc, fftw.cc, gzip.cc, mk-build-env-features.sh,
mk-builtins.pl, cdef-class.cc, cdef-class.h, cdef-fwd.h, cdef-manager.cc,
cdef-manager.h, cdef-method.cc, cdef-method.h, cdef-object.cc, cdef-object.h,
cdef-package.cc, cdef-package.h, cdef-property.cc, cdef-property.h,
cdef-utils.cc, cdef-utils.h, ov-base.cc, ov-base.h, ov-bool-mat.cc,
ov-builtin.h, ov-cell.cc, ov-class.cc, ov-class.h, ov-classdef.cc,
ov-classdef.h, ov-complex.cc, ov-fcn-handle.cc, ov-fcn-handle.h, ov-fcn.h,
ov-java.cc, ov-java.h, ov-mex-fcn.h, ov-null-mat.cc, ov-oncleanup.cc,
ov-struct.cc, ov-typeinfo.cc, ov-typeinfo.h, ov-usr-fcn.cc, ov-usr-fcn.h,
ov.cc, ov.h, octave.cc, octave.h, mk-ops.sh, op-b-b.cc, op-b-bm.cc,
op-b-sbm.cc, op-bm-b.cc, op-bm-bm.cc, op-bm-sbm.cc, op-cdm-cdm.cc, op-cell.cc,
op-chm.cc, op-class.cc, op-cm-cm.cc, op-cm-cs.cc, op-cm-m.cc, op-cm-s.cc,
op-cm-scm.cc, op-cm-sm.cc, op-cs-cm.cc, op-cs-cs.cc, op-cs-m.cc, op-cs-s.cc,
op-cs-scm.cc, op-cs-sm.cc, op-dm-dm.cc, op-dm-scm.cc, op-dm-sm.cc,
op-dm-template.cc, op-dms-template.cc, op-fcdm-fcdm.cc, op-fcm-fcm.cc,
op-fcm-fcs.cc, op-fcm-fm.cc, op-fcm-fs.cc, op-fcn.cc, op-fcs-fcm.cc,
op-fcs-fcs.cc, op-fcs-fm.cc, op-fcs-fs.cc, op-fdm-fdm.cc, op-fm-fcm.cc,
op-fm-fcs.cc, op-fm-fm.cc, op-fm-fs.cc, op-fs-fcm.cc, op-fs-fcs.cc,
op-fs-fm.cc, op-fs-fs.cc, op-i16-i16.cc, op-i32-i32.cc, op-i64-i64.cc,
op-i8-i8.cc, op-int-concat.cc, op-m-cm.cc, op-m-cs.cc, op-m-m.cc, op-m-s.cc,
op-m-scm.cc, op-m-sm.cc, op-mi.cc, op-pm-pm.cc, op-pm-scm.cc, op-pm-sm.cc,
op-pm-template.cc, op-range.cc, op-s-cm.cc, op-s-cs.cc, op-s-m.cc, op-s-s.cc,
op-s-scm.cc, op-s-sm.cc, op-sbm-b.cc, op-sbm-bm.cc, op-sbm-sbm.cc,
op-scm-cm.cc, op-scm-cs.cc, op-scm-m.cc, op-scm-s.cc, op-scm-scm.cc,
op-scm-sm.cc, op-sm-cm.cc, op-sm-cs.cc, op-sm-m.cc, op-sm-s.cc, op-sm-scm.cc,
op-sm-sm.cc, op-str-m.cc, op-str-s.cc, op-str-str.cc, op-struct.cc,
op-ui16-ui16.cc, op-ui32-ui32.cc, op-ui64-ui64.cc, op-ui8-ui8.cc, ops.h,
anon-fcn-validator.cc, anon-fcn-validator.h, bp-table.cc, bp-table.h,
comment-list.cc, comment-list.h, filepos.h, lex.h, lex.ll, oct-lvalue.cc,
oct-lvalue.h, oct-parse.yy, parse.h, profiler.cc, profiler.h,
pt-anon-scopes.cc, pt-anon-scopes.h, pt-arg-list.cc, pt-arg-list.h,
pt-args-block.cc, pt-args-block.h, pt-array-list.cc, pt-array-list.h,
pt-assign.cc, pt-assign.h, pt-binop.cc, pt-binop.h, pt-bp.cc, pt-bp.h,
pt-cbinop.cc, pt-cbinop.h, pt-cell.cc, pt-cell.h, pt-check.cc, pt-check.h,
pt-classdef.cc, pt-classdef.h, pt-cmd.h, pt-colon.cc, pt-colon.h, pt-const.cc,
pt-const.h, pt-decl.cc, pt-decl.h, pt-eval.cc, pt-eval.h, pt-except.cc,
pt-except.h, pt-exp.cc, pt-exp.h, pt-fcn-handle.cc, pt-fcn-handle.h, pt-id.cc,
pt-id.h, pt-idx.cc, pt-idx.h, pt-jump.h, pt-loop.cc, pt-loop.h, pt-mat.cc,
pt-mat.h, pt-misc.cc, pt-misc.h, pt-pr-code.cc, pt-pr-code.h, pt-select.cc,
pt-select.h, pt-spmd.cc, pt-spmd.h, pt-stmt.cc, pt-stmt.h, pt-tm-const.cc,
pt-tm-const.h, pt-unop.cc, pt-unop.h, pt-vm-eval.cc, pt-walk.cc, pt-walk.h,
pt.cc, pt.h, token.cc, token.h, Range.cc, Range.h, idx-vector.cc, idx-vector.h,
range-fwd.h, CollocWt.cc, CollocWt.h, aepbalance.cc, aepbalance.h, chol.cc,
chol.h, gepbalance.cc, gepbalance.h, gsvd.cc, gsvd.h, hess.cc, hess.h,
lo-mappers.cc, lo-mappers.h, lo-specfun.cc, lo-specfun.h, lu.cc, lu.h,
oct-convn.cc, oct-convn.h, oct-fftw.cc, oct-fftw.h, oct-norm.cc, oct-norm.h,
oct-rand.cc, oct-rand.h, oct-spparms.cc, oct-spparms.h, qr.cc, qr.h, qrp.cc,
qrp.h, randgamma.cc, randgamma.h, randmtzig.cc, randmtzig.h, randpoisson.cc,
randpoisson.h, schur.cc, schur.h, sparse-chol.cc, sparse-chol.h, sparse-lu.cc,
sparse-lu.h, sparse-qr.cc, sparse-qr.h, svd.cc, svd.h, child-list.cc,
child-list.h, dir-ops.cc, dir-ops.h, file-ops.cc, file-ops.h, file-stat.cc,
file-stat.h, lo-sysdep.cc, lo-sysdep.h, lo-sysinfo.cc, lo-sysinfo.h,
mach-info.cc, mach-info.h, oct-env.cc, oct-env.h, oct-group.cc, oct-group.h,
oct-password.cc, oct-password.h, oct-syscalls.cc, oct-syscalls.h, oct-time.cc,
oct-time.h, oct-uname.cc, oct-uname.h, action-container.cc, action-container.h,
base-list.h, cmd-edit.cc, cmd-edit.h, cmd-hist.cc, cmd-hist.h, f77-fcn.h,
file-info.cc, file-info.h, lo-array-errwarn.cc, lo-array-errwarn.h, lo-hash.cc,
lo-hash.h, lo-ieee.h, lo-regexp.cc, lo-regexp.h, lo-utils.cc, lo-utils.h,
oct-base64.cc, oct-base64.h, oct-glob.cc, oct-glob.h, oct-inttypes.h,
oct-mutex.cc, oct-mutex.h, oct-refcount.h, oct-shlib.cc, oct-shlib.h,
oct-sparse.cc, oct-sparse.h, oct-string.h, octave-preserve-stream-state.h,
pathsearch.cc, pathsearch.h, quit.cc, quit.h, unwind-prot.cc, unwind-prot.h,
url-transfer.cc, url-transfer.h : Use new macros to begin/end C++ namespaces.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 01 Dec 2022 14:23:45 -0800 |
parents | 00e2eafd1c0f |
children | aac27ad79be6 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
29961
diff
changeset
|
3 // Copyright (C) 1995-2022 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
1683 | 25 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21618
diff
changeset
|
26 #if defined (HAVE_CONFIG_H) |
21301
40de9f8f23a6
Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents:
21253
diff
changeset
|
27 # include "config.h" |
1683 | 28 #endif |
29 | |
4489 | 30 #include <cerrno> |
1683 | 31 #include <cstdlib> |
25438
cb1606f78f6b
prefer <istream>, <ostream>, or <iosfwd> to <iostream> where possible
John W. Eaton <jwe@octave.org>
parents:
25284
diff
changeset
|
32 |
4221 | 33 #include <new> |
5765 | 34 #include <sstream> |
1728 | 35 #include <string> |
36 | |
21979
d04da18a407a
use OCTAVE_USE_WINDOWS_API more consistently
John W. Eaton <jwe@octave.org>
parents:
21966
diff
changeset
|
37 #if defined (OCTAVE_USE_WINDOWS_API) |
21949
baeffde5c87d
fix build for Windows systems
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
38 # define WIN32_LEAN_AND_MEAN 1 |
baeffde5c87d
fix build for Windows systems
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
39 # include <windows.h> |
baeffde5c87d
fix build for Windows systems
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
40 #endif |
baeffde5c87d
fix build for Windows systems
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
41 |
22264
9b78fda78300
fix build failure for --without-z (bug #48757)
John W. Eaton <jwe@octave.org>
parents:
22094
diff
changeset
|
42 #include "async-system-wrapper.h" |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
22091
diff
changeset
|
43 #include "child-list.h" |
1683 | 44 #include "lo-error.h" |
21600
184b85b31e03
more updates for version function
mmuetzel <markus.muetzel@gmx.de>
parents:
21598
diff
changeset
|
45 #include "oct-fftw.h" |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
13981
diff
changeset
|
46 #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
|
47 #include "oct-syscalls.h" |
25284
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
48 #include "signal-wrappers.h" |
1755 | 49 #include "str-vec.h" |
21899 | 50 #include "wait-for-input.h" |
1683 | 51 |
21220
d78e45987d6a
rename octave::build_env namespace from octave::config
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
52 #include "build-env.h" |
21607
37f6ed8a6f1b
store liboctave and liboctinterp hg ids separately
John W. Eaton <jwe@octave.org>
parents:
21605
diff
changeset
|
53 #include "liboctinterp-build-info.h" |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
13981
diff
changeset
|
54 #include "defaults.h" |
1683 | 55 #include "defun.h" |
56 #include "error.h" | |
23712
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23577
diff
changeset
|
57 #include "help.h" |
24734
5d8c4cbc56d7
don't use singleton pattern for child_list
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
58 #include "interpreter-private.h" |
22089
c2c668b3051b
use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents:
22051
diff
changeset
|
59 #include "octave.h" |
2162 | 60 #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
|
61 #include "ovl.h" |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
13981
diff
changeset
|
62 #include "ov.h" |
1683 | 63 #include "pager.h" |
64 #include "procstream.h" | |
65 #include "sysdep.h" | |
66 #include "unwind-prot.h" | |
67 #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
|
68 #include "version.h" |
1683 | 69 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21618
diff
changeset
|
70 #if ! defined (SHELL_PATH) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
21182
diff
changeset
|
71 # define SHELL_PATH "/bin/sh" |
15756
ea1a1fb00744
Make the path to the shell interpreter configuable
Mike Miller <mtmiller@ieee.org>
parents:
15596
diff
changeset
|
72 #endif |
ea1a1fb00744
Make the path to the shell interpreter configuable
Mike Miller <mtmiller@ieee.org>
parents:
15596
diff
changeset
|
73 |
31605
e88a07dec498
maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents:
31415
diff
changeset
|
74 OCTAVE_BEGIN_NAMESPACE(octave) |
29958
32c3a5805893
move DEFUN and DEFMETHOD functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
75 |
29462
280defaf2023
pkg.m: Install local packages in version dependent path (bug #58299).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29359
diff
changeset
|
76 #define STRINGIFY(s) STRINGIFY1(s) |
280defaf2023
pkg.m: Install local packages in version dependent path (bug #58299).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29359
diff
changeset
|
77 #define STRINGIFY1(s) #s |
280defaf2023
pkg.m: Install local packages in version dependent path (bug #58299).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29359
diff
changeset
|
78 |
1957 | 79 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
|
80 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
|
81 @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
|
82 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
|
83 @end deftypefn */) |
1683 | 84 { |
17510
7542f4496974
eliminate some macros in version.h
John W. Eaton <jwe@octave.org>
parents:
17281
diff
changeset
|
85 octave_stdout << "\n" << octave_name_version_and_copyright () << "\n\ |
3922 | 86 \n\ |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24009
diff
changeset
|
87 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
|
88 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
|
89 the Free Software Foundation, either version 3 of the License, or\n\ |
1683 | 90 (at your option) any later version.\n\ |
91 \n\ | |
26177
f2d795f07c84
maint: Use standard copyright phrasing in all files.
Rik <rik@octave.org>
parents:
25931
diff
changeset
|
92 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
|
93 WITHOUT ANY WARRANTY; without even the implied warranty of\n\ |
1683 | 94 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\ |
95 GNU General Public License for more details.\n\ | |
96 \n\ | |
97 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
|
98 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
|
99 <https://www.gnu.org/licenses/>.\n\ |
1683 | 100 \n"; |
101 | |
21078
49852ff04747
maint: Remove unnecessary declarations of retval.
Rik <rik@octave.org>
parents:
21055
diff
changeset
|
102 return ovl (); |
1683 | 103 } |
104 | |
105 // Execute a shell command. | |
106 | |
2086 | 107 static octave_value_list |
3523 | 108 run_command_and_return_output (const std::string& cmd_str) |
2083 | 109 { |
2086 | 110 octave_value_list retval; |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
111 unwind_protect frame; |
2083 | 112 |
113 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
|
114 frame.add_delete (cmd); |
2083 | 115 |
31105
670a0d878af1
eliminate WHO arguments from interpreter-private functions
John W. Eaton <jwe@octave.org>
parents:
30888
diff
changeset
|
116 child_list& kids = __get_child_list__ (); |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
117 frame.add (&child_list::remove, kids, cmd->pid ()); |
3060 | 118 |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
119 if (! *cmd) |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
120 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
|
121 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
122 int fid = cmd->file_number (); |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
123 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
124 std::ostringstream output_buf; |
2095 | 125 |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
126 char ch; |
4494 | 127 |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
128 for (;;) |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
129 { |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
130 if (cmd->get (ch)) |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
131 output_buf.put (ch); |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
132 else |
10212
56f7734f5448
fix process creation failure handling in system()
Jaroslav Hajek <highegg@gmail.com>
parents:
10186
diff
changeset
|
133 { |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
134 if (! cmd->eof () && errno == EAGAIN) |
10212
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 cmd->clear (); |
3147 | 137 |
21899 | 138 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
|
139 break; |
56f7734f5448
fix process creation failure handling in system()
Jaroslav Hajek <highegg@gmail.com>
parents:
10186
diff
changeset
|
140 } |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
141 else |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
142 break; |
10212
56f7734f5448
fix process creation failure handling in system()
Jaroslav Hajek <highegg@gmail.com>
parents:
10186
diff
changeset
|
143 } |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
144 } |
3147 | 145 |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
146 int cmd_status = cmd->close (); |
2083 | 147 |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
148 if (sys::wifexited (cmd_status)) |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
149 cmd_status = sys::wexitstatus (cmd_status); |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
150 else |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
151 cmd_status = 127; |
2083 | 152 |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20946
diff
changeset
|
153 retval = ovl (cmd_status, output_buf.str ()); |
2083 | 154 |
155 return retval; | |
156 } | |
157 | |
25284
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
158 // 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
|
159 |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
160 static void * |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
161 get_signal_mask (void) |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
162 { |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
163 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
|
164 |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
165 octave_get_signal_mask (mask); |
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 return mask; |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
168 } |
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 // 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
|
171 |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
172 static void |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
173 restore_signal_mask (void *mask) |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
174 { |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
175 octave_set_signal_mask (mask); |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
176 |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
177 octave_free_signal_mask (mask); |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
178 } |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
179 |
5285 | 180 enum system_exec_type { et_sync, et_async }; |
181 | |
1957 | 182 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
|
183 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
|
184 @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
|
185 @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
|
186 @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
|
187 @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
|
188 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
|
189 |
28604
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
190 If @var{system} is called with one or more output arguments, or if the optional |
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
191 argument @var{return_output} is true and the subprocess is started |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
192 synchronously, then the output from the command is returned as a variable. |
28604
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
193 Otherwise, if the subprocess is executed synchronously, its output is sent to |
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
194 the standard output. To send the output of a command executed with |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
195 @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
|
196 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
197 @example |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
198 @group |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
199 [~, text] = system ("cmd"); |
24801
daf61c7dfcae
Change default status of pager to "off" (bug #53217).
Rik <rik@octave.org>
parents:
24734
diff
changeset
|
200 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
|
201 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
|
202 @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
|
203 @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
|
204 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
205 @noindent |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
206 or |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
207 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
208 @example |
24801
daf61c7dfcae
Change default status of pager to "off" (bug #53217).
Rik <rik@octave.org>
parents:
24734
diff
changeset
|
209 @group |
daf61c7dfcae
Change default status of pager to "off" (bug #53217).
Rik <rik@octave.org>
parents:
24734
diff
changeset
|
210 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
|
211 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
|
212 @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
|
213 @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
|
214 |
28604
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
215 If the optional argument @var{type} is @qcode{"async"}, the process is started |
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
216 in the background and the process ID of the child process is returned |
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
217 immediately. Otherwise, the child process is started and Octave waits until it |
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
218 exits. If the @var{type} argument is omitted, it defaults to the value |
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
219 @qcode{"sync"}. |
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
220 |
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
221 The @code{system} function can return two values. The first is the exit status |
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
222 of the command and the second is any output from the command that was written |
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
223 to the standard output stream. For example, |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
224 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
225 @example |
24009
eef8c31ffe97
Document that the shell for system() differs between OS (bug #49825).
Rik <rik@octave.org>
parents:
24007
diff
changeset
|
226 [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
|
227 @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
|
228 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
229 @noindent |
28604
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
230 will set the variable @var{output} to the string @samp{foo}, and the variable |
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
231 @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
|
232 |
28604
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
233 For commands run asynchronously, @var{status} is the process id of the command |
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
234 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
|
235 |
eef8c31ffe97
Document that the shell for system() differs between OS (bug #49825).
Rik <rik@octave.org>
parents:
24007
diff
changeset
|
236 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
|
237 typically @file{/bin/sh} for UNIX systems and @nospell{@file{cmd.exe}} for |
28604
69cba42a01ca
doc: Re-order system() docs to match order of parameters.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
238 Windows 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
|
239 @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
|
240 @end deftypefn */) |
1683 | 241 { |
242 int nargin = args.length (); | |
243 | |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
244 if (nargin == 0 || nargin > 3) |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
245 print_usage (); |
2083 | 246 |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
247 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
|
248 if (nargin == 3) |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
249 { |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
250 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
|
251 |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
252 if (type_str == "sync") |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
253 type = et_sync; |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
254 else if (type_str == "async") |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
255 type = et_async; |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
256 else |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23721
diff
changeset
|
257 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
|
258 } |
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
|
259 |
20939
b17fda023ca6
maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents:
20923
diff
changeset
|
260 octave_value_list retval; |
b17fda023ca6
maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents:
20923
diff
changeset
|
261 |
b17fda023ca6
maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents:
20923
diff
changeset
|
262 bool return_output = (nargin == 1 && nargout > 1); |
b17fda023ca6
maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents:
20923
diff
changeset
|
263 |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
264 if (nargin > 1) |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
265 { |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
266 try |
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 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
|
269 } |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
270 catch (execution_exception& ee) |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
271 { |
29163
8f67ad8b3103
maint: Updating naming conventions for exceptions and use const where possible.
Rik <rik@octave.org>
parents:
29141
diff
changeset
|
272 error (ee, "system: RETURN_OUTPUT must be boolean value true or false"); |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
273 } |
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 |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
276 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
|
277 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
|
278 |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
279 std::string cmd_str = args(0).xstring_value ("system: first argument must be a string"); |
1683 | 280 |
21979
d04da18a407a
use OCTAVE_USE_WINDOWS_API more consistently
John W. Eaton <jwe@octave.org>
parents:
21966
diff
changeset
|
281 #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
|
282 // 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
|
283 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
|
284 cmd_str = '"' + cmd_str + '"'; |
7104 | 285 #endif |
286 | |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
287 unwind_action restore_mask |
28850
445e5ac1f58d
in unwind_action objects, capture variables in lambda expressions when possible
John W. Eaton <jwe@octave.org>
parents:
28823
diff
changeset
|
288 ([] (void *mask) { restore_signal_mask (mask); }, get_signal_mask ()); |
25284
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
289 |
78fb24bdd8bb
unblock async signals before executing subprocess (bug #53635)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
290 octave_unblock_async_signals (); |
26826
20881d195d20
fix handling of SIGTSTP (bug #51903)
John W. Eaton <jwe@octave.org>
parents:
26603
diff
changeset
|
291 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
|
292 |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
293 if (type == et_async) |
22264
9b78fda78300
fix build failure for --without-z (bug #48757)
John W. Eaton <jwe@octave.org>
parents:
22094
diff
changeset
|
294 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
|
295 else if (return_output) |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
296 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
|
297 else |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
298 { |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
299 int status = sys::system (cmd_str); |
2321 | 300 |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
301 // 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
|
302 // 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
|
303 // 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
|
304 // failure code. |
20582
ba2b07c13913
use new string_value method to handle value extraction errors
John W. Eaton <jwe@octave.org>
parents:
20555
diff
changeset
|
305 |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
306 if (sys::wifexited (status)) |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
307 status = sys::wexitstatus (status); |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
308 |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
309 retval(0) = status; |
1683 | 310 } |
311 | |
312 return retval; | |
313 } | |
314 | |
12846
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
315 /* |
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
316 %!test |
14018
5d5685216876
Deprecate shell_cmd function and update system, dos, unix commands
Rik <octave@nomad.inbox5.com>
parents:
14016
diff
changeset
|
317 %! cmd = ls_command (); |
12846
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
318 %! [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
|
319 %! assert (status, 0); |
12846
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
320 %! assert (ischar (output)); |
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
321 %! assert (! isempty (output)); |
14018
5d5685216876
Deprecate shell_cmd function and update system, dos, unix commands
Rik <octave@nomad.inbox5.com>
parents:
14016
diff
changeset
|
322 |
5d5685216876
Deprecate shell_cmd function and update system, dos, unix commands
Rik <octave@nomad.inbox5.com>
parents:
14016
diff
changeset
|
323 %!error system () |
5d5685216876
Deprecate shell_cmd function and update system, dos, unix commands
Rik <octave@nomad.inbox5.com>
parents:
14016
diff
changeset
|
324 %!error system (1, 2, 3) |
12846
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
325 */ |
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
326 |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
327 static octave_value |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
328 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
|
329 { |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
330 if (m.isfield (key)) |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
331 { |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
332 Cell c = m.contents (key); |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
333 |
23577
80c42f4cca13
maint: Deprecate is_empty and replace with isempty.
Rik <rik@octave.org>
parents:
23487
diff
changeset
|
334 if (! c.isempty ()) |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
335 return c(0); |
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 |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
338 return octave_value (); |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
339 } |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
340 |
21434
1da428cbf401
deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents:
21421
diff
changeset
|
341 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
|
342 doc: /* -*- texinfo -*- |
30888
32d2b6604a9f
doc: Ensure documentation lists output argument when it exists for functions in libinterp/
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
343 @deftypefn {} {@var{S} =} __octave_config_info__ () |
32d2b6604a9f
doc: Ensure documentation lists output argument when it exists for functions in libinterp/
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
344 @deftypefnx {} {@var{S} =} __octave_config_info__ (@var{option}) |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
345 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
|
346 Octave. |
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 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
|
349 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
|
350 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21949
diff
changeset
|
351 @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
|
352 @end deftypefn */) |
2162 | 353 { |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
354 static octave_scalar_map config; |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
355 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
|
356 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
|
357 |
4357 | 358 static bool initialized = false; |
2162 | 359 |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
360 if (! initialized) |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
361 { |
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
362 std::map<std::string, octave_value> conf_info_map |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
363 = {{ "DEFAULT_PAGER", config::default_pager () }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
364 |
21229
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
21226
diff
changeset
|
365 #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
|
366 { "ENABLE_64", true }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
367 #else |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
368 { "ENABLE_64", false }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
369 #endif |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
370 |
27534
f70d7a9ee3fd
include ENABLE_COMMAND_LINE_PUSH_PARSER in build info struct
John W. Eaton <jwe@octave.org>
parents:
27486
diff
changeset
|
371 #if defined (OCTAVE_ENABLE_COMMAND_LINE_PUSH_PARSER) |
f70d7a9ee3fd
include ENABLE_COMMAND_LINE_PUSH_PARSER in build info struct
John W. Eaton <jwe@octave.org>
parents:
27486
diff
changeset
|
372 { "ENABLE_COMMAND_LINE_PUSH_PARSER", true }, |
f70d7a9ee3fd
include ENABLE_COMMAND_LINE_PUSH_PARSER in build info struct
John W. Eaton <jwe@octave.org>
parents:
27486
diff
changeset
|
373 #else |
f70d7a9ee3fd
include ENABLE_COMMAND_LINE_PUSH_PARSER in build info struct
John W. Eaton <jwe@octave.org>
parents:
27486
diff
changeset
|
374 { "ENABLE_COMMAND_LINE_PUSH_PARSER", false }, |
f70d7a9ee3fd
include ENABLE_COMMAND_LINE_PUSH_PARSER in build info struct
John W. Eaton <jwe@octave.org>
parents:
27486
diff
changeset
|
375 #endif |
f70d7a9ee3fd
include ENABLE_COMMAND_LINE_PUSH_PARSER in build info struct
John W. Eaton <jwe@octave.org>
parents:
27486
diff
changeset
|
376 |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
377 #if defined (ENABLE_DOCS) |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
378 { "ENABLE_DOCS", true }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
379 #else |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
380 { "ENABLE_DOCS", false }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
381 #endif |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
382 |
21229
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
21226
diff
changeset
|
383 #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
|
384 { "ENABLE_FLOAT_TRUNCATE", true }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
385 #else |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
386 { "ENABLE_FLOAT_TRUNCATE", false }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
387 #endif |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
388 |
21229
a83e7a384ee0
create and install a subset of config.h in octave-config.h
John W. Eaton <jwe@octave.org>
parents:
21226
diff
changeset
|
389 #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
|
390 { "ENABLE_OPENMP", true }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
391 #else |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
392 { "ENABLE_OPENMP", false }, |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
393 #endif |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
394 |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
395 { "api_version", OCTAVE_API_VERSION }, |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
396 { "archlibdir", config::arch_lib_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
397 { "bindir", config::bin_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
398 { "canonical_host_type", config::canonical_host_type () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
399 { "datadir", config::data_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
400 { "datarootdir", config::dataroot_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
401 { "fcnfiledir", config::fcn_file_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
402 { "fftw_version", fftw_version () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
403 { "fftwf_version", fftwf_version () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
404 { "imagedir", config::image_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
405 { "includedir", config::include_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
406 { "infodir", config::info_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
407 { "libdir", config::lib_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
408 { "libexecdir", config::libexec_dir () }, |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
409 // 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
|
410 // 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
|
411 // 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
|
412 { "hg_id", liboctinterp_hg_id () }, |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
413 { "localapiarchlibdir", config::local_api_arch_lib_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
414 { "localapifcnfiledir", config::local_api_fcn_file_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
415 { "localapioctfiledir", config::local_api_oct_file_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
416 { "localarchlibdir", config::local_arch_lib_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
417 { "localfcnfiledir", config::local_fcn_file_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
418 { "localoctfiledir", config::local_oct_file_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
419 { "localstartupfiledir", config::local_startupfile_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
420 { "localverarchlibdir", config::local_ver_arch_lib_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
421 { "localverfcnfiledir", config::local_ver_fcn_file_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
422 { "localveroctfiledir", config::local_ver_oct_file_dir () }, |
29462
280defaf2023
pkg.m: Install local packages in version dependent path (bug #58299).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29359
diff
changeset
|
423 { "major_version", STRINGIFY (OCTAVE_MAJOR_VERSION) }, |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
424 { "man1dir", config::man1_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
425 { "man1ext", config::man1_ext () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
426 { "mandir", config::man_dir () }, |
29462
280defaf2023
pkg.m: Install local packages in version dependent path (bug #58299).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29359
diff
changeset
|
427 { "minor_version", STRINGIFY (OCTAVE_MINOR_VERSION) }, |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
428 { "octdatadir", config::oct_data_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
429 { "octdocdir", config::oct_doc_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
430 { "octetcdir", config::oct_etc_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
431 { "octfiledir", config::oct_file_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
432 { "octfontsdir", config::oct_fonts_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
433 { "octincludedir", config::oct_include_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
434 { "octlibdir", config::oct_lib_dir () }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
435 { "octtestsdir", config::oct_tests_dir () }, |
29462
280defaf2023
pkg.m: Install local packages in version dependent path (bug #58299).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29359
diff
changeset
|
436 { "patch_version", STRINGIFY (OCTAVE_PATCH_VERSION) }, |
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 }, |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
438 { "startupfiledir", 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 |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
442 = {{ "AMD_CPPFLAGS", build_env::AMD_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
443 { "AMD_LDFLAGS", build_env::AMD_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
444 { "AMD_LIBS", build_env::AMD_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
445 { "AR", build_env::AR }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
446 { "ARFLAGS", build_env::ARFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
447 { "ARPACK_CPPFLAGS", build_env::ARPACK_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
448 { "ARPACK_LDFLAGS", build_env::ARPACK_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
449 { "ARPACK_LIBS", build_env::ARPACK_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
450 { "BLAS_LIBS", build_env::BLAS_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
451 { "CAMD_CPPFLAGS", build_env::CAMD_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
452 { "CAMD_LDFLAGS", build_env::CAMD_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
453 { "CAMD_LIBS", build_env::CAMD_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
454 { "CARBON_LIBS", build_env::CARBON_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
455 { "CC", build_env::CC }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
456 { "CCOLAMD_CPPFLAGS", build_env::CCOLAMD_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
457 { "CCOLAMD_LDFLAGS", build_env::CCOLAMD_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
458 { "CCOLAMD_LIBS", build_env::CCOLAMD_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
459 { "CFLAGS", build_env::CFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
460 { "CHOLMOD_CPPFLAGS", build_env::CHOLMOD_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
461 { "CHOLMOD_LDFLAGS", build_env::CHOLMOD_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
462 { "CHOLMOD_LIBS", build_env::CHOLMOD_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
463 { "COLAMD_CPPFLAGS", build_env::COLAMD_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
464 { "COLAMD_LDFLAGS", build_env::COLAMD_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
465 { "COLAMD_LIBS", build_env::COLAMD_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
466 { "CPICFLAG", build_env::CPICFLAG }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
467 { "CPPFLAGS", build_env::CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
468 { "CURL_CPPFLAGS", build_env::CURL_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
469 { "CURL_LDFLAGS", build_env::CURL_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
470 { "CURL_LIBS", build_env::CURL_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
471 { "CXSPARSE_CPPFLAGS", build_env::CXSPARSE_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
472 { "CXSPARSE_LDFLAGS", build_env::CXSPARSE_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
473 { "CXSPARSE_LIBS", build_env::CXSPARSE_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
474 { "CXX", build_env::CXX }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
475 { "CXXCPP", build_env::CXXCPP }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
476 { "CXXFLAGS", build_env::CXXFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
477 { "CXXPICFLAG", build_env::CXXPICFLAG }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
478 { "DEFS", build_env::DEFS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
479 { "DL_LDFLAGS", build_env::DL_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
480 { "GCC_VERSION", build_env::GCC_VERSION }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
481 { "GXX_VERSION", build_env::GXX_VERSION }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
482 { "EXEEXT", build_env::EXEEXT }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
483 { "F77", build_env::F77 }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
484 { "F77_FLOAT_STORE_FLAG", build_env::F77_FLOAT_STORE_FLAG }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
485 { "F77_INTEGER_8_FLAG", build_env::F77_INTEGER_8_FLAG }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
486 { "FFLAGS", build_env::FFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
487 { "FFTW3_CPPFLAGS", build_env::FFTW3_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
488 { "FFTW3_LDFLAGS", build_env::FFTW3_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
489 { "FFTW3_LIBS", build_env::FFTW3_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
490 { "FFTW3F_CPPFLAGS", build_env::FFTW3F_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
491 { "FFTW3F_LDFLAGS", build_env::FFTW3F_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
492 { "FFTW3F_LIBS", build_env::FFTW3F_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
493 { "FLIBS", build_env::FLIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
494 { "FLTK_CPPFLAGS", build_env::FLTK_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
495 { "FLTK_LDFLAGS", build_env::FLTK_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
496 { "FLTK_LIBS", build_env::FLTK_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
497 { "FONTCONFIG_CPPFLAGS", build_env::FONTCONFIG_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
498 { "FONTCONFIG_LIBS", build_env::FONTCONFIG_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
499 { "FPICFLAG", build_env::FPICFLAG }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
500 { "FT2_CPPFLAGS", build_env::FT2_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
501 { "FT2_LIBS", build_env::FT2_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
502 { "GLPK_CPPFLAGS", build_env::GLPK_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
503 { "GLPK_LDFLAGS", build_env::GLPK_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
504 { "GLPK_LIBS", build_env::GLPK_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
505 { "GNUPLOT", build_env::GNUPLOT }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
506 { "HDF5_CPPFLAGS", build_env::HDF5_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
507 { "HDF5_LDFLAGS", build_env::HDF5_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
508 { "HDF5_LIBS", build_env::HDF5_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
509 { "LAPACK_LIBS", build_env::LAPACK_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
510 { "LDFLAGS", build_env::LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
511 { "LD_STATIC_FLAG", build_env::LD_STATIC_FLAG }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
512 { "LEX", build_env::LEX }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
513 { "LEXLIB", build_env::LEXLIB }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
514 { "LFLAGS", build_env::LFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
515 { "LIBOCTAVE", build_env::LIBOCTAVE }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
516 { "LIBOCTINTERP", build_env::LIBOCTINTERP }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
517 { "LIBS", build_env::LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
518 { "LN_S", build_env::LN_S }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
519 { "MAGICK_CPPFLAGS", build_env::MAGICK_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
520 { "MAGICK_LDFLAGS", build_env::MAGICK_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
521 { "MAGICK_LIBS", build_env::MAGICK_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
522 { "MKOCTFILE_DL_LDFLAGS", build_env::MKOCTFILE_DL_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
523 { "OCTAVE_LINK_DEPS", build_env::OCTAVE_LINK_DEPS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
524 { "OCTAVE_LINK_OPTS", build_env::OCTAVE_LINK_OPTS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
525 { "OCT_LINK_DEPS", build_env::OCT_LINK_DEPS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
526 { "OCT_LINK_OPTS", build_env::OCT_LINK_OPTS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
527 { "OPENGL_LIBS", build_env::OPENGL_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
528 { "PCRE_CPPFLAGS", build_env::PCRE_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
529 { "PCRE_LDFLAGS", build_env::PCRE_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
530 { "PCRE_LIBS", build_env::PCRE_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
531 { "PTHREAD_CFLAGS", build_env::PTHREAD_CFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
532 { "PTHREAD_LIBS", build_env::PTHREAD_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
533 { "QHULL_CPPFLAGS", build_env::QHULL_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
534 { "QHULL_LDFLAGS", build_env::QHULL_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
535 { "QHULL_LIBS", build_env::QHULL_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
536 { "QRUPDATE_CPPFLAGS", build_env::QRUPDATE_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
537 { "QRUPDATE_LDFLAGS", build_env::QRUPDATE_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
538 { "QRUPDATE_LIBS", build_env::QRUPDATE_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
539 { "QT_CPPFLAGS", build_env::QT_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
540 { "QT_LDFLAGS", build_env::QT_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
541 { "QT_LIBS", build_env::QT_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
542 { "QT_OPENGL_LIBS", build_env::QT_OPENGL_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
543 { "RANLIB", build_env::RANLIB }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
544 { "RDYNAMIC_FLAG", build_env::RDYNAMIC_FLAG }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
545 { "READLINE_LIBS", build_env::READLINE_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
546 { "SHARED_LIBS", build_env::SHARED_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
547 { "SH_LDFLAGS", build_env::SH_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
548 { "STATIC_LIBS", build_env::STATIC_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
549 { "SUITESPARSECONFIG_LIBS", build_env::SUITESPARSECONFIG_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
550 { "UMFPACK_CPPFLAGS", build_env::UMFPACK_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
551 { "UMFPACK_LDFLAGS", build_env::UMFPACK_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
552 { "UMFPACK_LIBS", build_env::UMFPACK_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
553 { "WARN_CFLAGS", build_env::WARN_CFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
554 { "WARN_CXXFLAGS", build_env::WARN_CXXFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
555 { "X11_INCFLAGS", build_env::X11_INCFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
556 { "X11_LIBS", build_env::X11_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
557 { "XTRA_CFLAGS", build_env::XTRA_CFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
558 { "XTRA_CXXFLAGS", build_env::XTRA_CXXFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
559 { "YACC", build_env::YACC }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
560 { "YFLAGS", build_env::YFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
561 { "Z_CPPFLAGS", build_env::Z_CPPFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
562 { "Z_LDFLAGS", build_env::Z_LDFLAGS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
563 { "Z_LIBS", build_env::Z_LIBS }, |
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
564 { "config_opts", build_env::config_opts }}; |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
565 |
23715
e8e27cd4156c
* toplev.cc (F__octave_config_info__): Reorganize initialization.
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
566 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
|
567 build_env = octave_scalar_map (build_env_map); |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
568 build_features = build_env::features (); |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
569 |
4691 | 570 bool unix_system = true; |
7013 | 571 bool mac_system = false; |
4691 | 572 bool windows_system = false; |
573 | |
21979
d04da18a407a
use OCTAVE_USE_WINDOWS_API more consistently
John W. Eaton <jwe@octave.org>
parents:
21966
diff
changeset
|
574 #if defined (__WIN32__) |
4691 | 575 windows_system = true; |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
20785
diff
changeset
|
576 #if ! defined (__CYGWIN__) |
4691 | 577 unix_system = false; |
578 #endif | |
579 #endif | |
580 | |
8574
83b8c739d626
toplev.cc: check OCTAVE_USE_OS_X_API instead of __APPLE__ && __MACH__
John W. Eaton <jwe@octave.org>
parents:
8377
diff
changeset
|
581 #if defined (OCTAVE_USE_OS_X_API) |
7010 | 582 mac_system = true; |
583 #endif | |
584 | |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
585 config.assign ("unix", octave_value (unix_system)); |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
586 config.assign ("mac", octave_value (mac_system)); |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
587 config.assign ("windows", octave_value (windows_system)); |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
588 |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
589 mach_info::float_format ff = mach_info::native_float_format (); |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
590 config.assign ("float_format", |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
591 octave_value (mach_info::float_format_as_string (ff))); |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
592 |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
593 config.assign ("words_big_endian", |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
594 octave_value (mach_info::words_big_endian ())); |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
595 |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
596 config.assign ("words_little_endian", |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
597 octave_value (mach_info::words_little_endian ())); |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
598 |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
599 config.assign ("build_environment", octave_value (build_env)); |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
600 |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
601 config.assign ("build_features", octave_value (build_features)); |
4691 | 602 |
4357 | 603 initialized = true; |
604 } | |
2162 | 605 |
2689 | 606 int nargin = args.length (); |
607 | |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
608 if (nargin > 1) |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
609 print_usage (); |
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
610 |
20939
b17fda023ca6
maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents:
20923
diff
changeset
|
611 octave_value_list retval; |
b17fda023ca6
maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents:
20923
diff
changeset
|
612 |
2689 | 613 if (nargin == 1) |
614 { | |
21434
1da428cbf401
deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents:
21421
diff
changeset
|
615 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
|
616 |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
617 octave_value info = find_config_info (config, arg); |
2689 | 618 |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
619 if (info.is_undefined ()) |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
620 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
|
621 |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
622 if (info.is_undefined ()) |
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
623 info = find_config_info (build_features, arg); |
5199 | 624 |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
625 if (info.is_undefined ()) |
21434
1da428cbf401
deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents:
21421
diff
changeset
|
626 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
|
627 |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
628 return info; |
2689 | 629 } |
20799
c349d4c91ce2
eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
630 else |
21226
a55b8ece1ecd
reorganize octave_config_info again
John W. Eaton <jwe@octave.org>
parents:
21220
diff
changeset
|
631 retval = ovl (config); |
2689 | 632 |
633 return retval; | |
2162 | 634 } |
635 | |
12846
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
636 /* |
21434
1da428cbf401
deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents:
21421
diff
changeset
|
637 %!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
|
638 %!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
|
639 %!test |
21434
1da428cbf401
deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents:
21421
diff
changeset
|
640 %! x = __octave_config_info__ (); |
12846
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
641 %! assert (isstruct (x)); |
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
642 %! assert (! isempty (x)); |
22751
e078f5607762
Fix failing BIST test in toplev.cc (bug #49575).
Rik <rik@octave.org>
parents:
22501
diff
changeset
|
643 %! assert (x.version, OCTAVE_VERSION ()); |
21603
37cbdf7bffa9
Add fftwf_version (bug #45659)
mmuetzel <markus.muetzel@gmx.de>
parents:
21600
diff
changeset
|
644 |
21434
1da428cbf401
deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents:
21421
diff
changeset
|
645 %!error __octave_config_info__ (1, 2) |
12846
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
646 */ |
9ce9e1e2d2c8
codesprint: new tests for toplev.cc
John W. Eaton <jwe@octave.org>
parents:
12483
diff
changeset
|
647 |
31605
e88a07dec498
maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents:
31415
diff
changeset
|
648 OCTAVE_END_NAMESPACE(octave) |
29958
32c3a5805893
move DEFUN and DEFMETHOD functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29949
diff
changeset
|
649 |
1683 | 650 #if defined (__GNUG__) && defined (DEBUG_NEW_DELETE) |
2806 | 651 |
1683 | 652 int debug_new_delete = 0; |
653 | |
654 typedef void (*vfp)(void); | |
655 extern vfp __new_handler; | |
656 | |
657 void * | |
29654
d13d090cb03a
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
658 __builtin_new (std::size_t sz) |
1683 | 659 { |
660 void *p; | |
661 | |
20946 | 662 // malloc (0) is unpredictable; avoid it. |
1683 | 663 if (sz == 0) |
664 sz = 1; | |
21942
aab79a1885cc
limit gnulib headers to liboctave/wrappers directory
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
665 p = std::malloc (sz); |
1683 | 666 while (p == 0) |
667 { | |
668 (*__new_handler) (); | |
21942
aab79a1885cc
limit gnulib headers to liboctave/wrappers directory
John W. Eaton <jwe@octave.org>
parents:
21921
diff
changeset
|
669 p = std::malloc (sz); |
1683 | 670 } |
671 | |
672 if (debug_new_delete) | |
5629 | 673 std::cerr << "__builtin_new: " << p << std::endl; |
1683 | 674 |
675 return p; | |
676 } | |
677 | |
678 void | |
679 __builtin_delete (void *ptr) | |
680 { | |
681 if (debug_new_delete) | |
5629 | 682 std::cerr << "__builtin_delete: " << ptr << std::endl; |
1683 | 683 |
23878
889b8262e661
maint: eliminate useless if (p) before free (p)
Mike Miller <mtmiller@octave.org>
parents:
23803
diff
changeset
|
684 free (ptr); |
1683 | 685 } |
2806 | 686 |
1683 | 687 #endif |