Mercurial > octave
annotate src/octave-config.in.cc @ 27923:bd51beb6205e
update formatting of copyright notices
* Use <https://octave.org/copyright/> instead of
<https://octave.org/COPYRIGHT.html/>.
* For consistency with other comments in the Octave sources, use
C++-style comments for copyright blocks in C and C++ files.
* Use delimiters above and below copyright blocks that are appropriate
for the language used in the file.
* Eliminate extra spacing inside copyright blocks.
* lex.ll (looks_like_copyright): Also allow newlines and carriage
returns before the word "Copyright".
* scripts/mk-doc.pl (gethelp): Also skip empty comment lines.
* bp-table.cc, type.m: Adjust tests.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 08 Jan 2020 11:59:41 -0500 |
parents | 1891570abac8 |
children | 49a0d90cd2a3 |
rev | line source |
---|---|
18360
f1ee47866e6b
use common code to get OCTAVE_HOME in main, octave-config and mkoctfile
John W. Eaton <jwe@octave.org>
parents:
18357
diff
changeset
|
1 // %NO_EDIT_WARNING% |
8920 | 2 |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
3 //////////////////////////////////////////////////////////////////////// |
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 // Copyright (C) 2008-2020 The Octave Project Developers |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // 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
|
8 // distribution or <https://octave.org/copyright/>. |
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 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // 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
|
13 // 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
|
14 // 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
|
15 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // 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
|
18 // 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
|
19 // 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
|
20 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // 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
|
23 // 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
|
24 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
25 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
26 //////////////////////////////////////////////////////////////////////// |
8920 | 27 |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
28 #if defined (HAVE_CONFIG_H) |
21301
40de9f8f23a6
Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents:
21202
diff
changeset
|
29 # include "config.h" |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
30 #endif |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
31 |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
32 #include <string> |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
33 #include <map> |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
34 #include <iostream> |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
35 #include <algorithm> |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
36 #include <cstdlib> |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
37 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
38 #if ! defined (OCTAVE_PREFIX) |
21202
f7121e111991
maint: indent #ifdef blocks in liboctave and src directories.
Rik <rik@octave.org>
parents:
19986
diff
changeset
|
39 # define OCTAVE_PREFIX %OCTAVE_PREFIX% |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
40 #endif |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
41 |
23712
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
42 #if ! defined (OCTAVE_EXEC_PREFIX) |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
43 # define OCTAVE_EXEC_PREFIX %OCTAVE_EXEC_PREFIX% |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
44 #endif |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
45 |
23801
9d67bd90681b
cross tools: define OCTAVE_UNUSED if not defined
John D <john.donoghue@ieee.org>
parents:
23712
diff
changeset
|
46 #ifndef OCTAVE_UNUSED |
9d67bd90681b
cross tools: define OCTAVE_UNUSED if not defined
John D <john.donoghue@ieee.org>
parents:
23712
diff
changeset
|
47 # define OCTAVE_UNUSED |
9d67bd90681b
cross tools: define OCTAVE_UNUSED if not defined
John D <john.donoghue@ieee.org>
parents:
23712
diff
changeset
|
48 #endif |
9d67bd90681b
cross tools: define OCTAVE_UNUSED if not defined
John D <john.donoghue@ieee.org>
parents:
23712
diff
changeset
|
49 |
18360
f1ee47866e6b
use common code to get OCTAVE_HOME in main, octave-config and mkoctfile
John W. Eaton <jwe@octave.org>
parents:
18357
diff
changeset
|
50 #include "shared-fcns.h" |
f1ee47866e6b
use common code to get OCTAVE_HOME in main, octave-config and mkoctfile
John W. Eaton <jwe@octave.org>
parents:
18357
diff
changeset
|
51 |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
52 static std::map<std::string,std::string> vars; |
18360
f1ee47866e6b
use common code to get OCTAVE_HOME in main, octave-config and mkoctfile
John W. Eaton <jwe@octave.org>
parents:
18357
diff
changeset
|
53 |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
54 static std::string usage_msg = "usage: octave-config [options]"; |
18360
f1ee47866e6b
use common code to get OCTAVE_HOME in main, octave-config and mkoctfile
John W. Eaton <jwe@octave.org>
parents:
18357
diff
changeset
|
55 |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
56 static std::string help_msg = |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
57 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
58 "Options:\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
59 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
60 " -h, -?, --help Print this message.\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
61 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
62 " --m-site-dir Print the name of the directory where Octave\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
63 " expects to find locally installed .m files.\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
64 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
65 " --oct-site-dir Print the name of the directory where Octave\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
66 " expects to find locally installed .oct files.\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
67 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
68 " -p VAR, --print VAR Print the value of the given configuration\n" |
18023
4138a7f80779
maint: Replace tabs with spaces in octave-config input files.
Rik <rik@octave.org>
parents:
17789
diff
changeset
|
69 " variable VAR. Recognized variables are:\n" |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
70 "\n" |
24899
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24875
diff
changeset
|
71 " API_VERSION LOCALFCNFILEDIR\n" |
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24875
diff
changeset
|
72 " ARCHLIBDIR LOCALOCTFILEDIR\n" |
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24875
diff
changeset
|
73 " BINDIR LOCALSTARTUPFILEDIR\n" |
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24875
diff
changeset
|
74 " CANONICAL_HOST_TYPE LOCALVERARCHLIBDIR\n" |
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24875
diff
changeset
|
75 " DATADIR LOCALVERFCNFILEDIR\n" |
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24875
diff
changeset
|
76 " DATAROOTDIR LOCALVEROCTFILEDIR\n" |
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24875
diff
changeset
|
77 " DEFAULT_PAGER MAN1DIR\n" |
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24875
diff
changeset
|
78 " EXEC_PREFIX MAN1EXT\n" |
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24875
diff
changeset
|
79 " EXEEXT MANDIR\n" |
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24875
diff
changeset
|
80 " FCNFILEDIR OCTAVE_EXEC_HOME\n" |
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24875
diff
changeset
|
81 " IMAGEDIR OCTAVE_HOME\n" |
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24875
diff
changeset
|
82 " INCLUDEDIR OCTDATADIR\n" |
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24875
diff
changeset
|
83 " INFODIR OCTDOCDIR\n" |
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24875
diff
changeset
|
84 " INFOFILE OCTFILEDIR\n" |
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24875
diff
changeset
|
85 " LIBDIR OCTFONTSDIR\n" |
24875
7c7b60dd4d4c
Generate Qt compressed help and collection files for the manual (bug #53006)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24534
diff
changeset
|
86 " LIBEXECDIR OCTINCLUDEDIR\n" |
7c7b60dd4d4c
Generate Qt compressed help and collection files for the manual (bug #53006)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24534
diff
changeset
|
87 " LOCALAPIARCHLIBDIR OCTLIBDIR\n" |
7c7b60dd4d4c
Generate Qt compressed help and collection files for the manual (bug #53006)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24534
diff
changeset
|
88 " LOCALAPIFCNFILEDIR STARTUPFILEDIR\n" |
7c7b60dd4d4c
Generate Qt compressed help and collection files for the manual (bug #53006)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24534
diff
changeset
|
89 " LOCALAPIOCTFILEDIR VERSION\n" |
24899
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24875
diff
changeset
|
90 " LOCALARCHLIBDIR\n" |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
91 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
92 " -v, --version Print the Octave version number.\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
93 "\n"; |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
94 |
8092
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
95 static void |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
96 initialize (void) |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
97 { |
23712
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
98 set_octave_home (); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
99 |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
100 vars["OCTAVE_HOME"] = Voctave_home; |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
101 vars["OCTAVE_EXEC_HOME"] = Voctave_exec_home; |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
102 |
8092
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
103 vars["API_VERSION"] = %OCTAVE_API_VERSION%; |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
104 vars["CANONICAL_HOST_TYPE"] = %OCTAVE_CANONICAL_HOST_TYPE%; |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
105 vars["DEFAULT_PAGER"] = %OCTAVE_DEFAULT_PAGER%; |
23712
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
106 vars["EXEEXT"] = %OCTAVE_EXEEXT%; |
18357
159ddd7ce1b3
octave-config: Rebase dir variables to OCTAVE_HOME only when it is defined
Mike Miller <mtmiller@ieee.org>
parents:
18349
diff
changeset
|
107 vars["MAN1EXT"] = %OCTAVE_MAN1EXT%; |
159ddd7ce1b3
octave-config: Rebase dir variables to OCTAVE_HOME only when it is defined
Mike Miller <mtmiller@ieee.org>
parents:
18349
diff
changeset
|
108 vars["VERSION"] = %OCTAVE_VERSION%; |
159ddd7ce1b3
octave-config: Rebase dir variables to OCTAVE_HOME only when it is defined
Mike Miller <mtmiller@ieee.org>
parents:
18349
diff
changeset
|
109 |
23712
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
110 vars["ARCHLIBDIR"] = prepend_octave_exec_home (%OCTAVE_ARCHLIBDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
111 vars["BINDIR"] = prepend_octave_exec_home (%OCTAVE_BINDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
112 vars["DATADIR"] = prepend_octave_home (%OCTAVE_DATADIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
113 vars["DATAROOTDIR"] = prepend_octave_home (%OCTAVE_DATAROOTDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
114 vars["FCNFILEDIR"] = prepend_octave_home (%OCTAVE_FCNFILEDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
115 vars["IMAGEDIR"] = prepend_octave_home (%OCTAVE_IMAGEDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
116 vars["INCLUDEDIR"] = prepend_octave_home (%OCTAVE_INCLUDEDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
117 vars["INFODIR"] = prepend_octave_home (%OCTAVE_INFODIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
118 vars["INFOFILE"] = prepend_octave_home (%OCTAVE_INFOFILE%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
119 vars["LIBDIR"] = prepend_octave_exec_home (%OCTAVE_LIBDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
120 vars["LIBEXECDIR"] = prepend_octave_exec_home (%OCTAVE_LIBEXECDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
121 vars["LOCALAPIARCHLIBDIR"] = prepend_octave_exec_home (%OCTAVE_LOCALAPIARCHLIBDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
122 vars["LOCALAPIFCNFILEDIR"] = prepend_octave_home (%OCTAVE_LOCALAPIFCNFILEDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
123 vars["LOCALAPIOCTFILEDIR"] = prepend_octave_exec_home (%OCTAVE_LOCALAPIOCTFILEDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
124 vars["LOCALARCHLIBDIR"] = prepend_octave_exec_home (%OCTAVE_LOCALARCHLIBDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
125 vars["LOCALFCNFILEDIR"] = prepend_octave_home (%OCTAVE_LOCALFCNFILEDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
126 vars["LOCALOCTFILEDIR"] = prepend_octave_exec_home (%OCTAVE_LOCALOCTFILEDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
127 vars["LOCALSTARTUPFILEDIR"] = prepend_octave_home (%OCTAVE_LOCALSTARTUPFILEDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
128 vars["LOCALVERARCHLIBDIR"] = prepend_octave_exec_home (%OCTAVE_LOCALVERARCHLIBDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
129 vars["LOCALVERFCNFILEDIR"] = prepend_octave_home (%OCTAVE_LOCALVERFCNFILEDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
130 vars["LOCALVEROCTFILEDIR"] = prepend_octave_exec_home (%OCTAVE_LOCALVEROCTFILEDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
131 vars["MAN1DIR"] = prepend_octave_home (%OCTAVE_MAN1DIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
132 vars["MANDIR"] = prepend_octave_home (%OCTAVE_MANDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
133 vars["OCTDATADIR"] = prepend_octave_home (%OCTAVE_OCTDATADIR%); |
24875
7c7b60dd4d4c
Generate Qt compressed help and collection files for the manual (bug #53006)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24534
diff
changeset
|
134 vars["OCTDOCDIR"] = prepend_octave_home (%OCTAVE_OCTDOCDIR%); |
23712
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
135 vars["OCTFILEDIR"] = prepend_octave_exec_home (%OCTAVE_OCTFILEDIR%); |
24899
1a46d174a483
include a proper definition of Octave's private font fallback directory
Mike Miller <mtmiller@octave.org>
parents:
24875
diff
changeset
|
136 vars["OCTFONTSDIR"] = prepend_octave_home (%OCTAVE_OCTFONTSDIR%); |
23712
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
137 vars["OCTINCLUDEDIR"] = prepend_octave_home (%OCTAVE_OCTINCLUDEDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
138 vars["OCTLIBDIR"] = prepend_octave_exec_home (%OCTAVE_OCTLIBDIR%); |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
139 vars["STARTUPFILEDIR"] = prepend_octave_home (%OCTAVE_STARTUPFILEDIR%); |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
140 } |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
141 |
8092
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
142 int |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
143 main (int argc, char **argv) |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
144 { |
8092
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
145 initialize (); |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
146 |
8092
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
147 if (argc == 1) |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
148 { |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
149 std::cout << usage_msg << std::endl; |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
150 return 1; |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
151 } |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
152 |
8092
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
153 for (int i = 1; i < argc; i++) |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
154 { |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
155 std::string arg (argv[i]); |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
156 |
8092
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
157 if (arg == "-h" || arg == "-?" || arg == "--help") |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
158 { |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
159 std::cout << usage_msg << std::endl; |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
160 std::cout << help_msg; |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
161 return 0; |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
162 } |
8092
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
163 else if (arg == "--m-site-dir") |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
164 std::cout << vars["LOCALVERFCNFILEDIR"] << std::endl; |
8092
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
165 else if (arg == "--oct-site-dir") |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
166 std::cout << vars["LOCALVEROCTFILEDIR"] << std::endl; |
8092
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
167 else if (arg == "-v" || arg == "--version") |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
168 std::cout << vars["VERSION"] << std::endl; |
8092
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
169 else if (arg == "-p" || arg == "--print") |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
170 { |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
171 if (i < argc-1) |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
172 { |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
173 arg = argv[++i]; |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
174 std::cout << vars[arg] << std::endl; |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
175 } |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
176 else |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
177 { |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
178 std::cerr << "octave-config: " << arg |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
179 << " options requires argument" << std::endl; |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
180 return 1; |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
181 } |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
182 } |
8092
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
183 else |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
184 { |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
185 std::cerr << "octave-config: unrecognized argument " << arg |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
186 << std::endl; |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
187 return 1; |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
188 } |
8092
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
189 } |
13141
e81ddf9cacd5
maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
12733
diff
changeset
|
190 |
8092
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
191 return 0; |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
192 } |