Mercurial > octave
annotate src/mkoctfile.in.cc @ 24622:298c6a6bd869
Accept compound unrecognized arguments to mkoctfile (bug #52928).
* mkoctfile.in.cc: Check if the next string following an unrecognized argument
is an option (begin with '-') or not. If it is not an option then assume it
is part of the unrecognized argument and pass it through.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 19 Jan 2018 13:25:24 -0800 |
parents | 194eb4bd202b |
children | ab2321d4ba03 |
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:
18349
diff
changeset
|
1 // %NO_EDIT_WARNING% |
8920 | 2 /* |
3 | |
23219
3ac9f9ecfae5
maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents:
23083
diff
changeset
|
4 Copyright (C) 2008-2017 Michael Goffioul |
8920 | 5 |
6 This file is part of Octave. | |
7 | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23807
diff
changeset
|
8 Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22599
diff
changeset
|
9 under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23807
diff
changeset
|
10 the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22599
diff
changeset
|
11 (at your option) any later version. |
8920 | 12 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22599
diff
changeset
|
13 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22599
diff
changeset
|
14 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22599
diff
changeset
|
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22599
diff
changeset
|
16 GNU General Public License for more details. |
8920 | 17 |
18 You should have received a copy of the GNU General Public License | |
19 along with Octave; see the file COPYING. If not, see | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23807
diff
changeset
|
20 <https://www.gnu.org/licenses/>. |
8920 | 21 |
22 */ | |
23 | |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
24 #if defined (HAVE_CONFIG_H) |
21301
40de9f8f23a6
Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents:
21202
diff
changeset
|
25 # include "config.h" |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
26 #endif |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
27 |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
28 #include <string> |
15299
8bd5c490b787
Fix mex compilation with subdirs on Windows platforms (bug #37122)
Rik <rik@octave.org>
parents:
15271
diff
changeset
|
29 #include <cstring> |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
30 #include <map> |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
31 #include <list> |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
32 #include <algorithm> |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
33 #include <iostream> |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
34 #include <fstream> |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
35 #include <sstream> |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
36 #include <vector> |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
37 #include <cstdlib> |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
38 |
21961
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
39 #if defined (CROSS) |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
40 # include <sys/types.h> |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
41 # include <sys/wait.h> |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
42 # include <unistd.h> |
23801
9d67bd90681b
cross tools: define OCTAVE_UNUSED if not defined
John D <john.donoghue@ieee.org>
parents:
23757
diff
changeset
|
43 |
9d67bd90681b
cross tools: define OCTAVE_UNUSED if not defined
John D <john.donoghue@ieee.org>
parents:
23757
diff
changeset
|
44 # ifndef OCTAVE_UNUSED |
9d67bd90681b
cross tools: define OCTAVE_UNUSED if not defined
John D <john.donoghue@ieee.org>
parents:
23757
diff
changeset
|
45 # define OCTAVE_UNUSED |
9d67bd90681b
cross tools: define OCTAVE_UNUSED if not defined
John D <john.donoghue@ieee.org>
parents:
23757
diff
changeset
|
46 # endif |
21961
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
47 #else |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
48 # include "unistd-wrappers.h" |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
49 # include "wait-wrappers.h" |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
50 #endif |
18916
5999e654f256
WIFEXITED and WEXITSTATUS macros for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
18915
diff
changeset
|
51 |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
52 static std::map<std::string, std::string> vars; |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
53 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
54 #if ! defined (OCTAVE_VERSION) |
21202
f7121e111991
maint: indent #ifdef blocks in liboctave and src directories.
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
55 # define OCTAVE_VERSION %OCTAVE_CONF_VERSION% |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
56 #endif |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
57 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
58 #if ! defined (OCTAVE_PREFIX) |
21202
f7121e111991
maint: indent #ifdef blocks in liboctave and src directories.
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
59 # define OCTAVE_PREFIX %OCTAVE_CONF_PREFIX% |
18360
f1ee47866e6b
use common code to get OCTAVE_HOME in main, octave-config and mkoctfile
John W. Eaton <jwe@octave.org>
parents:
18349
diff
changeset
|
60 #endif |
f1ee47866e6b
use common code to get OCTAVE_HOME in main, octave-config and mkoctfile
John W. Eaton <jwe@octave.org>
parents:
18349
diff
changeset
|
61 |
23712
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
62 #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
|
63 # define OCTAVE_EXEC_PREFIX %OCTAVE_CONF_EXEC_PREFIX% |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
64 #endif |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
65 |
18360
f1ee47866e6b
use common code to get OCTAVE_HOME in main, octave-config and mkoctfile
John W. Eaton <jwe@octave.org>
parents:
18349
diff
changeset
|
66 #include "shared-fcns.h" |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
67 |
21961
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
68 #if defined (CROSS) |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
69 |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
70 static int |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
71 octave_unlink_wrapper (const char *nm) |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
72 { |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
73 return unlink (nm); |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
74 } |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
75 |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
76 static bool |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
77 octave_wifexited_wrapper (int status) |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
78 { |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
79 return WIFEXITED (status); |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
80 } |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
81 |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
82 static int |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
83 octave_wexitstatus_wrapper (int status) |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
84 { |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
85 return WEXITSTATUS (status); |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
86 } |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
87 |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
88 #endif |
307a2d7ff29b
fix cross build of mkoctfile
John W. Eaton <jwe@octave.org>
parents:
21942
diff
changeset
|
89 |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
90 static std::string |
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
|
91 get_line (FILE *fp) |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
92 { |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
93 std::ostringstream buf; |
8091
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 while (true) |
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 { |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
97 int c = std::fgetc (fp); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
98 |
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
|
99 if (c == '\n' || c == EOF) |
12174 | 100 break; |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
101 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
102 buf << static_cast<char> (c); |
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 } |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
104 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
105 return buf.str (); |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
106 } |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
107 |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
108 static std::string |
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
109 get_variable (const char *name, const std::string& defval) |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
110 { |
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
|
111 const char *val = getenv (name); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
112 |
17898
8c33abdd2f9a
maint: Avoid using NULL in C++ code.
John W. Eaton <jwe@octave.org>
parents:
17789
diff
changeset
|
113 if (val && *val) |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
114 return std::string (val); |
17898
8c33abdd2f9a
maint: Avoid using NULL in C++ code.
John W. Eaton <jwe@octave.org>
parents:
17789
diff
changeset
|
115 else |
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
|
116 return defval; |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
117 } |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
118 |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
119 static std::string |
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
120 quote_path (const std::string& s) |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
121 { |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
122 if (s.find (' ') != std::string::npos && s[0] != '"') |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23801
diff
changeset
|
123 return '"' + s + '"'; |
8332 | 124 else |
125 return s; | |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
126 } |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
127 |
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
|
128 static void |
8332 | 129 initialize (void) |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
130 { |
23712
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
131 set_octave_home (); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
132 |
23712
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
133 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
|
134 vars["OCTAVE_EXEC_HOME"] = Voctave_exec_home; |
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
|
135 |
8332 | 136 vars["SED"] = get_variable ("SED", %OCTAVE_CONF_SED%); |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
137 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
138 vars["OCTINCLUDEDIR"] |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
139 = get_variable ("OCTINCLUDEDIR", |
23712
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
140 prepend_octave_home (%OCTAVE_CONF_OCTINCLUDEDIR%)); |
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
|
141 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
142 vars["INCLUDEDIR"] |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
143 = get_variable ("INCLUDEDIR", |
23712
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
144 prepend_octave_home (%OCTAVE_CONF_INCLUDEDIR%)); |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
145 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
146 vars["LIBDIR"] |
23712
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
147 = get_variable ("LIBDIR", prepend_octave_exec_home (%OCTAVE_CONF_LIBDIR%)); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
148 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
149 vars["OCTLIBDIR"] |
23712
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
150 = get_variable ("OCTLIBDIR", prepend_octave_exec_home (%OCTAVE_CONF_OCTLIBDIR%)); |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
151 |
21979
d04da18a407a
use OCTAVE_USE_WINDOWS_API more consistently
John W. Eaton <jwe@octave.org>
parents:
21961
diff
changeset
|
152 #if defined (OCTAVE_USE_WINDOWS_API) |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
153 std::string DEFAULT_INCFLAGS |
23804
8057d3f0673d
Use C++11 raw string literals to avoid escaping backslashes in strings.
Rik <rik@octave.org>
parents:
23803
diff
changeset
|
154 = "-I" + quote_path (vars["OCTINCLUDEDIR"] + R"(\..)") |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
155 + " -I" + quote_path (vars["OCTINCLUDEDIR"]); |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
156 #else |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
157 std::string DEFAULT_INCFLAGS |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9565
diff
changeset
|
158 = "-I" + quote_path (vars["OCTINCLUDEDIR"] + "/..") |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
159 + " -I" + quote_path (vars["OCTINCLUDEDIR"]); |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
160 #endif |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
161 |
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
|
162 if (vars["INCLUDEDIR"] != "/usr/include") |
8332 | 163 DEFAULT_INCFLAGS += " -I" + quote_path (vars["INCLUDEDIR"]); |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
164 |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
165 std::string DEFAULT_LFLAGS = "-L" + quote_path (vars["OCTLIBDIR"]); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
166 |
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 if (vars["LIBDIR"] != "/usr/lib") |
8332 | 168 DEFAULT_LFLAGS += " -L" + quote_path (vars["LIBDIR"]); |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
169 |
8332 | 170 vars["CPPFLAGS"] = get_variable ("CPPFLAGS", %OCTAVE_CONF_CPPFLAGS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
171 |
8332 | 172 vars["INCFLAGS"] = get_variable ("INCFLAGS", DEFAULT_INCFLAGS); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
173 |
15929
16418ff39a72
strip cross tool prefix from CC, CXX, etc. definitions used in mkoctfile
John W. Eaton <jwe@octave.org>
parents:
15458
diff
changeset
|
174 vars["F77"] = get_variable ("F77", %OCTAVE_CONF_MKOCTFILE_F77%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
175 |
8332 | 176 vars["FFLAGS"] = get_variable ("FFLAGS", %OCTAVE_CONF_FFLAGS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
177 |
8332 | 178 vars["FPICFLAG"] = get_variable ("FPICFLAG", %OCTAVE_CONF_FPICFLAG%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
179 |
15929
16418ff39a72
strip cross tool prefix from CC, CXX, etc. definitions used in mkoctfile
John W. Eaton <jwe@octave.org>
parents:
15458
diff
changeset
|
180 vars["CC"] = get_variable ("CC", %OCTAVE_CONF_MKOCTFILE_CC%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
181 |
8332 | 182 vars["CFLAGS"] = get_variable ("CFLAGS", %OCTAVE_CONF_CFLAGS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
183 |
8332 | 184 vars["CPICFLAG"] = get_variable ("CPICFLAG", %OCTAVE_CONF_CPICFLAG%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
185 |
15929
16418ff39a72
strip cross tool prefix from CC, CXX, etc. definitions used in mkoctfile
John W. Eaton <jwe@octave.org>
parents:
15458
diff
changeset
|
186 vars["CXX"] = get_variable ("CXX", %OCTAVE_CONF_MKOCTFILE_CXX%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
187 |
8332 | 188 vars["CXXFLAGS"] = get_variable ("CXXFLAGS", %OCTAVE_CONF_CXXFLAGS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
189 |
8332 | 190 vars["CXXPICFLAG"] = get_variable ("CXXPICFLAG", %OCTAVE_CONF_CXXPICFLAG%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
191 |
8332 | 192 vars["XTRA_CFLAGS"] = get_variable ("XTRA_CFLAGS", %OCTAVE_CONF_XTRA_CFLAGS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
193 |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
194 vars["XTRA_CXXFLAGS"] = get_variable ("XTRA_CXXFLAGS", |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
195 %OCTAVE_CONF_XTRA_CXXFLAGS%); |
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
|
196 |
15944
4803b8c138e3
use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents:
15933
diff
changeset
|
197 vars["AR"] = get_variable ("AR", %OCTAVE_CONF_MKOCTFILE_AR%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
198 |
15944
4803b8c138e3
use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents:
15933
diff
changeset
|
199 vars["RANLIB"] = get_variable ("RANLIB", %OCTAVE_CONF_MKOCTFILE_RANLIB%); |
4803b8c138e3
use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents:
15933
diff
changeset
|
200 |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
201 vars["DEPEND_FLAGS"] = get_variable ("DEPEND_FLAGS", |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
202 %OCTAVE_CONF_DEPEND_FLAGS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
203 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
204 vars["DEPEND_EXTRA_SED_PATTERN"] |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
205 = get_variable ("DEPEND_EXTRA_SED_PATTERN", |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
206 %OCTAVE_CONF_DEPEND_EXTRA_SED_PATTERN%); |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
207 |
15929
16418ff39a72
strip cross tool prefix from CC, CXX, etc. definitions used in mkoctfile
John W. Eaton <jwe@octave.org>
parents:
15458
diff
changeset
|
208 vars["DL_LD"] = get_variable ("DL_LD", %OCTAVE_CONF_MKOCTFILE_DL_LD%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
209 |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
210 vars["DL_LDFLAGS"] = get_variable ("DL_LDFLAGS", |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
211 %OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS%); |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
212 |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
213 vars["RDYNAMIC_FLAG"] = get_variable ("RDYNAMIC_FLAG", |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
214 %OCTAVE_CONF_RDYNAMIC_FLAG%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
215 |
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
|
216 vars["LIBOCTAVE"] = "-loctave"; |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
217 |
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
|
218 vars["LIBOCTINTERP"] = "-loctinterp"; |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
219 |
9515 | 220 vars["READLINE_LIBS"] = "-lreadline"; |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
221 |
11450
5eb10763069f
substitute and use LAPACK_LIBS in mkoctfile script
John W. Eaton <jwe@octave.org>
parents:
11251
diff
changeset
|
222 vars["LAPACK_LIBS"] = get_variable ("LAPACK_LIBS", %OCTAVE_CONF_LAPACK_LIBS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
223 |
8332 | 224 vars["BLAS_LIBS"] = get_variable ("BLAS_LIBS", %OCTAVE_CONF_BLAS_LIBS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
225 |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
226 vars["FFTW3_LDFLAGS"] = get_variable ("FFTW3_LDFLAGS", |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
227 %OCTAVE_CONF_FFTW3_LDFLAGS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
228 |
9538
d0239bddf621
use OCTAVE_CHECK_LIB to check for zlib
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
229 vars["FFTW3_LIBS"] = get_variable ("FFTW3_LIBS", %OCTAVE_CONF_FFTW3_LIBS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
230 |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
231 vars["FFTW3F_LDFLAGS"] = get_variable ("FFTW3F_LDFLAGS", |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
232 %OCTAVE_CONF_FFTW3F_LDFLAGS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
233 |
9538
d0239bddf621
use OCTAVE_CHECK_LIB to check for zlib
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
234 vars["FFTW3F_LIBS"] = get_variable ("FFTW3F_LIBS", %OCTAVE_CONF_FFTW3F_LIBS%); |
22909
7b368d85e86c
don't include sundials libraries or options in mkoctfile flags
John W. Eaton <jwe@octave.org>
parents:
22899
diff
changeset
|
235 |
8332 | 236 vars["LIBS"] = get_variable ("LIBS", %OCTAVE_CONF_LIBS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
237 |
8332 | 238 vars["FLIBS"] = get_variable ("FLIBS", %OCTAVE_CONF_FLIBS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
239 |
18349
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
240 vars["OCTAVE_LINK_DEPS"] = get_variable ("OCTAVE_LINK_DEPS", |
23757
bba752b37f8e
use different definition for mkoctfile link deps
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
241 %OCTAVE_CONF_MKOCTFILE_OCTAVE_LINK_DEPS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
242 |
18349
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
243 vars["OCTAVE_LINK_OPTS"] = get_variable ("OCTAVE_LINK_OPTS", |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
244 %OCTAVE_CONF_OCTAVE_LINK_OPTS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
245 |
18349
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
246 vars["OCT_LINK_DEPS"] = get_variable ("OCT_LINK_DEPS", |
23757
bba752b37f8e
use different definition for mkoctfile link deps
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
247 %OCTAVE_CONF_MKOCTFILE_OCT_LINK_DEPS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
248 |
18349
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
249 vars["OCT_LINK_OPTS"] = get_variable ("OCT_LINK_OPTS", |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
250 %OCTAVE_CONF_OCT_LINK_OPTS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
251 |
15929
16418ff39a72
strip cross tool prefix from CC, CXX, etc. definitions used in mkoctfile
John W. Eaton <jwe@octave.org>
parents:
15458
diff
changeset
|
252 vars["LD_CXX"] = get_variable ("LD_CXX", %OCTAVE_CONF_MKOCTFILE_LD_CXX%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
253 |
8332 | 254 vars["LDFLAGS"] = get_variable ("LDFLAGS", %OCTAVE_CONF_LDFLAGS%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
255 |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
256 vars["LD_STATIC_FLAG"] = get_variable ("LD_STATIC_FLAG", |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
257 %OCTAVE_CONF_LD_STATIC_FLAG%); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
258 |
8332 | 259 vars["LFLAGS"] = get_variable ("LFLAGS", DEFAULT_LFLAGS); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
260 |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
261 vars["F77_INTEGER8_FLAG"] = get_variable ("F77_INTEGER8_FLAG", |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
262 %OCTAVE_CONF_F77_INTEGER_8_FLAG%); |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
263 vars["ALL_FFLAGS"] = vars["FFLAGS"] + ' ' + vars["F77_INTEGER8_FLAG"]; |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
264 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
265 vars["ALL_CFLAGS"] |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
266 = vars["INCFLAGS"] + ' ' + vars["XTRA_CFLAGS"] + ' ' + vars["CFLAGS"]; |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
267 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
268 vars["ALL_CXXFLAGS"] |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
269 = vars["INCFLAGS"] + ' ' + vars["XTRA_CXXFLAGS"] + ' ' + vars["CXXFLAGS"]; |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
270 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
271 vars["ALL_LDFLAGS"] |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
272 = vars["LD_STATIC_FLAG"] + ' ' + vars["CPICFLAG"] + ' ' + vars["LDFLAGS"]; |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
273 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
274 vars["OCTAVE_LIBS"] |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
275 = (vars["LIBOCTINTERP"] + ' ' + vars["LIBOCTAVE"] + ' ' |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
276 + vars["SPECIAL_MATH_LIB"]); |
9538
d0239bddf621
use OCTAVE_CHECK_LIB to check for zlib
John W. Eaton <jwe@octave.org>
parents:
9515
diff
changeset
|
277 |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
278 vars["FFTW_LIBS"] = vars["FFTW3_LDFLAGS"] + ' ' + vars["FFTW3_LIBS"] + ' ' |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
279 + vars["FFTW3F_LDFLAGS"] + ' ' + vars["FFTW3F_LIBS"]; |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
280 } |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
281 |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
282 static std::string usage_msg = "usage: mkoctfile [options] file ..."; |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
283 |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
284 static std::string version_msg = "mkoctfile, version " OCTAVE_VERSION; |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
285 |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
286 static bool debug = false; |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
287 |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
288 static std::string help_msg = |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
289 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
290 "Options:\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
291 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
292 " -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
|
293 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
294 " -IDIR Add -IDIR to compile commands.\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
295 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
296 " -idirafter DIR Add -idirafter DIR to compile commands.\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
297 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
298 " -DDEF Add -DDEF to compile commands.\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
299 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
300 " -lLIB Add library LIB to link command.\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
301 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
302 " -LDIR Add -LDIR to link command.\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
303 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
304 " -M, --depend Generate dependency files (.d) for C and C++\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
305 " source files.\n" |
21979
d04da18a407a
use OCTAVE_USE_WINDOWS_API more consistently
John W. Eaton <jwe@octave.org>
parents:
21961
diff
changeset
|
306 #if ! defined (OCTAVE_USE_WINDOWS_API) |
18349
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
307 "\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
308 " -pthread Add -pthread to link command.\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
309 #endif |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
310 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
311 " -RDIR Add -RDIR to link command.\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
312 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
313 " -Wl,... Pass flags though the linker like -Wl,-rpath=...\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
314 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
315 " -W... Pass flags though the compiler like -Wa,OPTION.\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
316 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
317 " -c, --compile Compile, but do not link.\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
318 "\n" |
20713
2469d78a1d8b
Consistently use 'filename' rather than 'file name' throughout code base.
Rik <rik@octave.org>
parents:
20507
diff
changeset
|
319 " -o FILE, --output FILE Output filename. Default extension is .oct\n" |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
320 " (or .mex if --mex is specified) unless linking\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
321 " a stand-alone executable.\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
322 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
323 " -g Enable debugging options for compilers.\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
324 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
325 " -p VAR, --print VAR Print configuration variable VAR. Recognized\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
326 " variables are:\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
327 "\n" |
18349
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
328 " ALL_CFLAGS INCFLAGS\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
329 " ALL_CXXFLAGS INCLUDEDIR\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
330 " ALL_FFLAGS LAPACK_LIBS\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
331 " ALL_LDFLAGS LD_CXX\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
332 " AR LDFLAGS\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
333 " BLAS_LIBS LD_STATIC_FLAG\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
334 " CC LFLAGS\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
335 " CFLAGS LIBDIR\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
336 " CPICFLAG LIBOCTAVE\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
337 " CPPFLAGS LIBOCTINTERP\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
338 " CXX LIBS\n" |
23712
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
339 " CXXFLAGS OCTAVE_EXEC_HOME\n" |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
340 " CXXPICFLAG OCTAVE_HOME\n" |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
341 " DEPEND_EXTRA_SED_PATTERN OCTAVE_LIBS\n" |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
342 " DEPEND_FLAGS OCTAVE_LINK_DEPS\n" |
b95c430c0649
revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
343 " DL_LD OCTAVE_LINK_OPTS\n" |
18349
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
344 " DL_LDFLAGS OCTINCLUDEDIR\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
345 " F77 OCTLIBDIR\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
346 " F77_INTEGER8_FLAG OCT_LINK_DEPS\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
347 " FFLAGS OCT_LINK_OPTS\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
348 " FFTW3F_LDFLAGS RANLIB\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
349 " FFTW3F_LIBS RDYNAMIC_FLAG\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
350 " FFTW3_LDFLAGS READLINE_LIBS\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
351 " FFTW3_LIBS SED\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
352 " FFTW_LIBS SPECIAL_MATH_LIB\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
353 " FLIBS XTRA_CFLAGS\n" |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
354 " FPICFLAG XTRA_CXXFLAGS\n" |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
355 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
356 " --link-stand-alone Link a stand-alone executable file.\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
357 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
358 " --mex Assume we are creating a MEX file. Set the\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
359 " default output extension to \".mex\".\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
360 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
361 " -s, --strip Strip output file.\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
362 "\n" |
22481
541a20a4961c
mkoctfile: alias --dry-run option to --just-print because it's very common.
Carnë Draug <carandraug@octave.org>
parents:
22472
diff
changeset
|
363 " -n, --just-print, --dry-run\n" |
22486
6dd979aa7a2c
mkoctfile.in.cc: Align explanation of -n option with other explanations.
Rik <rik@octave.org>
parents:
22481
diff
changeset
|
364 " Print commands, but do not execute them.\n" |
22472
76f2b0436423
Add -n option to print, not execute, mkoctfile commands.
Rik <rik@octave.org>
parents:
22461
diff
changeset
|
365 "\n" |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
366 " -v, --verbose Echo commands as they are executed.\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
367 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
368 " FILE Compile or link FILE. Recognized file types are:\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
369 "\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
370 " .c C source\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
371 " .cc C++ source\n" |
22031
2cfbb6b25428
mkoctfile: support more file extensions for C++ sources (bug #48381)
Mike Miller <mtmiller@octave.org>
parents:
22022
diff
changeset
|
372 " .cp C++ source\n" |
2cfbb6b25428
mkoctfile: support more file extensions for C++ sources (bug #48381)
Mike Miller <mtmiller@octave.org>
parents:
22022
diff
changeset
|
373 " .cpp C++ source\n" |
2cfbb6b25428
mkoctfile: support more file extensions for C++ sources (bug #48381)
Mike Miller <mtmiller@octave.org>
parents:
22022
diff
changeset
|
374 " .CPP C++ source\n" |
2cfbb6b25428
mkoctfile: support more file extensions for C++ sources (bug #48381)
Mike Miller <mtmiller@octave.org>
parents:
22022
diff
changeset
|
375 " .cxx C++ source\n" |
2cfbb6b25428
mkoctfile: support more file extensions for C++ sources (bug #48381)
Mike Miller <mtmiller@octave.org>
parents:
22022
diff
changeset
|
376 " .c++ C++ source\n" |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
377 " .C C++ source\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
378 " .f Fortran source (fixed form)\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
379 " .F Fortran source (fixed form)\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
380 " .f90 Fortran source (free form)\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
381 " .F90 Fortran source (free form)\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
382 " .o object file\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
383 " .a library file\n" |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
384 #if defined (_MSC_VER) |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
385 " .lib library file\n" |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
386 #endif |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
387 "\n"; |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
388 |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
389 static std::string |
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
390 basename (const std::string& s, bool strip_path = false) |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
391 { |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
392 std::string retval; |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
393 |
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
|
394 size_t pos = s.rfind ('.'); |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
395 |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
396 if (pos == std::string::npos) |
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
|
397 retval = s; |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
398 else |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
399 retval = s.substr (0, pos); |
15299
8bd5c490b787
Fix mex compilation with subdirs on Windows platforms (bug #37122)
Rik <rik@octave.org>
parents:
15271
diff
changeset
|
400 |
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
|
401 if (strip_path) |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
402 { |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
403 size_t p1 = retval.rfind ('/'), p2 = retval.rfind ('\\'); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
404 |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
405 pos = (p1 != std::string::npos && p2 != std::string::npos |
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
406 ? std::max (p1, p2) : (p2 != std::string::npos ? p2 : p1)); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
407 |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
408 if (pos != std::string::npos) |
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
409 retval = retval.substr (++pos, std::string::npos); |
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
|
410 } |
15299
8bd5c490b787
Fix mex compilation with subdirs on Windows platforms (bug #37122)
Rik <rik@octave.org>
parents:
15271
diff
changeset
|
411 |
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
|
412 return retval; |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
413 } |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
414 |
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
|
415 inline bool |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
416 starts_with (const std::string& s, const std::string& prefix) |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
417 { |
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
|
418 return (s.length () >= prefix.length () && s.find (prefix) == 0); |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
419 } |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
420 |
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
|
421 inline bool |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
422 ends_with (const std::string& s, const std::string& suffix) |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
423 { |
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
|
424 return (s.length () >= suffix.length () |
12174 | 425 && s.rfind (suffix) == s.length () - suffix.length ()); |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
426 } |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
427 |
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
|
428 static int |
22472
76f2b0436423
Add -n option to print, not execute, mkoctfile commands.
Rik <rik@octave.org>
parents:
22461
diff
changeset
|
429 run_command (const std::string& cmd, bool printonly = false) |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
430 { |
22472
76f2b0436423
Add -n option to print, not execute, mkoctfile commands.
Rik <rik@octave.org>
parents:
22461
diff
changeset
|
431 if (printonly) |
76f2b0436423
Add -n option to print, not execute, mkoctfile commands.
Rik <rik@octave.org>
parents:
22461
diff
changeset
|
432 { |
76f2b0436423
Add -n option to print, not execute, mkoctfile commands.
Rik <rik@octave.org>
parents:
22461
diff
changeset
|
433 std::cout << cmd << std::endl; |
76f2b0436423
Add -n option to print, not execute, mkoctfile commands.
Rik <rik@octave.org>
parents:
22461
diff
changeset
|
434 return 0; |
76f2b0436423
Add -n option to print, not execute, mkoctfile commands.
Rik <rik@octave.org>
parents:
22461
diff
changeset
|
435 } |
76f2b0436423
Add -n option to print, not execute, mkoctfile commands.
Rik <rik@octave.org>
parents:
22461
diff
changeset
|
436 |
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
|
437 if (debug) |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
438 std::cout << cmd << std::endl; |
18916
5999e654f256
WIFEXITED and WEXITSTATUS macros for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
18915
diff
changeset
|
439 |
5999e654f256
WIFEXITED and WEXITSTATUS macros for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
18915
diff
changeset
|
440 int result = system (cmd.c_str ()); |
5999e654f256
WIFEXITED and WEXITSTATUS macros for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
18915
diff
changeset
|
441 |
21927
6f62bd248919
use wrapper functions for mkoctfile and main
John W. Eaton <jwe@octave.org>
parents:
21852
diff
changeset
|
442 if (octave_wifexited_wrapper (result)) |
6f62bd248919
use wrapper functions for mkoctfile and main
John W. Eaton <jwe@octave.org>
parents:
21852
diff
changeset
|
443 result = octave_wexitstatus_wrapper (result); |
18916
5999e654f256
WIFEXITED and WEXITSTATUS macros for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
18915
diff
changeset
|
444 |
5999e654f256
WIFEXITED and WEXITSTATUS macros for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
18915
diff
changeset
|
445 return result; |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
446 } |
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
447 |
16624
96d02808a881
Support "true" or "yes" for %NO_OCT_FILE_STRIP% in mkoctfile.in.cc.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
15946
diff
changeset
|
448 bool |
96d02808a881
Support "true" or "yes" for %NO_OCT_FILE_STRIP% in mkoctfile.in.cc.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
15946
diff
changeset
|
449 is_true (const std::string& s) |
96d02808a881
Support "true" or "yes" for %NO_OCT_FILE_STRIP% in mkoctfile.in.cc.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
15946
diff
changeset
|
450 { |
18360
f1ee47866e6b
use common code to get OCTAVE_HOME in main, octave-config and mkoctfile
John W. Eaton <jwe@octave.org>
parents:
18349
diff
changeset
|
451 return (s == "yes" || s == "true"); |
16624
96d02808a881
Support "true" or "yes" for %NO_OCT_FILE_STRIP% in mkoctfile.in.cc.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
15946
diff
changeset
|
452 } |
96d02808a881
Support "true" or "yes" for %NO_OCT_FILE_STRIP% in mkoctfile.in.cc.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
15946
diff
changeset
|
453 |
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
|
454 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
|
455 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
|
456 { |
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
|
457 initialize (); |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
458 |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
459 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
|
460 { |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
461 std::cout << usage_msg << 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
|
462 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
|
463 } |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
464 |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
465 if (argc == 2 && (! strcmp (argv[1], "-v") |
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
466 || ! strcmp (argv[1], "-version") |
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
467 || ! strcmp (argv[1], "--version"))) |
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
|
468 { |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
469 std::cout << version_msg << 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
|
470 return 0; |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
471 } |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
472 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
473 std::list<std::string> cfiles, ccfiles, f77files; |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
474 std::string output_ext = ".oct"; |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
475 std::string objfiles, libfiles, octfile, outputfile; |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
476 std::string incflags, defs, ldflags, pass_on_options; |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
477 bool strip = false; |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
478 bool no_oct_file_strip_on_this_platform = is_true ("%NO_OCT_FILE_STRIP%"); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
479 bool link = true; |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
480 bool link_stand_alone = false; |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
481 bool depend = false; |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
482 bool printonly = false; |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
483 |
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
|
484 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
|
485 { |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
486 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
|
487 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
488 std::string file; |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
489 |
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
|
490 if (ends_with (arg, ".c")) |
12174 | 491 { |
492 file = arg; | |
493 cfiles.push_back (file); | |
494 } | |
22031
2cfbb6b25428
mkoctfile: support more file extensions for C++ sources (bug #48381)
Mike Miller <mtmiller@octave.org>
parents:
22022
diff
changeset
|
495 else if (ends_with (arg, ".cc") || ends_with (arg, ".cp") |
2cfbb6b25428
mkoctfile: support more file extensions for C++ sources (bug #48381)
Mike Miller <mtmiller@octave.org>
parents:
22022
diff
changeset
|
496 || ends_with (arg, ".cpp") || ends_with (arg, ".CPP") |
2cfbb6b25428
mkoctfile: support more file extensions for C++ sources (bug #48381)
Mike Miller <mtmiller@octave.org>
parents:
22022
diff
changeset
|
497 || ends_with (arg, ".cxx") || ends_with (arg, ".c++") |
2cfbb6b25428
mkoctfile: support more file extensions for C++ sources (bug #48381)
Mike Miller <mtmiller@octave.org>
parents:
22022
diff
changeset
|
498 || ends_with (arg, ".C")) |
12174 | 499 { |
500 file = arg; | |
501 ccfiles.push_back (file); | |
502 } | |
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
|
503 else if (ends_with (arg, ".f") || ends_with (arg, ".F") |
12174 | 504 || ends_with (arg, "f90") || ends_with (arg, ".F90")) |
505 { | |
506 file = arg; | |
507 f77files.push_back (file); | |
508 } | |
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
|
509 else if (ends_with (arg, ".o") || ends_with (arg, ".obj")) |
12174 | 510 { |
511 file = arg; | |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
512 objfiles += (' ' + quote_path (arg)); |
12174 | 513 } |
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
|
514 else if (ends_with (arg, ".lib") || ends_with (arg, ".a")) |
12174 | 515 { |
516 file = arg; | |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
517 libfiles += (' ' + quote_path (arg)); |
12174 | 518 } |
9955
33537a4d223f
mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents:
9794
diff
changeset
|
519 else if (arg == "-d" || arg == "-debug" || arg == "--debug" |
33537a4d223f
mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents:
9794
diff
changeset
|
520 || arg == "-v" || arg == "-verbose" || arg == "--verbose") |
12174 | 521 { |
522 debug = true; | |
523 if (vars["CC"] == "cc-msvc") | |
524 vars["CC"] += " -d"; | |
525 if (vars["CXX"] == "cc-msvc") | |
526 vars["CXX"] += " -d"; | |
527 if (vars["DL_LD"] == "cc-msvc") | |
528 vars["DL_LD"] += " -d"; | |
529 } | |
9955
33537a4d223f
mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents:
9794
diff
changeset
|
530 else if (arg == "-h" || arg == "-?" || arg == "-help" || arg == "--help") |
12174 | 531 { |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
532 std::cout << usage_msg << std::endl; |
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
533 std::cout << help_msg << std::endl; |
12174 | 534 return 0; |
535 } | |
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
|
536 else if (starts_with (arg, "-I")) |
12174 | 537 { |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
538 incflags += (' ' + quote_path (arg)); |
12174 | 539 } |
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
|
540 else if (arg == "-idirafter") |
12174 | 541 { |
542 if (i < argc-1) | |
543 { | |
544 arg = argv[++i]; | |
545 incflags += (" -idirafter " + arg); | |
546 } | |
547 else | |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
548 std::cerr << "mkoctfile: include directory name missing" |
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
549 << std::endl; |
12174 | 550 } |
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
|
551 else if (starts_with (arg, "-D")) |
12174 | 552 { |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
553 defs += (' ' + arg); |
12174 | 554 } |
22461
cc4f31e8477f
Accept, but ignore, mex argument -largeArrayDims, -compatibleArrayDims (bug #39984).
Rik <rik@octave.org>
parents:
22459
diff
changeset
|
555 else if (arg == "-largeArrayDims" || arg == "-compatibleArrayDims") |
cc4f31e8477f
Accept, but ignore, mex argument -largeArrayDims, -compatibleArrayDims (bug #39984).
Rik <rik@octave.org>
parents:
22459
diff
changeset
|
556 { |
cc4f31e8477f
Accept, but ignore, mex argument -largeArrayDims, -compatibleArrayDims (bug #39984).
Rik <rik@octave.org>
parents:
22459
diff
changeset
|
557 std::cout << "warning: -largeArrayDims and -compatibleArrayDims are accepted for compatibility, but ignored" << std::endl; |
cc4f31e8477f
Accept, but ignore, mex argument -largeArrayDims, -compatibleArrayDims (bug #39984).
Rik <rik@octave.org>
parents:
22459
diff
changeset
|
558 } |
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
|
559 else if (starts_with (arg, "-Wl,") || starts_with (arg, "-l") |
12174 | 560 || starts_with (arg, "-L") || starts_with (arg, "-R")) |
561 { | |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
562 ldflags += (' ' + arg); |
12174 | 563 } |
21979
d04da18a407a
use OCTAVE_USE_WINDOWS_API more consistently
John W. Eaton <jwe@octave.org>
parents:
21961
diff
changeset
|
564 #if ! defined (OCTAVE_USE_WINDOWS_API) |
18349
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
565 else if (arg == "-pthread") |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
566 { |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
567 ldflags += (' ' + arg); |
18349
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
568 } |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
569 #endif |
9955
33537a4d223f
mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents:
9794
diff
changeset
|
570 else if (arg == "-M" || arg == "-depend" || arg == "--depend") |
12174 | 571 { |
572 depend = true; | |
573 } | |
9955
33537a4d223f
mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents:
9794
diff
changeset
|
574 else if (arg == "-o" || arg == "-output" || arg == "--output") |
12174 | 575 { |
576 if (i < argc-1) | |
577 { | |
578 arg = argv[++i]; | |
579 outputfile = arg; | |
580 } | |
581 else | |
20713
2469d78a1d8b
Consistently use 'filename' rather than 'file name' throughout code base.
Rik <rik@octave.org>
parents:
20507
diff
changeset
|
582 std::cerr << "mkoctfile: output filename missing" << std::endl; |
12174 | 583 } |
22481
541a20a4961c
mkoctfile: alias --dry-run option to --just-print because it's very common.
Carnë Draug <carandraug@octave.org>
parents:
22472
diff
changeset
|
584 else if (arg == "-n" || arg == "--dry-run" || arg == "--just-print") |
22472
76f2b0436423
Add -n option to print, not execute, mkoctfile commands.
Rik <rik@octave.org>
parents:
22461
diff
changeset
|
585 { |
76f2b0436423
Add -n option to print, not execute, mkoctfile commands.
Rik <rik@octave.org>
parents:
22461
diff
changeset
|
586 printonly = true; |
76f2b0436423
Add -n option to print, not execute, mkoctfile commands.
Rik <rik@octave.org>
parents:
22461
diff
changeset
|
587 } |
9955
33537a4d223f
mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents:
9794
diff
changeset
|
588 else if (arg == "-p" || arg == "-print" || arg == "--print") |
12174 | 589 { |
590 if (i < argc-1) | |
591 { | |
592 arg = argv[++i]; | |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
593 std::cout << vars[arg] << std::endl; |
12174 | 594 return 0; |
595 } | |
596 else | |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
597 std::cerr << "mkoctfile: --print requires argument" << std::endl; |
12174 | 598 } |
9955
33537a4d223f
mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents:
9794
diff
changeset
|
599 else if (arg == "-s" || arg == "-strip" || arg == "--strip") |
12174 | 600 { |
601 if (no_oct_file_strip_on_this_platform) | |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
602 std::cerr << "mkoctfile: stripping disabled on this platform" |
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
603 << std::endl; |
12174 | 604 else |
605 strip = true; | |
606 } | |
9955
33537a4d223f
mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents:
9794
diff
changeset
|
607 else if (arg == "-c" || arg == "-compile" || arg == "--compile") |
12174 | 608 { |
609 link = false; | |
610 } | |
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
|
611 else if (arg == "-g") |
12174 | 612 { |
613 vars["ALL_CFLAGS"] += " -g"; | |
614 vars["ALL_CXXFLAGS"] += " -g"; | |
615 vars["ALL_FFLAGS"] += " -g"; | |
616 } | |
9955
33537a4d223f
mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents:
9794
diff
changeset
|
617 else if (arg == "-link-stand-alone" || arg == "--link-stand-alone") |
12174 | 618 { |
619 link_stand_alone = true; | |
620 } | |
9955
33537a4d223f
mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents:
9794
diff
changeset
|
621 else if (arg == "-mex" || arg == "--mex") |
12174 | 622 { |
623 incflags += " -I."; | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
624 #if defined (_MSC_VER) |
12174 | 625 ldflags += " -Wl,-export:mexFunction"; |
9303
adf676387922
properly #ifdef MSVC linker specific flags
Benjamin Lindner <lindnerb@users.sourceforge.net>
parents:
9245
diff
changeset
|
626 #endif |
12174 | 627 output_ext = ".mex"; |
628 } | |
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
|
629 else if (starts_with (arg, "-W")) |
12174 | 630 { |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
631 pass_on_options += (' ' + arg); |
12174 | 632 } |
19711
b59aabc08e63
Pass unrecognized '-' arguments through mkoctfile to compiler (bug #34169).
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
633 else if (starts_with (arg, "-")) |
b59aabc08e63
Pass unrecognized '-' arguments through mkoctfile to compiler (bug #34169).
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
634 { |
b59aabc08e63
Pass unrecognized '-' arguments through mkoctfile to compiler (bug #34169).
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
635 // Pass through any unrecognized options |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
636 pass_on_options += (' ' + arg); |
24622
298c6a6bd869
Accept compound unrecognized arguments to mkoctfile (bug #52928).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
637 // Check for an additional argument following the option |
298c6a6bd869
Accept compound unrecognized arguments to mkoctfile (bug #52928).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
638 if (i < argc-1) |
298c6a6bd869
Accept compound unrecognized arguments to mkoctfile (bug #52928).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
639 { |
298c6a6bd869
Accept compound unrecognized arguments to mkoctfile (bug #52928).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
640 arg = argv[i+1]; |
298c6a6bd869
Accept compound unrecognized arguments to mkoctfile (bug #52928).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
641 if (arg[0] != '-') |
298c6a6bd869
Accept compound unrecognized arguments to mkoctfile (bug #52928).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
642 { |
298c6a6bd869
Accept compound unrecognized arguments to mkoctfile (bug #52928).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
643 pass_on_options += (' ' + arg); |
298c6a6bd869
Accept compound unrecognized arguments to mkoctfile (bug #52928).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
644 i++; |
298c6a6bd869
Accept compound unrecognized arguments to mkoctfile (bug #52928).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
645 } |
298c6a6bd869
Accept compound unrecognized arguments to mkoctfile (bug #52928).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
646 } |
19711
b59aabc08e63
Pass unrecognized '-' arguments through mkoctfile to compiler (bug #34169).
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
647 } |
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
|
648 else |
12174 | 649 { |
18796
dd57ca9ef7e4
Add missing newline to error message from mkoctfile.
Rik <rik@octave.org>
parents:
18364
diff
changeset
|
650 std::cerr << "mkoctfile: unrecognized argument " << arg << std::endl; |
12174 | 651 return 1; |
652 } | |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
653 |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
654 if (! file.empty () && octfile.empty ()) |
12174 | 655 octfile = file; |
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
|
656 } |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
657 |
22459
6af82fc041a4
Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents:
22412
diff
changeset
|
658 if (output_ext == ".mex" |
22599
51b395d24782
maint: strip tabs and trailing whitespace from C++ sources.
John W. Eaton <jwe@octave.org>
parents:
22486
diff
changeset
|
659 && vars["ALL_CFLAGS"].find ("-g") != std::string::npos) |
22459
6af82fc041a4
Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents:
22412
diff
changeset
|
660 { |
6af82fc041a4
Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents:
22412
diff
changeset
|
661 defs += " -DMEX_DEBUG"; |
6af82fc041a4
Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents:
22412
diff
changeset
|
662 } |
6af82fc041a4
Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents:
22412
diff
changeset
|
663 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
664 std::string output_option; |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
665 |
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
|
666 if (link_stand_alone) |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
667 { |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
668 if (! outputfile.empty ()) |
12174 | 669 output_option = "-o " + outputfile; |
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
|
670 } |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
671 else |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
672 { |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
673 if (! outputfile.empty ()) |
9957
59ed11557715
mkoctfile: if output file is specified and it does not end in output_ext, append output_ext
John W. Eaton <jwe@octave.org>
parents:
9956
diff
changeset
|
674 { |
59ed11557715
mkoctfile: if output file is specified and it does not end in output_ext, append output_ext
John W. Eaton <jwe@octave.org>
parents:
9956
diff
changeset
|
675 octfile = outputfile; |
59ed11557715
mkoctfile: if output file is specified and it does not end in output_ext, append output_ext
John W. Eaton <jwe@octave.org>
parents:
9956
diff
changeset
|
676 size_t len = octfile.length (); |
59ed11557715
mkoctfile: if output file is specified and it does not end in output_ext, append output_ext
John W. Eaton <jwe@octave.org>
parents:
9956
diff
changeset
|
677 size_t len_ext = output_ext.length (); |
59ed11557715
mkoctfile: if output file is specified and it does not end in output_ext, append output_ext
John W. Eaton <jwe@octave.org>
parents:
9956
diff
changeset
|
678 if (octfile.substr (len-len_ext) != output_ext) |
59ed11557715
mkoctfile: if output file is specified and it does not end in output_ext, append output_ext
John W. Eaton <jwe@octave.org>
parents:
9956
diff
changeset
|
679 octfile += output_ext; |
59ed11557715
mkoctfile: if output file is specified and it does not end in output_ext, append output_ext
John W. Eaton <jwe@octave.org>
parents:
9956
diff
changeset
|
680 } |
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
|
681 else |
12174 | 682 octfile = basename (octfile, true) + output_ext; |
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
|
683 } |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
684 |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
685 if (depend) |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
686 { |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
687 for (const auto& f : cfiles) |
12174 | 688 { |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
689 std::string dfile = basename (f, true) + ".d", line; |
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
|
690 |
21927
6f62bd248919
use wrapper functions for mkoctfile and main
John W. Eaton <jwe@octave.org>
parents:
21852
diff
changeset
|
691 octave_unlink_wrapper (dfile.c_str ()); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
692 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
693 std::string cmd |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
694 = (vars["CC"] + ' ' + vars["DEPEND_FLAGS"] + ' ' |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
695 + vars["CPPFLAGS"] + ' ' + vars["ALL_CFLAGS"] + ' ' |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
696 + incflags + ' ' + defs + ' ' + quote_path (f)); |
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
|
697 |
12174 | 698 FILE *fd = popen (cmd.c_str (), "r"); |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
699 std::ofstream fo (dfile.c_str ()); |
15458
1cc42df8ede7
mkoctfile.in.cc: Change variable types to stop compilation warnings.
Rik <rik@octave.org>
parents:
15309
diff
changeset
|
700 size_t pos; |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
701 while (! feof (fd)) |
12174 | 702 { |
703 line = get_line (fd); | |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
704 if ((pos = line.rfind (".o:")) != std::string::npos) |
12174 | 705 { |
15458
1cc42df8ede7
mkoctfile.in.cc: Change variable types to stop compilation warnings.
Rik <rik@octave.org>
parents:
15309
diff
changeset
|
706 size_t spos = line.rfind ('/', pos); |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
707 std::string ofile = |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19711
diff
changeset
|
708 (spos == std::string::npos |
22412
2bc07741efa0
maint: Style check C++ code in src/ directory.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
709 ? line.substr (0, pos+2) |
2bc07741efa0
maint: Style check C++ code in src/ directory.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
710 : line.substr (spos+1, pos-spos+1)); |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
711 fo << "pic/" << ofile << ' ' << ofile << ' ' |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
712 << dfile << line.substr (pos) << std::endl; |
12174 | 713 } |
714 else | |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
715 fo << line << std::endl; |
12174 | 716 } |
717 pclose (fd); | |
718 fo.close (); | |
719 } | |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
720 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
721 for (const auto& f : ccfiles) |
12174 | 722 { |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
723 std::string dfile = basename (f, true) + ".d", line; |
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
|
724 |
21927
6f62bd248919
use wrapper functions for mkoctfile and main
John W. Eaton <jwe@octave.org>
parents:
21852
diff
changeset
|
725 octave_unlink_wrapper (dfile.c_str ()); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
726 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
727 std::string cmd |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
728 = (vars["CXX"] + ' ' + vars["DEPEND_FLAGS"] + ' ' |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
729 + vars["CPPFLAGS"] + ' ' + vars["ALL_CXXFLAGS"] + ' ' |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
730 + incflags + ' ' + defs + ' ' + quote_path (f)); |
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
|
731 |
12174 | 732 FILE *fd = popen (cmd.c_str (), "r"); |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
733 std::ofstream fo (dfile.c_str ()); |
15458
1cc42df8ede7
mkoctfile.in.cc: Change variable types to stop compilation warnings.
Rik <rik@octave.org>
parents:
15309
diff
changeset
|
734 size_t pos; |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
735 while (! feof (fd)) |
12174 | 736 { |
737 line = get_line (fd); | |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
738 if ((pos = line.rfind (".o:")) != std::string::npos) |
12174 | 739 { |
15458
1cc42df8ede7
mkoctfile.in.cc: Change variable types to stop compilation warnings.
Rik <rik@octave.org>
parents:
15309
diff
changeset
|
740 size_t spos = line.rfind ('/', pos); |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
741 std::string ofile = |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19711
diff
changeset
|
742 (spos == std::string::npos |
22412
2bc07741efa0
maint: Style check C++ code in src/ directory.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
743 ? line.substr (0, pos+2) |
2bc07741efa0
maint: Style check C++ code in src/ directory.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
744 : line.substr (spos+1, pos-spos+1)); |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
745 fo << "pic/" << ofile << ' ' << ofile << ' ' |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
746 << dfile << line.substr (pos+2) << std::endl; |
12174 | 747 } |
748 else | |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
749 fo << line << std::endl; |
12174 | 750 } |
751 pclose (fd); | |
752 fo.close (); | |
753 } | |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
754 |
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
|
755 return 0; |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
756 } |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
757 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
758 for (const auto& f : f77files) |
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
|
759 { |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
760 std::string b = basename (f, true); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
761 |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
762 if (! vars["F77"].empty ()) |
12174 | 763 { |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
764 std::string o; |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
765 if (! outputfile.empty ()) |
12174 | 766 { |
767 if (link) | |
768 o = b + ".o"; | |
769 else | |
770 o = outputfile; | |
771 } | |
772 else | |
773 o = b + ".o"; | |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
774 objfiles += (' ' + o); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
775 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
776 std::string cmd |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
777 = (vars["F77"] + " -c " + vars["FPICFLAG"] + ' ' |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
778 + vars["ALL_FFLAGS"] + ' ' + incflags + ' ' + defs + ' ' |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
779 + pass_on_options + ' ' + f + " -o " + o); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
780 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
781 int status = run_command (cmd, printonly); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
782 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
783 if (status) |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
784 return status; |
12174 | 785 } |
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
|
786 else |
12174 | 787 { |
18796
dd57ca9ef7e4
Add missing newline to error message from mkoctfile.
Rik <rik@octave.org>
parents:
18364
diff
changeset
|
788 std::cerr << "mkoctfile: no way to compile Fortran file " << f |
dd57ca9ef7e4
Add missing newline to error message from mkoctfile.
Rik <rik@octave.org>
parents:
18364
diff
changeset
|
789 << std::endl; |
12174 | 790 return 1; |
791 } | |
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
|
792 } |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
793 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
794 for (const auto& f : cfiles) |
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
|
795 { |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
796 if (! vars["CC"].empty ()) |
12174 | 797 { |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
798 std::string b = basename (f, true), o; |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
799 if (! outputfile.empty ()) |
12174 | 800 { |
801 if (link) | |
802 o = b + ".o"; | |
803 else | |
804 o = outputfile; | |
805 } | |
806 else | |
807 o = b + ".o"; | |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
808 objfiles += (' ' + o); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
809 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
810 std::string cmd |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
811 = (vars["CC"] + " -c " + vars["CPPFLAGS"] + ' ' |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
812 + vars["CPICFLAG"] + ' ' + vars["ALL_CFLAGS"] + ' ' |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
813 + pass_on_options + ' ' + incflags + ' ' + defs + ' ' |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
814 + quote_path (f) + " -o " + quote_path (o)); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
815 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
816 int status = run_command (cmd, printonly); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
817 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
818 if (status) |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
819 return status; |
12174 | 820 } |
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
|
821 else |
12174 | 822 { |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
823 std::cerr << "mkoctfile: no way to compile C file " << f |
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
824 << std::endl; |
12174 | 825 return 1; |
826 } | |
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
|
827 } |
12174 | 828 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
829 for (const auto& f : ccfiles) |
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
|
830 { |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
831 if (! vars["CXX"].empty ()) |
12174 | 832 { |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
833 std::string b = basename (f, true), o; |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
834 if (! outputfile.empty ()) |
12174 | 835 { |
836 if (link) | |
837 o = b + ".o"; | |
838 else | |
839 o = outputfile; | |
840 } | |
841 else | |
842 o = b + ".o"; | |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
843 objfiles += (' ' + o); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
844 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
845 std::string cmd |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
846 = (vars["CXX"] + " -c " + vars["CPPFLAGS"] + ' ' |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
847 + vars["CXXPICFLAG"] + ' ' + vars["ALL_CXXFLAGS"] + ' ' |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
848 + pass_on_options + ' ' + incflags + ' ' + defs + ' ' |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
849 + quote_path (f) + " -o " + quote_path (o)); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
850 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
851 int status = run_command (cmd, printonly); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
852 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
853 if (status) |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
854 return status; |
12174 | 855 } |
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
|
856 else |
12174 | 857 { |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
858 std::cerr << "mkoctfile: no way to compile C++ file " << f |
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
859 << std::endl; |
12174 | 860 return 1; |
861 } | |
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
|
862 } |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
863 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
864 if (link && ! objfiles.empty ()) |
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
|
865 { |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
866 if (link_stand_alone) |
12174 | 867 { |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
868 if (! vars["LD_CXX"].empty ()) |
12174 | 869 { |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
870 std::string cmd |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
871 = (vars["LD_CXX"] + ' ' + vars["CPPFLAGS"] + ' ' |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
872 + vars["ALL_CXXFLAGS"] + ' ' + vars["RDYNAMIC_FLAG"] + ' ' |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
873 + vars["ALL_LDFLAGS"] + ' ' + pass_on_options + ' ' |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
874 + output_option + ' ' + objfiles + ' ' + libfiles + ' ' |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
875 + ldflags + ' ' + vars["LFLAGS"] + " -loctinterp -loctave " |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
876 + vars["OCTAVE_LINK_OPTS"] + ' ' + vars["OCTAVE_LINK_DEPS"]); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
877 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
878 int status = run_command (cmd, printonly); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
879 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
880 if (status) |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
881 return status; |
12174 | 882 } |
883 else | |
884 { | |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
885 std::cerr |
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
886 << "mkoctfile: no way to link stand-alone executable file" |
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
887 << std::endl; |
12174 | 888 return 1; |
889 } | |
890 } | |
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
|
891 else |
12174 | 892 { |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
893 std::string cmd |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
894 = (vars["DL_LD"] + ' ' + vars["ALL_CXXFLAGS"] + ' ' |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
895 + vars["DL_LDFLAGS"] + ' ' + pass_on_options |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
896 + " -o " + octfile + ' ' + objfiles + ' ' + libfiles + ' ' |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
897 + ldflags + ' ' + vars["LFLAGS"] + " -loctinterp -loctave " |
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23804
diff
changeset
|
898 + vars["OCT_LINK_OPTS"] + ' ' + vars["OCT_LINK_DEPS"]); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
899 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
900 int status = run_command (cmd, printonly); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
901 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
902 if (status) |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
903 return status; |
12174 | 904 } |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
905 |
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
|
906 if (strip) |
12174 | 907 { |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
908 std::string cmd = "strip " + octfile; |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
909 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
910 int status = run_command (cmd, printonly); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
911 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
912 if (status) |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
913 return status; |
12174 | 914 } |
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
|
915 } |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
916 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
917 return 0; |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
918 } |