annotate src/mkoctfile.in.cc @ 17898:8c33abdd2f9a

maint: Avoid using NULL in C++ code. * qtinfo/parser.cc, profiler.cc, profiler.h, txt-eng-ft.cc, __init_fltk__.cc, ov-fcn-handle.cc, ov-java.cc, mkoctfile.in.cc: Avoid using NULL in C++ code.
author John W. Eaton <jwe@octave.org>
date Mon, 11 Nov 2013 01:49:57 -0500
parents f2b047f9b605
children ee7f66925267
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8920
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
1 /*
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
2
17744
d63878346099 maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents: 16624
diff changeset
3 Copyright (C) 2008-2013 Michael Goffioul
8920
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
4
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
5 This file is part of Octave.
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
6
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
8 under the terms of the GNU General Public License as published by the
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
10 option) any later version.
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
11
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
15 for more details.
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
16
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
17 You should have received a copy of the GNU General Public License
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
18 along with Octave; see the file COPYING. If not, see
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
19 <http://www.gnu.org/licenses/>.
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
20
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
21 */
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8332
diff changeset
22
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
23 #if defined (HAVE_CONFIG_H)
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
24 #include <config.h>
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
25 #endif
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
26
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
27 #include <string>
15299
8bd5c490b787 Fix mex compilation with subdirs on Windows platforms (bug #37122)
Rik <rik@octave.org>
parents: 15271
diff changeset
28 #include <cstring>
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
29 #include <map>
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
30 #include <list>
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
31 #include <algorithm>
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
32 #include <iostream>
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
33 #include <fstream>
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
34 #include <vector>
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
35 #include <cstdlib>
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
36
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
37 #if defined (__WIN32__) && ! defined (_POSIX_VERSION)
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
38 #include <windows.h>
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
39 #ifdef _MSC_VER
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
40 #define popen _popen
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
41 #define pclose _pclose
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
42 #endif
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
43 #endif
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
44
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
45 using namespace std;
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
46
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
47 static bool initialized = false;
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
48 static map<string,string> vars;
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
49
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
50 static string OCTAVE_VERSION = %OCTAVE_CONF_VERSION%;
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
51
15309
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
52 static string
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
53 substitute_prefix (const string& s, const string& prefix,
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
54 const string& new_prefix)
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
55 {
15309
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
56 string retval = s;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
57
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
58 if (!prefix.empty () && new_prefix != prefix)
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
59 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
60 int len = prefix.length ();
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
61 if (retval.find (prefix) == 0)
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
62 retval.replace (0, len, new_prefix);
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
63 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
64
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
65 #if defined (__WIN32__) && ! defined (_POSIX_VERSION)
15309
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
66 replace (retval.begin (), retval.end (), '/', '\\');
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
67 #endif
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
68
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
69 return retval;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
70 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
71
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
72 static string
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
73 get_line (FILE *fp)
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
74 {
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
75 static vector<char> buf (100);
15458
1cc42df8ede7 mkoctfile.in.cc: Change variable types to stop compilation warnings.
Rik <rik@octave.org>
parents: 15309
diff changeset
76 unsigned int idx = 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
77 char c;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
78
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
79 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
80 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
81 c = static_cast<char> (fgetc (fp));
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
82 if (c == '\n' || c == EOF)
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
83 break;
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
84 if (buf.size () <= idx)
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
85 buf.resize (buf.size () + 100);
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
86 buf[idx++] = c;
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
87 }
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
88 if (idx == 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
89 return string ("");
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
90 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
91 return string (&buf[0], idx);
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
92 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
93
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
94
8092
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
95 static string
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 get_variable (const char *name, const string& defval)
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
97 {
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
98 const char *val = getenv (name);
17898
8c33abdd2f9a maint: Avoid using NULL in C++ code.
John W. Eaton <jwe@octave.org>
parents: 17789
diff changeset
99 if (val && *val)
8c33abdd2f9a maint: Avoid using NULL in C++ code.
John W. Eaton <jwe@octave.org>
parents: 17789
diff changeset
100 return string (val);
8c33abdd2f9a maint: Avoid using NULL in C++ code.
John W. Eaton <jwe@octave.org>
parents: 17789
diff changeset
101 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
102 return defval;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
103 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
104
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
105 static string
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
106 quote_path (const string& s)
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
107 {
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
108 if (s.find (' ') != string::npos && s[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
109 return "\"" + s + "\"";
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
110 else
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
111 return s;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
112 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
113
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
114 static void
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
115 initialize (void)
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
116 {
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
117 if (initialized)
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
118 return;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
119
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
120 initialized = true;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
121
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
122 vars["OCTAVE_HOME"] = get_variable ("OCTAVE_HOME", "");
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
123
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
124 #if defined (__WIN32__) && ! defined (_POSIX_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
125 int n = 1024;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
126
15309
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
127 string bin_dir (n, '\0');
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
128
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
129 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
130 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
131 int status = GetModuleFileName (0, &bin_dir[0], n);
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
132
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
133 if (status < n)
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
134 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
135 bin_dir.resize (status);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
136 break;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
137 }
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
138 else
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
139 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
140 n *= 2;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
141 bin_dir.resize (n);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
142 }
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
143 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
144
8092
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
145 if (! bin_dir.empty ())
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
146 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
147 size_t pos = bin_dir.rfind ("\\bin\\");
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
148
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
149 if (pos != string::npos)
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
150 vars["OCTAVE_HOME"] = bin_dir.substr (0, pos);
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
151 }
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
152 #endif
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
153
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
154 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
155
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
156 vars["OCTAVE_PREFIX"] = %OCTAVE_CONF_PREFIX%;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
157
15309
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
158 string DEFAULT_OCTINCLUDEDIR = %OCTAVE_CONF_OCTINCLUDEDIR%;
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
159 string DEFAULT_INCLUDEDIR = %OCTAVE_CONF_INCLUDEDIR%;
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
160 string DEFAULT_LIBDIR = %OCTAVE_CONF_LIBDIR%;
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
161 string DEFAULT_OCTLIBDIR = %OCTAVE_CONF_OCTLIBDIR%;
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
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
163 if (! vars["OCTAVE_HOME"].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
164 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
165 DEFAULT_OCTINCLUDEDIR
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
166 = substitute_prefix (DEFAULT_OCTINCLUDEDIR, vars["OCTAVE_PREFIX"],
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
167 vars["OCTAVE_HOME"]);
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
168
8092
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
169 DEFAULT_INCLUDEDIR
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
170 = substitute_prefix (DEFAULT_INCLUDEDIR, vars["OCTAVE_PREFIX"],
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
171 vars["OCTAVE_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
172
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
173 DEFAULT_LIBDIR
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
174 = substitute_prefix (DEFAULT_LIBDIR, vars["OCTAVE_PREFIX"],
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
175 vars["OCTAVE_HOME"]);
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
176
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
177 DEFAULT_OCTLIBDIR
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
178 = substitute_prefix (DEFAULT_OCTLIBDIR, vars["OCTAVE_PREFIX"],
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
179 vars["OCTAVE_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
180 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
181
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
182 vars["OCTINCLUDEDIR"] = get_variable ("OCTINCLUDEDIR", DEFAULT_OCTINCLUDEDIR);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
183 vars["INCLUDEDIR"] = get_variable ("INCLUDEDIR", DEFAULT_INCLUDEDIR);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
184 vars["LIBDIR"] = get_variable ("LIBDIR", DEFAULT_LIBDIR);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
185 vars["OCTLIBDIR"] = get_variable ("OCTLIBDIR", DEFAULT_OCTLIBDIR);
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
186
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
187 #if defined (__WIN32__) && ! defined (_POSIX_VERSION)
15309
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
188 string DEFAULT_INCFLAGS
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents: 9565
diff changeset
189 = "-I" + quote_path (vars["OCTINCLUDEDIR"] + "\\..")
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
190 + " -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
191 #else
15309
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
192 string DEFAULT_INCFLAGS
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents: 9565
diff changeset
193 = "-I" + quote_path (vars["OCTINCLUDEDIR"] + "/..")
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
194 + " -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
195 #endif
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 if (vars["INCLUDEDIR"] != "/usr/include")
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
197 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
198
15309
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
199 string DEFAULT_LFLAGS = "-L" + quote_path (vars["OCTLIBDIR"]);
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
200 if (vars["LIBDIR"] != "/usr/lib")
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
201 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
202
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
203 vars["CPPFLAGS"] = get_variable ("CPPFLAGS", %OCTAVE_CONF_CPPFLAGS%);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
204 vars["INCFLAGS"] = get_variable ("INCFLAGS", DEFAULT_INCFLAGS);
15929
16418ff39a72 strip cross tool prefix from CC, CXX, etc. definitions used in mkoctfile
John W. Eaton <jwe@octave.org>
parents: 15458
diff changeset
205 vars["F77"] = get_variable ("F77", %OCTAVE_CONF_MKOCTFILE_F77%);
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
206 vars["FFLAGS"] = get_variable ("FFLAGS", %OCTAVE_CONF_FFLAGS%);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
207 vars["FPICFLAG"] = get_variable ("FPICFLAG", %OCTAVE_CONF_FPICFLAG%);
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["CC"] = get_variable ("CC", %OCTAVE_CONF_MKOCTFILE_CC%);
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
209 vars["CFLAGS"] = get_variable ("CFLAGS", %OCTAVE_CONF_CFLAGS%);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
210 vars["CPICFLAG"] = get_variable ("CPICFLAG", %OCTAVE_CONF_CPICFLAG%);
15929
16418ff39a72 strip cross tool prefix from CC, CXX, etc. definitions used in mkoctfile
John W. Eaton <jwe@octave.org>
parents: 15458
diff changeset
211 vars["CXX"] = get_variable ("CXX", %OCTAVE_CONF_MKOCTFILE_CXX%);
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
212 vars["CXXFLAGS"] = get_variable ("CXXFLAGS", %OCTAVE_CONF_CXXFLAGS%);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
213 vars["CXXPICFLAG"] = get_variable ("CXXPICFLAG", %OCTAVE_CONF_CXXPICFLAG%);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
214 vars["XTRA_CFLAGS"] = get_variable ("XTRA_CFLAGS", %OCTAVE_CONF_XTRA_CFLAGS%);
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
215 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
216 %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
217
15944
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
218 vars["AR"] = get_variable ("AR", %OCTAVE_CONF_MKOCTFILE_AR%);
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
219 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
220
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
221 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
222 %OCTAVE_CONF_DEPEND_FLAGS%);
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
223 vars["DEPEND_EXTRA_SED_PATTERN"] = get_variable ("DEPEND_EXTRA_SED_PATTERN",
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
224 %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
225
15929
16418ff39a72 strip cross tool prefix from CC, CXX, etc. definitions used in mkoctfile
John W. Eaton <jwe@octave.org>
parents: 15458
diff changeset
226 vars["DL_LD"] = get_variable ("DL_LD", %OCTAVE_CONF_MKOCTFILE_DL_LD%);
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
227 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
228 %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
229
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
230 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
231 %OCTAVE_CONF_RDYNAMIC_FLAG%);
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
232 vars["LIBOCTAVE"] = "-loctave";
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
233 vars["LIBOCTINTERP"] = "-loctinterp";
9515
eee9b3150446 more configure tweaks
John W. Eaton <jwe@octave.org>
parents: 9303
diff changeset
234 vars["READLINE_LIBS"] = "-lreadline";
11450
5eb10763069f substitute and use LAPACK_LIBS in mkoctfile script
John W. Eaton <jwe@octave.org>
parents: 11251
diff changeset
235 vars["LAPACK_LIBS"] = get_variable ("LAPACK_LIBS", %OCTAVE_CONF_LAPACK_LIBS%);
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
236 vars["BLAS_LIBS"] = get_variable ("BLAS_LIBS", %OCTAVE_CONF_BLAS_LIBS%);
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
237 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
238 %OCTAVE_CONF_FFTW3_LDFLAGS%);
9538
d0239bddf621 use OCTAVE_CHECK_LIB to check for zlib
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
239 vars["FFTW3_LIBS"] = get_variable ("FFTW3_LIBS", %OCTAVE_CONF_FFTW3_LIBS%);
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
240 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
241 %OCTAVE_CONF_FFTW3F_LDFLAGS%);
9538
d0239bddf621 use OCTAVE_CHECK_LIB to check for zlib
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
242 vars["FFTW3F_LIBS"] = get_variable ("FFTW3F_LIBS", %OCTAVE_CONF_FFTW3F_LIBS%);
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
243 vars["LIBS"] = get_variable ("LIBS", %OCTAVE_CONF_LIBS%);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
244 vars["FLIBS"] = get_variable ("FLIBS", %OCTAVE_CONF_FLIBS%);
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
245 vars["OCTAVE_LINK_DEPS"] = get_variable ("FLIBS",
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
246 %OCTAVE_CONF_OCTAVE_LINK_DEPS%);
13010
edc5ec6e949b maint: allow --enable-static --disable-dl to work again
John W. Eaton <jwe@octave.org>
parents: 12733
diff changeset
247 vars["OCT_LINK_DEPS"] = get_variable ("FLIBS", %OCTAVE_CONF_OCT_LINK_DEPS%);
edc5ec6e949b maint: allow --enable-static --disable-dl to work again
John W. Eaton <jwe@octave.org>
parents: 12733
diff changeset
248 vars["FLIBS"] = get_variable ("FLIBS", %OCTAVE_CONF_FLIBS%);
edc5ec6e949b maint: allow --enable-static --disable-dl to work again
John W. Eaton <jwe@octave.org>
parents: 12733
diff changeset
249
15929
16418ff39a72 strip cross tool prefix from CC, CXX, etc. definitions used in mkoctfile
John W. Eaton <jwe@octave.org>
parents: 15458
diff changeset
250 vars["LD_CXX"] = get_variable ("LD_CXX", %OCTAVE_CONF_MKOCTFILE_LD_CXX%);
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
251 vars["LDFLAGS"] = get_variable ("LDFLAGS", %OCTAVE_CONF_LDFLAGS%);
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
252 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
253 %OCTAVE_CONF_LD_STATIC_FLAG%);
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
254 vars["LFLAGS"] = get_variable ("LFLAGS", DEFAULT_LFLAGS);
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
255 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
256 %OCTAVE_CONF_F77_INTEGER_8_FLAG%);
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
257
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
258 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
259
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
260 vars["ALL_CFLAGS"] = vars["INCFLAGS"] + " " + vars["XTRA_CFLAGS"] + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
261 + vars["CFLAGS"];
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
262
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
263 vars["ALL_CXXFLAGS"] = vars["INCFLAGS"] + " " + vars["XTRA_CXXFLAGS"] + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
264 + vars["CXXFLAGS"];
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
265
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
266 vars["ALL_LDFLAGS"] = vars["LD_STATIC_FLAG"] + " " + vars["CPICFLAG"] + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
267 + vars["LDFLAGS"];
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
268
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
269 vars["OCTAVE_LIBS"] = vars["LIBOCTINTERP"] + " " + vars["LIBOCTAVE"] + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
270 + vars["SPECIAL_MATH_LIB"];
9538
d0239bddf621 use OCTAVE_CHECK_LIB to check for zlib
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
271
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
272 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
273 + 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
274 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
275
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
276 static string usage_msg = "usage: mkoctfile [options] file ...";
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
277 static string version_msg = "mkoctfile, version " + OCTAVE_VERSION;
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
278 static bool debug = false;
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
279 static string help_msg =
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
280 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
281 "Options:\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
282 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
283 " -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
284 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
285 " -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
286 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
287 " -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
288 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
289 " -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
290 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
291 " -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
292 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
293 " -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
294 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
295 " -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
296 " source files.\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 " -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
299 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
300 " -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
301 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
302 " -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
303 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
304 " -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
305 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
306 " -o FILE, --output FILE Output file name. Default extension is .oct\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
307 " (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
308 " a stand-alone executable.\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
309 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
310 " -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
311 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
312 " -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
313 " variables are:\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
314 "\n"
15944
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
315 " ALL_CFLAGS FFTW3F_LDFLAGS\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
316 " ALL_CXXFLAGS FFTW3F_LIBS\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
317 " ALL_FFLAGS FLIBS\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
318 " ALL_LDFLAGS FPICFLAG\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
319 " AR INCFLAGS\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
320 " BLAS_LIBS LAPACK_LIBS\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
321 " CC LDFLAGS\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
322 " CFLAGS LD_CXX\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
323 " CPICFLAG LD_STATIC_FLAG\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
324 " CPPFLAGS LFLAGS\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
325 " CXX LIBOCTAVE\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
326 " CXXFLAGS LIBOCTINTERP\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
327 " CXXPICFLAG LIBS\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
328 " DEPEND_EXTRA_SED_PATTERN OCTAVE_LIBS\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
329 " DEPEND_FLAGS OCTAVE_LINK_DEPS\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
330 " DL_LD OCT_LINK_DEPS\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
331 " DL_LDFLAGS RANLIB\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
332 " EXEEXT RDYNAMIC_FLAG\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
333 " F77 READLINE_LIBS\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
334 " F77_INTEGER_8_FLAG SED\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
335 " FFLAGS XTRA_CFLAGS\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
336 " FFTW3_LDFLAGS XTRA_CXXFLAGS\n"
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
337 " FFTW3_LIBS\n"
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
338 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
339 " --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
340 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
341 " --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
342 " 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
343 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
344 " -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
345 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
346 " -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
347 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
348 " 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
349 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
350 " .c C source\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
351 " .cc C++ source\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
352 " .C C++ source\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
353 " .cpp C++ source\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
354 " .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
355 " .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
356 " .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
357 " .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
358 " .o object file\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
359 " .a library file\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
360 #ifdef _MSC_VER
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
361 " .lib library file\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
362 #endif
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
363 "\n";
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
364
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
365 static string
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
366 basename (const 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
367 {
15299
8bd5c490b787 Fix mex compilation with subdirs on Windows platforms (bug #37122)
Rik <rik@octave.org>
parents: 15271
diff changeset
368 string retval;
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
369 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
370
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
371 if (pos == string::npos)
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
372 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
373 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
374 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
375
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
376 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
377 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
378 size_t p1 = retval.rfind ('/'), p2 = retval.rfind ('\\');
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
379 pos = (p1 != string::npos && p2 != string::npos
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
380 ? max (p1, p2) : (p2 != string::npos ? p2 : p1));
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
381 if (pos != string::npos)
15299
8bd5c490b787 Fix mex compilation with subdirs on Windows platforms (bug #37122)
Rik <rik@octave.org>
parents: 15271
diff changeset
382 retval = retval.substr (++pos, 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
383 }
15299
8bd5c490b787 Fix mex compilation with subdirs on Windows platforms (bug #37122)
Rik <rik@octave.org>
parents: 15271
diff changeset
384
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
385 return retval;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
386 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
387
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
388 inline bool
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
389 starts_with (const string& s, const string& prefix)
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
390 {
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
391 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
392 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
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 inline bool
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
395 ends_with (const string& s, const string& suffix)
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
396 {
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 return (s.length () >= suffix.length ()
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
398 && 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
399 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
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 static 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
402 run_command (const string& cmd)
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
403 {
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
404 if (debug)
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
405 cout << cmd << endl;
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
406 return system (cmd.c_str ());
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
407 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
408
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
409 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
410 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
411 {
96d02808a881 Support "true" or "yes" for %NO_OCT_FILE_STRIP% in mkoctfile.in.cc.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 15946
diff changeset
412 return (s == "yes"
96d02808a881 Support "true" or "yes" for %NO_OCT_FILE_STRIP% in mkoctfile.in.cc.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 15946
diff changeset
413 || s == "true");
96d02808a881 Support "true" or "yes" for %NO_OCT_FILE_STRIP% in mkoctfile.in.cc.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 15946
diff changeset
414 }
96d02808a881 Support "true" or "yes" for %NO_OCT_FILE_STRIP% in mkoctfile.in.cc.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 15946
diff changeset
415
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
416 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
417 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
418 {
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
419 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
420
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 string file, output_option;
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
422 list<string> cfiles, ccfiles, f77files;
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
423 int result = 0;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
424
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
425 string objfiles = "";
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
426 string libfiles = "";
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
427 string octfile = "";
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 string outputfile = "";
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
429 string incflags = "";
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
430 string defs = "";
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
431 string ldflags = "";
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
432 string pass_on_options = "";
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
433 bool strip = false;
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
434 bool no_oct_file_strip_on_this_platform = is_true ("%NO_OCT_FILE_STRIP%");
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
435 bool link = 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
436 bool link_stand_alone = false;
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 string output_ext = ".oct";
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
438 bool depend = false;
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
439 bool compile = 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
440
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
441 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
442 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
443 cout << usage_msg << endl;
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
444 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
445 }
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
446
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
447 if (argc == 2 && (!strcmp (argv[1], "-v")
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
448 || !strcmp (argv[1], "-version")
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
449 || !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
450 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
451 cout << version_msg << endl;
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
452 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
453 }
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
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 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
456 {
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 string arg = argv[i];
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
458
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
459 if (ends_with (arg, ".c"))
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
460 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
461 file = arg;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
462 cfiles.push_back (file);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
463 }
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
464 else if (ends_with (arg, ".cc") || ends_with (arg, ".C")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
465 || ends_with (arg, ".cpp"))
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
466 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
467 file = arg;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
468 ccfiles.push_back (file);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
469 }
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 else if (ends_with (arg, ".f") || ends_with (arg, ".F")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
471 || ends_with (arg, "f90") || ends_with (arg, ".F90"))
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
472 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
473 file = arg;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
474 f77files.push_back (file);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
475 }
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
476 else if (ends_with (arg, ".o") || ends_with (arg, ".obj"))
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
477 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
478 file = arg;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
479 objfiles += (" " + quote_path (arg));
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
480 }
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
481 else if (ends_with (arg, ".lib") || ends_with (arg, ".a"))
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
482 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
483 file = arg;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
484 libfiles += (" " + quote_path (arg));
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
485 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
486 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
487 || arg == "-v" || arg == "-verbose" || arg == "--verbose")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
488 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
489 debug = true;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
490 if (vars["CC"] == "cc-msvc")
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
491 vars["CC"] += " -d";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
492 if (vars["CXX"] == "cc-msvc")
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
493 vars["CXX"] += " -d";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
494 if (vars["DL_LD"] == "cc-msvc")
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
495 vars["DL_LD"] += " -d";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
496 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
497 else if (arg == "-h" || arg == "-?" || arg == "-help" || arg == "--help")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
498 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
499 cout << usage_msg << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
500 cout << help_msg << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
501 return 0;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
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 (starts_with (arg, "-I"))
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
504 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
505 incflags += (" " + quote_path (arg));
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
506 }
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
507 else if (arg == "-idirafter")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
508 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
509 if (i < argc-1)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
510 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
511 arg = argv[++i];
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
512 incflags += (" -idirafter " + arg);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
513 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
514 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
515 cerr << "mkoctfile: include directory name missing" << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
516 }
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
517 else if (starts_with (arg, "-D"))
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
518 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
519 defs += (" " + arg);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
520 }
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
521 else if (starts_with (arg, "-Wl,") || starts_with (arg, "-l")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
522 || starts_with (arg, "-L") || starts_with (arg, "-R"))
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
523 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
524 ldflags += (" " + arg);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
525 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
526 else if (arg == "-M" || arg == "-depend" || arg == "--depend")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
527 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
528 depend = true;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
529 compile = false;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
530 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
531 else if (arg == "-o" || arg == "-output" || arg == "--output")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
532 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
533 if (i < argc-1)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
534 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
535 arg = argv[++i];
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
536 outputfile = arg;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
537 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
538 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
539 cerr << "mkoctfile: output file name missing" << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
540 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
541 else if (arg == "-p" || arg == "-print" || arg == "--print")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
542 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
543 if (i < argc-1)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
544 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
545 arg = argv[++i];
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
546 cout << vars[arg] << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
547 return 0;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
548 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
549 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
550 cerr << "mkoctfile: --print requires argument" << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
551 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
552 else if (arg == "-s" || arg == "-strip" || arg == "--strip")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
553 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
554 if (no_oct_file_strip_on_this_platform)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
555 cerr << "mkoctfile: stripping disabled on this platform" << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
556 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
557 strip = true;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
558 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
559 else if (arg == "-c" || arg == "-compile" || arg == "--compile")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
560 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
561 link = false;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
562 }
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
563 else if (arg == "-g")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
564 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
565 vars["ALL_CFLAGS"] += " -g";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
566 vars["ALL_CXXFLAGS"] += " -g";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
567 vars["ALL_FFLAGS"] += " -g";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
568 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
569 else if (arg == "-link-stand-alone" || arg == "--link-stand-alone")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
570 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
571 link_stand_alone = true;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
572 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
573 else if (arg == "-mex" || arg == "--mex")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
574 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
575 incflags += " -I.";
9303
adf676387922 properly #ifdef MSVC linker specific flags
Benjamin Lindner <lindnerb@users.sourceforge.net>
parents: 9245
diff changeset
576 #ifdef _MSC_VER
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
577 ldflags += " -Wl,-export:mexFunction";
9303
adf676387922 properly #ifdef MSVC linker specific flags
Benjamin Lindner <lindnerb@users.sourceforge.net>
parents: 9245
diff changeset
578 #endif
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
579 output_ext = ".mex";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
580 }
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
581 else if (starts_with (arg, "-W"))
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
582 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
583 pass_on_options += (" " + arg);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
584 }
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
585 else
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
586 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
587 cerr << "mkoctfile: unrecognized argument " << arg;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
588 return 1;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
589 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
590
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
591 if (!file.empty () && octfile.empty ())
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
592 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
593 }
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
594
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
595 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
596 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
597 if (!outputfile.empty ())
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
598 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
599 }
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
600 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
601 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
602 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
603 {
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
604 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
605 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
606 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
607 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
608 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
609 }
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
610 else
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
611 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
612 }
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
613
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
614 list<string>::const_iterator it;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
615
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
616 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
617 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
618 for (it = cfiles.begin (); it != cfiles.end (); ++it)
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
619 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
620 string f = *it, 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
621
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
622 unlink (dfile.c_str ());
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
623 string cmd = vars["CC"] + " " + vars["DEPEND_FLAGS"] + " "
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
624 + vars["CPPFLAGS"] + " " + vars["ALL_CFLAGS"] + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
625 + 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
626
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
627 FILE *fd = popen (cmd.c_str (), "r");
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
628 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
629 size_t pos;
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
630 while (!feof (fd))
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
631 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
632 line = get_line (fd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
633 if ((pos = line.rfind (".o:")) != string::npos)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
634 {
15458
1cc42df8ede7 mkoctfile.in.cc: Change variable types to stop compilation warnings.
Rik <rik@octave.org>
parents: 15309
diff changeset
635 size_t spos = line.rfind ('/', pos);
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
636 string ofile =
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
637 (spos == string::npos ? line.substr (0, pos+2)
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
638 : line.substr (spos+1, pos-spos+1));
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
639 fo << "pic/" << ofile << " " << ofile << " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
640 << dfile << line.substr (pos) << endl;
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
641 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
642 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
643 fo << line << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
644 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
645 pclose (fd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
646 fo.close ();
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
647 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
648
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
649 for (it = ccfiles.begin (); it != ccfiles.end (); ++it)
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
650 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
651 string f = *it, 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
652
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
653 unlink (dfile.c_str ());
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
654 string cmd = vars["CC"] + " " + vars["DEPEND_FLAGS"] + " "
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
655 + vars["CPPFLAGS"] + " " + vars["ALL_CXXFLAGS"] + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
656 + 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
657
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
658 FILE *fd = popen (cmd.c_str (), "r");
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
659 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
660 size_t pos;
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
661 while (!feof (fd))
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
662 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
663 line = get_line (fd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
664 if ((pos = line.rfind (".o:")) != string::npos)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
665 {
15458
1cc42df8ede7 mkoctfile.in.cc: Change variable types to stop compilation warnings.
Rik <rik@octave.org>
parents: 15309
diff changeset
666 size_t spos = line.rfind ('/', pos);
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
667 string ofile =
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
668 (spos == string::npos ? line.substr (0, pos+2)
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
669 : line.substr (spos+1, pos-spos+1));
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
670 fo << "pic/" << ofile << " " << ofile << " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
671 << dfile << line.substr (pos+2) << endl;
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
672 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
673 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
674 fo << line << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
675 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
676 pclose (fd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
677 fo.close ();
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
678 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
679
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 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
681 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
682
8092
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
683 for (it = f77files.begin (); it != f77files.end (); ++it)
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
684 {
9956
f26a33e21db9 mkoctfile: when compiling files in subdirectories, place object files in current directory by default
John W. Eaton <jwe@octave.org>
parents: 9955
diff changeset
685 string f = *it, b = basename (f, true);
9187
a3237ae32c0d eliminate last remnants of F2C variables
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
686 if (!vars["F77"].empty ())
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
687 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
688 string o;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
689 if (!outputfile.empty ())
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
690 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
691 if (link)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
692 o = b + ".o";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
693 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
694 o = outputfile;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
695 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
696 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
697 o = b + ".o";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
698 objfiles += (" " + o);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
699 string cmd = vars["F77"] + " -c " + vars["FPICFLAG"] + " "
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
700 + vars["ALL_FFLAGS"] + " " + incflags + " " + defs + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
701 + pass_on_options + " " + f + " -o " + o;
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
702 result = run_command (cmd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
703 }
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
704 else
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
705 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
706 cerr << "mkoctfile: no way to compile Fortran file " << f << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
707 return 1;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
708 }
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
709 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
710
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
711 for (it = cfiles.begin (); it != cfiles.end (); ++it)
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
712 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
713 string f = *it;
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 if (!vars["CC"].empty ())
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
715 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
716 string b = basename (f, true), o;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
717 if (!outputfile.empty ())
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
718 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
719 if (link)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
720 o = b + ".o";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
721 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
722 o = outputfile;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
723 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
724 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
725 o = b + ".o";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
726 objfiles += (" " + o);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
727 string cmd = vars["CC"] + " -c " + vars["CPPFLAGS"] + " "
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
728 + vars["CPICFLAG"] + " " + vars["ALL_CFLAGS"] + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
729 + pass_on_options + " " + incflags + " " + defs + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
730 + quote_path (f) + " -o " + quote_path (o);
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
731 result = run_command (cmd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
732 }
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
733 else
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
734 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
735 cerr << "mkoctfile: no way to compile C file " << f << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
736 return 1;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
737 }
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
738 }
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
739
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
740 for (it = ccfiles.begin (); it != ccfiles.end (); ++it)
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
741 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
742 string f = *it;
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
743 if (!vars["CXX"].empty ())
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
744 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
745 string b = basename (f, true), o;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
746 if (!outputfile.empty ())
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
747 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
748 if (link)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
749 o = b + ".o";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
750 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
751 o = outputfile;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
752 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
753 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
754 o = b + ".o";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
755 objfiles += (" " + o);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
756 string cmd = vars["CXX"] + " -c " + vars["CPPFLAGS"] + " "
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
757 + vars["CXXPICFLAG"] + " " + vars["ALL_CXXFLAGS"] + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
758 + pass_on_options + " " + incflags + " " + defs + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
759 + quote_path (f) + " -o " + quote_path (o);
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
760 result = run_command (cmd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
761 }
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
762 else
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
763 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
764 cerr << "mkoctfile: no way to compile C++ file " << f << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
765 return 1;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
766 }
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
767 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
768
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
769 if (link && !objfiles.empty ())
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
770 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
771 if (link_stand_alone)
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
772 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
773 if (!vars["LD_CXX"].empty ())
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
774 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
775 string cmd = vars["LD_CXX"] + " " + vars["CPPFLAGS"] + " "
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
776 + vars["ALL_CXXFLAGS"] + " " + vars["RDYNAMIC_FLAG"]
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
777 + " " + vars["ALL_LDFLAGS"] + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
778 + pass_on_options + " " + output_option + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
779 + objfiles + " " + libfiles + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
780 + ldflags + " " + vars["LFLAGS"]
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
781 + " -loctinterp -loctave "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
782 + " " + vars["OCT_LINK_OPTS"]
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
783 + " " + vars["OCTAVE_LINK_DEPS"];
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
784 result = run_command (cmd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
785 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
786 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
787 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
788 cerr << "mkoctfile: no way to link stand-alone executable file"
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
789 << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
790 return 1;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
791 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
792 }
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
793 else
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
794 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
795 string cmd = vars["DL_LD"] + " " + vars["DL_LDFLAGS"] + " "
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
796 + pass_on_options + " -o " + octfile + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
797 + objfiles + " " + libfiles + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
798 + ldflags + " " + vars["LFLAGS"]
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
799 + " -loctinterp -loctave "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
800 + vars["OCT_LINK_OPTS"] + " " + vars["OCT_LINK_DEPS"];
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
801 result = run_command (cmd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
802 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
803
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
804 if (strip)
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
805 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
806 string cmd = "strip " + octfile;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
807 result = run_command (cmd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
808 }
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
809 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
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 return result;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
812 }