Mercurial > octave
annotate src/mkoctfile.in.cc @ 23801:9d67bd90681b
cross tools: define OCTAVE_UNUSED if not defined
* src/mkoctfile.in.cc, src/octave-config.in.cc
add #define OCTAVE_UNUSED if not already defined
author | John D <john.donoghue@ieee.org> |
---|---|
date | Thu, 27 Jul 2017 15:55:33 -0400 |
parents | bba752b37f8e |
children | 90689bdbe048 |
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 | |
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 |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22599
diff
changeset
|
10 the Free Software Foundation; either version 3 of the License, or |
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 | |
20 <http://www.gnu.org/licenses/>. | |
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] != '"') |
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
|
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 |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9565
diff
changeset
|
154 = "-I" + quote_path (vars["OCTINCLUDEDIR"] + "\\..") |
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%); |
10721
4906ccf5d95e
use F77_INTEGER8_FLAG in BLAS checking as well as ALL_FFLAGS in mkoctfile
Jaroslav Hajek <highegg@gmail.com>
parents:
9957
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"] |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
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"] |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
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"] |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
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"] |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
275 = (vars["LIBOCTINTERP"] + " " + vars["LIBOCTAVE"] + " " |
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 |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
278 vars["FFTW_LIBS"] = vars["FFTW3_LDFLAGS"] + " " + vars["FFTW3_LIBS"] + " " |
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
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; | |
512 objfiles += (" " + quote_path (arg)); | |
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; | |
517 libfiles += (" " + quote_path (arg)); | |
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 { |
538 incflags += (" " + quote_path (arg)); | |
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 { |
553 defs += (" " + arg); | |
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 { | |
562 ldflags += (" " + arg); | |
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 { |
50505bf88b82
make octave-config and mkoctfile consistent with last shell script versions
John W. Eaton <jwe@octave.org>
parents:
18342
diff
changeset
|
567 ldflags += (" " + arg); |
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 { |
631 pass_on_options += (" " + arg); | |
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 |
b59aabc08e63
Pass unrecognized '-' arguments through mkoctfile to compiler (bug #34169).
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
636 pass_on_options += (" " + arg); |
b59aabc08e63
Pass unrecognized '-' arguments through mkoctfile to compiler (bug #34169).
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
637 } |
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
|
638 else |
12174 | 639 { |
18796
dd57ca9ef7e4
Add missing newline to error message from mkoctfile.
Rik <rik@octave.org>
parents:
18364
diff
changeset
|
640 std::cerr << "mkoctfile: unrecognized argument " << arg << std::endl; |
12174 | 641 return 1; |
642 } | |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
643 |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
644 if (! file.empty () && octfile.empty ()) |
12174 | 645 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
|
646 } |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
647 |
22459
6af82fc041a4
Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents:
22412
diff
changeset
|
648 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
|
649 && 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
|
650 { |
6af82fc041a4
Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents:
22412
diff
changeset
|
651 defs += " -DMEX_DEBUG"; |
6af82fc041a4
Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents:
22412
diff
changeset
|
652 } |
6af82fc041a4
Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents:
22412
diff
changeset
|
653 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
654 std::string output_option; |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
655 |
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 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
|
657 { |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
658 if (! outputfile.empty ()) |
12174 | 659 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
|
660 } |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
661 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
|
662 { |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
663 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
|
664 { |
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
|
665 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
|
666 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
|
667 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
|
668 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
|
669 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
|
670 } |
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
|
671 else |
12174 | 672 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
|
673 } |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
674 |
6a292b0fa88c
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents:
8091
diff
changeset
|
675 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
|
676 { |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
677 for (const auto& f : cfiles) |
12174 | 678 { |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
679 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
|
680 |
21927
6f62bd248919
use wrapper functions for mkoctfile and main
John W. Eaton <jwe@octave.org>
parents:
21852
diff
changeset
|
681 octave_unlink_wrapper (dfile.c_str ()); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
682 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
683 std::string cmd |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
684 = (vars["CC"] + " " + vars["DEPEND_FLAGS"] + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
685 + vars["CPPFLAGS"] + " " + vars["ALL_CFLAGS"] + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
686 + 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
|
687 |
12174 | 688 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
|
689 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
|
690 size_t pos; |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
691 while (! feof (fd)) |
12174 | 692 { |
693 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
|
694 if ((pos = line.rfind (".o:")) != std::string::npos) |
12174 | 695 { |
15458
1cc42df8ede7
mkoctfile.in.cc: Change variable types to stop compilation warnings.
Rik <rik@octave.org>
parents:
15309
diff
changeset
|
696 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
|
697 std::string ofile = |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19711
diff
changeset
|
698 (spos == std::string::npos |
22412
2bc07741efa0
maint: Style check C++ code in src/ directory.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
699 ? line.substr (0, pos+2) |
2bc07741efa0
maint: Style check C++ code in src/ directory.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
700 : line.substr (spos+1, pos-spos+1)); |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
701 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
|
702 << dfile << line.substr (pos) << std::endl; |
12174 | 703 } |
704 else | |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
705 fo << line << std::endl; |
12174 | 706 } |
707 pclose (fd); | |
708 fo.close (); | |
709 } | |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
710 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
711 for (const auto& f : ccfiles) |
12174 | 712 { |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
713 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
|
714 |
21927
6f62bd248919
use wrapper functions for mkoctfile and main
John W. Eaton <jwe@octave.org>
parents:
21852
diff
changeset
|
715 octave_unlink_wrapper (dfile.c_str ()); |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
716 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
717 std::string cmd |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
718 = (vars["CXX"] + " " + vars["DEPEND_FLAGS"] + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
719 + vars["CPPFLAGS"] + " " + vars["ALL_CXXFLAGS"] + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
720 + 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
|
721 |
12174 | 722 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
|
723 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
|
724 size_t pos; |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
725 while (! feof (fd)) |
12174 | 726 { |
727 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
|
728 if ((pos = line.rfind (".o:")) != std::string::npos) |
12174 | 729 { |
15458
1cc42df8ede7
mkoctfile.in.cc: Change variable types to stop compilation warnings.
Rik <rik@octave.org>
parents:
15309
diff
changeset
|
730 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
|
731 std::string ofile = |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19711
diff
changeset
|
732 (spos == std::string::npos |
22412
2bc07741efa0
maint: Style check C++ code in src/ directory.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
733 ? line.substr (0, pos+2) |
2bc07741efa0
maint: Style check C++ code in src/ directory.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
734 : line.substr (spos+1, pos-spos+1)); |
17789
f2b047f9b605
Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
735 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
|
736 << dfile << line.substr (pos+2) << std::endl; |
12174 | 737 } |
738 else | |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
739 fo << line << std::endl; |
12174 | 740 } |
741 pclose (fd); | |
742 fo.close (); | |
743 } | |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
744 |
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
|
745 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
|
746 } |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
747 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
748 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
|
749 { |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
750 std::string b = basename (f, true); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
751 |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
752 if (! vars["F77"].empty ()) |
12174 | 753 { |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
754 std::string o; |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
755 if (! outputfile.empty ()) |
12174 | 756 { |
757 if (link) | |
758 o = b + ".o"; | |
759 else | |
760 o = outputfile; | |
761 } | |
762 else | |
763 o = b + ".o"; | |
764 objfiles += (" " + o); | |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
765 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
766 std::string cmd |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
767 = (vars["F77"] + " -c " + vars["FPICFLAG"] + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
768 + vars["ALL_FFLAGS"] + " " + incflags + " " + defs + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
769 + pass_on_options + " " + f + " -o " + o); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
770 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
771 int status = run_command (cmd, printonly); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
772 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
773 if (status) |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
774 return status; |
12174 | 775 } |
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
|
776 else |
12174 | 777 { |
18796
dd57ca9ef7e4
Add missing newline to error message from mkoctfile.
Rik <rik@octave.org>
parents:
18364
diff
changeset
|
778 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
|
779 << std::endl; |
12174 | 780 return 1; |
781 } | |
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
|
782 } |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
783 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
784 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
|
785 { |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
786 if (! vars["CC"].empty ()) |
12174 | 787 { |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
788 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
|
789 if (! outputfile.empty ()) |
12174 | 790 { |
791 if (link) | |
792 o = b + ".o"; | |
793 else | |
794 o = outputfile; | |
795 } | |
796 else | |
797 o = b + ".o"; | |
798 objfiles += (" " + o); | |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
799 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
800 std::string cmd |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
801 = (vars["CC"] + " -c " + vars["CPPFLAGS"] + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
802 + vars["CPICFLAG"] + " " + vars["ALL_CFLAGS"] + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
803 + pass_on_options + " " + incflags + " " + defs + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
804 + quote_path (f) + " -o " + quote_path (o)); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
805 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
806 int status = run_command (cmd, printonly); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
807 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
808 if (status) |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
809 return status; |
12174 | 810 } |
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
|
811 else |
12174 | 812 { |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
813 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
|
814 << std::endl; |
12174 | 815 return 1; |
816 } | |
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
|
817 } |
12174 | 818 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
819 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
|
820 { |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
821 if (! vars["CXX"].empty ()) |
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::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
|
824 if (! outputfile.empty ()) |
12174 | 825 { |
826 if (link) | |
827 o = b + ".o"; | |
828 else | |
829 o = outputfile; | |
830 } | |
831 else | |
832 o = b + ".o"; | |
833 objfiles += (" " + o); | |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
834 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
835 std::string cmd |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
836 = (vars["CXX"] + " -c " + vars["CPPFLAGS"] + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
837 + vars["CXXPICFLAG"] + " " + vars["ALL_CXXFLAGS"] + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
838 + pass_on_options + " " + incflags + " " + defs + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
839 + quote_path (f) + " -o " + quote_path (o)); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
840 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
841 int status = run_command (cmd, printonly); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
842 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
843 if (status) |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
844 return status; |
12174 | 845 } |
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
|
846 else |
12174 | 847 { |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
848 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
|
849 << std::endl; |
12174 | 850 return 1; |
851 } | |
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
|
852 } |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
853 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
854 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
|
855 { |
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 if (link_stand_alone) |
12174 | 857 { |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20713
diff
changeset
|
858 if (! vars["LD_CXX"].empty ()) |
12174 | 859 { |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
860 std::string cmd |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
861 = (vars["LD_CXX"] + " " + vars["CPPFLAGS"] + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
862 + vars["ALL_CXXFLAGS"] + " " + vars["RDYNAMIC_FLAG"] + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
863 + vars["ALL_LDFLAGS"] + " " + pass_on_options + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
864 + output_option + " " + objfiles + " " + libfiles + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
865 + ldflags + " " + vars["LFLAGS"] + " -loctinterp -loctave " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
866 + vars["OCTAVE_LINK_OPTS"] + " " + vars["OCTAVE_LINK_DEPS"]); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
867 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
868 int status = run_command (cmd, printonly); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
869 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
870 if (status) |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
871 return status; |
12174 | 872 } |
873 else | |
874 { | |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
875 std::cerr |
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
876 << "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
|
877 << std::endl; |
12174 | 878 return 1; |
879 } | |
880 } | |
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
|
881 else |
12174 | 882 { |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
883 std::string cmd |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
884 = (vars["DL_LD"] + " " + vars["ALL_CXXFLAGS"] + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
885 + vars["DL_LDFLAGS"] + " " + pass_on_options |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
886 + " -o " + octfile + " " + objfiles + " " + libfiles + " " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
887 + ldflags + " " + vars["LFLAGS"] + " -loctinterp -loctave " |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
888 + vars["OCT_LINK_OPTS"] + " " + vars["OCT_LINK_DEPS"]); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
889 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
890 int status = run_command (cmd, printonly); |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
891 |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
892 if (status) |
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
893 return status; |
12174 | 894 } |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
895 |
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
|
896 if (strip) |
12174 | 897 { |
18364
2e62b1f01bfe
* mkoctfile.in.cc: Use std:: instead of using declarartion.
John W. Eaton <jwe@octave.org>
parents:
18363
diff
changeset
|
898 std::string cmd = "strip " + octfile; |
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 } |
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
|
905 } |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
906 |
22866
b5cf18f8c18b
style fixes for mkoctfile.cc
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
907 return 0; |
8091
4e7527a7b3f9
mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff
changeset
|
908 } |