annotate src/mkoctfile.in.cc @ 18342:ee7f66925267 stable

Always build mkoctfile and octave-config as executables (bug #41296) * src/Makefile.am (bin_PROGRAMS): Add mkoctfile and octave-config unconditionally. (bin_SCRIPTS): Remove all references. (AMCOND_BUILD_COMPILED_AUX_PROGRAMS): Delete conditional sections. * src/mkoctfile.in.cc: Include <unistd.h>. * src/mkoctfile.in.sh, src/octave-config.in.sh: Delete. * configure.ac (AMCOND_BUILD_COMPILED_AUX_PROGRAMS): Delete.
author Mike Miller <mtmiller@ieee.org>
date Tue, 21 Jan 2014 22:40:29 -0500
parents 8c33abdd2f9a
children 50505bf88b82
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
18342
ee7f66925267 Always build mkoctfile and octave-config as executables (bug #41296)
Mike Miller <mtmiller@ieee.org>
parents: 17898
diff changeset
37 #include <unistd.h>
ee7f66925267 Always build mkoctfile and octave-config as executables (bug #41296)
Mike Miller <mtmiller@ieee.org>
parents: 17898
diff changeset
38
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
39 #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
40 #include <windows.h>
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
41 #ifdef _MSC_VER
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
42 #define popen _popen
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
43 #define pclose _pclose
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
44 #endif
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
45 #endif
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 using namespace std;
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
48
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
49 static bool initialized = false;
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
50 static map<string,string> vars;
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
51
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
52 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
53
15309
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
54 static string
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
55 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
56 const string& new_prefix)
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
57 {
15309
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
58 string retval = s;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
59
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
60 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
61 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
62 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
63 if (retval.find (prefix) == 0)
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
64 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
65 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
66
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
67 #if defined (__WIN32__) && ! defined (_POSIX_VERSION)
15309
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
68 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
69 #endif
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
70
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
71 return retval;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
72 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
73
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
74 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
75 get_line (FILE *fp)
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
76 {
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 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
78 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
79 char c;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
80
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
81 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
82 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
83 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
84 if (c == '\n' || c == EOF)
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
85 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
86 if (buf.size () <= idx)
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
87 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
88 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
89 }
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 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
91 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
92 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
93 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
94 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
95
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
96
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
97 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
98 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
99 {
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
100 const char *val = getenv (name);
17898
8c33abdd2f9a maint: Avoid using NULL in C++ code.
John W. Eaton <jwe@octave.org>
parents: 17789
diff changeset
101 if (val && *val)
8c33abdd2f9a maint: Avoid using NULL in C++ code.
John W. Eaton <jwe@octave.org>
parents: 17789
diff changeset
102 return string (val);
8c33abdd2f9a maint: Avoid using NULL in C++ code.
John W. Eaton <jwe@octave.org>
parents: 17789
diff changeset
103 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
104 return defval;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
105 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
106
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
107 static string
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
108 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
109 {
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
110 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
111 return "\"" + s + "\"";
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
112 else
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
113 return s;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
114 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
115
8092
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
116 static void
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
117 initialize (void)
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
118 {
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
119 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
120 return;
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 initialized = true;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
123
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
124 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
125
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
126 #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
127 int n = 1024;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
128
15309
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
129 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
130
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
131 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
132 {
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 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
134
8092
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
135 if (status < n)
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
136 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
137 bin_dir.resize (status);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
138 break;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
139 }
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
140 else
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
141 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
142 n *= 2;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
143 bin_dir.resize (n);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
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 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
146
8092
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
147 if (! 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
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 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
150
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 if (pos != string::npos)
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
152 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
153 }
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
154 #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
155
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
156 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
157
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
158 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
159
15309
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
160 string DEFAULT_OCTINCLUDEDIR = %OCTAVE_CONF_OCTINCLUDEDIR%;
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
161 string DEFAULT_INCLUDEDIR = %OCTAVE_CONF_INCLUDEDIR%;
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
162 string DEFAULT_LIBDIR = %OCTAVE_CONF_LIBDIR%;
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
163 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
164
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
165 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
166 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
167 DEFAULT_OCTINCLUDEDIR
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
168 = substitute_prefix (DEFAULT_OCTINCLUDEDIR, vars["OCTAVE_PREFIX"],
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
169 vars["OCTAVE_HOME"]);
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
170
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
171 DEFAULT_INCLUDEDIR
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
172 = substitute_prefix (DEFAULT_INCLUDEDIR, vars["OCTAVE_PREFIX"],
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
173 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
174
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
175 DEFAULT_LIBDIR
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
176 = substitute_prefix (DEFAULT_LIBDIR, vars["OCTAVE_PREFIX"],
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
177 vars["OCTAVE_HOME"]);
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
178
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
179 DEFAULT_OCTLIBDIR
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
180 = substitute_prefix (DEFAULT_OCTLIBDIR, vars["OCTAVE_PREFIX"],
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
181 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
182 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
183
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
184 vars["OCTINCLUDEDIR"] = get_variable ("OCTINCLUDEDIR", DEFAULT_OCTINCLUDEDIR);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
185 vars["INCLUDEDIR"] = get_variable ("INCLUDEDIR", DEFAULT_INCLUDEDIR);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
186 vars["LIBDIR"] = get_variable ("LIBDIR", DEFAULT_LIBDIR);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
187 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
188
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
189 #if defined (__WIN32__) && ! defined (_POSIX_VERSION)
15309
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
190 string DEFAULT_INCFLAGS
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents: 9565
diff changeset
191 = "-I" + quote_path (vars["OCTINCLUDEDIR"] + "\\..")
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
192 + " -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
193 #else
15309
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
194 string DEFAULT_INCFLAGS
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents: 9565
diff changeset
195 = "-I" + quote_path (vars["OCTINCLUDEDIR"] + "/..")
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
196 + " -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
197 #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
198 if (vars["INCLUDEDIR"] != "/usr/include")
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
199 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
200
15309
c398dde4d409 mkoctfile.in.cc: Remove unneeded "std::" namespace decorators
Rik <rik@octave.org>
parents: 15299
diff changeset
201 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
202 if (vars["LIBDIR"] != "/usr/lib")
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
203 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
204
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
205 vars["CPPFLAGS"] = get_variable ("CPPFLAGS", %OCTAVE_CONF_CPPFLAGS%);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
206 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
207 vars["F77"] = get_variable ("F77", %OCTAVE_CONF_MKOCTFILE_F77%);
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
208 vars["FFLAGS"] = get_variable ("FFLAGS", %OCTAVE_CONF_FFLAGS%);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
209 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
210 vars["CC"] = get_variable ("CC", %OCTAVE_CONF_MKOCTFILE_CC%);
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
211 vars["CFLAGS"] = get_variable ("CFLAGS", %OCTAVE_CONF_CFLAGS%);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
212 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
213 vars["CXX"] = get_variable ("CXX", %OCTAVE_CONF_MKOCTFILE_CXX%);
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
214 vars["CXXFLAGS"] = get_variable ("CXXFLAGS", %OCTAVE_CONF_CXXFLAGS%);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
215 vars["CXXPICFLAG"] = get_variable ("CXXPICFLAG", %OCTAVE_CONF_CXXPICFLAG%);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
216 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
217 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
218 %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
219
15944
4803b8c138e3 use mkoctfile, not octave_config_info to get default pkg compiler tools
John W. Eaton <jwe@octave.org>
parents: 15933
diff changeset
220 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
221 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
222
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
223 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
224 %OCTAVE_CONF_DEPEND_FLAGS%);
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
225 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
226 %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
227
15929
16418ff39a72 strip cross tool prefix from CC, CXX, etc. definitions used in mkoctfile
John W. Eaton <jwe@octave.org>
parents: 15458
diff changeset
228 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
229 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
230 %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
231
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
232 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
233 %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
234 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
235 vars["LIBOCTINTERP"] = "-loctinterp";
9515
eee9b3150446 more configure tweaks
John W. Eaton <jwe@octave.org>
parents: 9303
diff changeset
236 vars["READLINE_LIBS"] = "-lreadline";
11450
5eb10763069f substitute and use LAPACK_LIBS in mkoctfile script
John W. Eaton <jwe@octave.org>
parents: 11251
diff changeset
237 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
238 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
239 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
240 %OCTAVE_CONF_FFTW3_LDFLAGS%);
9538
d0239bddf621 use OCTAVE_CHECK_LIB to check for zlib
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
241 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
242 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
243 %OCTAVE_CONF_FFTW3F_LDFLAGS%);
9538
d0239bddf621 use OCTAVE_CHECK_LIB to check for zlib
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
244 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
245 vars["LIBS"] = get_variable ("LIBS", %OCTAVE_CONF_LIBS%);
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
246 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
247 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
248 %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
249 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
250 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
251
15929
16418ff39a72 strip cross tool prefix from CC, CXX, etc. definitions used in mkoctfile
John W. Eaton <jwe@octave.org>
parents: 15458
diff changeset
252 vars["LD_CXX"] = get_variable ("LD_CXX", %OCTAVE_CONF_MKOCTFILE_LD_CXX%);
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
253 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
254 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
255 %OCTAVE_CONF_LD_STATIC_FLAG%);
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
256 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
257 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
258 %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
259
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
260 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
261
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
262 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
263 + vars["CFLAGS"];
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
264
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
265 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
266 + vars["CXXFLAGS"];
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
267
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
268 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
269 + vars["LDFLAGS"];
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
270
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
271 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
272 + vars["SPECIAL_MATH_LIB"];
9538
d0239bddf621 use OCTAVE_CHECK_LIB to check for zlib
John W. Eaton <jwe@octave.org>
parents: 9515
diff changeset
273
17789
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
274 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
275 + 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
276 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
277
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
278 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
279 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
280 static bool debug = false;
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
281 static string help_msg =
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 "Options:\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 " -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
286 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
287 " -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
288 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
289 " -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
290 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
291 " -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
292 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
293 " -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
294 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
295 " -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
296 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
297 " -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
298 " source files.\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 " -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
301 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
302 " -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
303 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
304 " -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
305 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
306 " -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
307 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
308 " -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
309 " (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
310 " a stand-alone executable.\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 " -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
313 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
314 " -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
315 " variables are:\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
316 "\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
317 " 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
318 " 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
319 " 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
320 " 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
321 " 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
322 " 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
323 " 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
324 " 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
325 " 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
326 " 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
327 " 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
328 " 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
329 " 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
330 " 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
331 " 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
332 " 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
333 " 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
334 " 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
335 " 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
336 " 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
337 " 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
338 " 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
339 " FFTW3_LIBS\n"
8091
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 " --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
342 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
343 " --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
344 " 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
345 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
346 " -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
347 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
348 " -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
349 "\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
350 " 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
351 "\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 " .cc C++ source\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
354 " .C C++ source\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
355 " .cpp C++ source\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
356 " .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
357 " .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
358 " .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
359 " .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
360 " .o object file\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
361 " .a library file\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
362 #ifdef _MSC_VER
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
363 " .lib library file\n"
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
364 #endif
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
365 "\n";
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
366
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
367 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
368 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
369 {
15299
8bd5c490b787 Fix mex compilation with subdirs on Windows platforms (bug #37122)
Rik <rik@octave.org>
parents: 15271
diff changeset
370 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
371 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
372
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
373 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
374 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
375 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
376 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
377
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
378 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
379 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
380 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
381 pos = (p1 != string::npos && p2 != string::npos
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
382 ? 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
383 if (pos != string::npos)
15299
8bd5c490b787 Fix mex compilation with subdirs on Windows platforms (bug #37122)
Rik <rik@octave.org>
parents: 15271
diff changeset
384 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
385 }
15299
8bd5c490b787 Fix mex compilation with subdirs on Windows platforms (bug #37122)
Rik <rik@octave.org>
parents: 15271
diff changeset
386
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
387 return retval;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
388 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
389
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
390 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
391 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
392 {
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
393 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
394 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
395
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
396 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
397 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
398 {
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
399 return (s.length () >= suffix.length ()
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
400 && 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
401 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
402
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
403 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
404 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
405 {
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
406 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
407 cout << cmd << endl;
8332
34fde4755a0f style fixes
John W. Eaton <jwe@octave.org>
parents: 8092
diff changeset
408 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
409 }
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
410
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
411 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
412 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
413 {
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 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
415 || 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
416 }
96d02808a881 Support "true" or "yes" for %NO_OCT_FILE_STRIP% in mkoctfile.in.cc.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 15946
diff changeset
417
8092
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
418 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
419 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
420 {
8092
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
421 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
422
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 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
424 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
425 int result = 0;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
426
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
427 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
428 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
429 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
430 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
431 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
432 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
433 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
434 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
435 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
436 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
437 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
438 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
439 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
440 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
441 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
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 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
444 {
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 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
446 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
447 }
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
448
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
449 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
450 || !strcmp (argv[1], "-version")
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
451 || !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
452 {
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 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
454 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
455 }
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 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
458 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
459 string arg = argv[i];
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
460
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
461 if (ends_with (arg, ".c"))
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
462 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
463 file = arg;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
464 cfiles.push_back (file);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
465 }
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
466 else if (ends_with (arg, ".cc") || ends_with (arg, ".C")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
467 || ends_with (arg, ".cpp"))
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
468 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
469 file = arg;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
470 ccfiles.push_back (file);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
471 }
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
472 else if (ends_with (arg, ".f") || ends_with (arg, ".F")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
473 || ends_with (arg, "f90") || ends_with (arg, ".F90"))
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
474 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
475 file = arg;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
476 f77files.push_back (file);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
477 }
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
478 else if (ends_with (arg, ".o") || ends_with (arg, ".obj"))
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
479 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
480 file = arg;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
481 objfiles += (" " + quote_path (arg));
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
482 }
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
483 else if (ends_with (arg, ".lib") || ends_with (arg, ".a"))
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
484 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
485 file = arg;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
486 libfiles += (" " + quote_path (arg));
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
487 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
488 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
489 || arg == "-v" || arg == "-verbose" || arg == "--verbose")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
490 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
491 debug = true;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
492 if (vars["CC"] == "cc-msvc")
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
493 vars["CC"] += " -d";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
494 if (vars["CXX"] == "cc-msvc")
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
495 vars["CXX"] += " -d";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
496 if (vars["DL_LD"] == "cc-msvc")
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
497 vars["DL_LD"] += " -d";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
498 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
499 else if (arg == "-h" || arg == "-?" || arg == "-help" || arg == "--help")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
500 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
501 cout << usage_msg << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
502 cout << help_msg << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
503 return 0;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
504 }
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
505 else if (starts_with (arg, "-I"))
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
506 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
507 incflags += (" " + quote_path (arg));
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
508 }
8092
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
509 else if (arg == "-idirafter")
12174
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 if (i < argc-1)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
512 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
513 arg = argv[++i];
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
514 incflags += (" -idirafter " + arg);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
515 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
516 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
517 cerr << "mkoctfile: include directory name missing" << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
518 }
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
519 else if (starts_with (arg, "-D"))
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
520 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
521 defs += (" " + arg);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
522 }
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
523 else if (starts_with (arg, "-Wl,") || starts_with (arg, "-l")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
524 || starts_with (arg, "-L") || starts_with (arg, "-R"))
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
525 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
526 ldflags += (" " + arg);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
527 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
528 else if (arg == "-M" || arg == "-depend" || arg == "--depend")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
529 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
530 depend = true;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
531 compile = false;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
532 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
533 else if (arg == "-o" || arg == "-output" || arg == "--output")
12174
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 if (i < argc-1)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
536 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
537 arg = argv[++i];
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
538 outputfile = arg;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
539 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
540 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
541 cerr << "mkoctfile: output file name missing" << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
542 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
543 else if (arg == "-p" || arg == "-print" || arg == "--print")
12174
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 if (i < argc-1)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
546 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
547 arg = argv[++i];
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
548 cout << vars[arg] << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
549 return 0;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
550 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
551 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
552 cerr << "mkoctfile: --print requires argument" << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
553 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
554 else if (arg == "-s" || arg == "-strip" || arg == "--strip")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
555 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
556 if (no_oct_file_strip_on_this_platform)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
557 cerr << "mkoctfile: stripping disabled on this platform" << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
558 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
559 strip = true;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
560 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
561 else if (arg == "-c" || arg == "-compile" || arg == "--compile")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
562 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
563 link = false;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
564 }
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
565 else if (arg == "-g")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
566 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
567 vars["ALL_CFLAGS"] += " -g";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
568 vars["ALL_CXXFLAGS"] += " -g";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
569 vars["ALL_FFLAGS"] += " -g";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
570 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
571 else if (arg == "-link-stand-alone" || arg == "--link-stand-alone")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
572 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
573 link_stand_alone = true;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
574 }
9955
33537a4d223f mkoctfile.cc.in: accept long options with single -
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
575 else if (arg == "-mex" || arg == "--mex")
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
576 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
577 incflags += " -I.";
9303
adf676387922 properly #ifdef MSVC linker specific flags
Benjamin Lindner <lindnerb@users.sourceforge.net>
parents: 9245
diff changeset
578 #ifdef _MSC_VER
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
579 ldflags += " -Wl,-export:mexFunction";
9303
adf676387922 properly #ifdef MSVC linker specific flags
Benjamin Lindner <lindnerb@users.sourceforge.net>
parents: 9245
diff changeset
580 #endif
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
581 output_ext = ".mex";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
582 }
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
583 else if (starts_with (arg, "-W"))
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
584 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
585 pass_on_options += (" " + arg);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
586 }
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
587 else
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
588 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
589 cerr << "mkoctfile: unrecognized argument " << arg;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
590 return 1;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
591 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
592
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 if (!file.empty () && octfile.empty ())
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
594 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
595 }
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 (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
598 {
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 if (!outputfile.empty ())
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
600 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
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 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
603 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
604 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
605 {
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 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
607 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
608 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
609 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
610 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
611 }
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 else
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
613 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
614 }
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
615
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 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
617
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
618 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
619 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
620 for (it = cfiles.begin (); it != cfiles.end (); ++it)
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
621 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
622 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
623
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
624 unlink (dfile.c_str ());
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
625 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
626 + vars["CPPFLAGS"] + " " + vars["ALL_CFLAGS"] + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
627 + 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
628
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
629 FILE *fd = popen (cmd.c_str (), "r");
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
630 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
631 size_t pos;
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
632 while (!feof (fd))
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
633 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
634 line = get_line (fd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
635 if ((pos = line.rfind (".o:")) != string::npos)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
636 {
15458
1cc42df8ede7 mkoctfile.in.cc: Change variable types to stop compilation warnings.
Rik <rik@octave.org>
parents: 15309
diff changeset
637 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
638 string ofile =
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
639 (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
640 : 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
641 fo << "pic/" << ofile << " " << ofile << " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
642 << dfile << line.substr (pos) << endl;
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
643 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
644 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
645 fo << line << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
646 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
647 pclose (fd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
648 fo.close ();
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
649 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
650
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
651 for (it = ccfiles.begin (); it != ccfiles.end (); ++it)
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
652 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
653 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
654
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
655 unlink (dfile.c_str ());
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
656 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
657 + vars["CPPFLAGS"] + " " + vars["ALL_CXXFLAGS"] + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
658 + 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
659
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
660 FILE *fd = popen (cmd.c_str (), "r");
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
661 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
662 size_t pos;
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
663 while (!feof (fd))
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
664 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
665 line = get_line (fd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
666 if ((pos = line.rfind (".o:")) != string::npos)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
667 {
15458
1cc42df8ede7 mkoctfile.in.cc: Change variable types to stop compilation warnings.
Rik <rik@octave.org>
parents: 15309
diff changeset
668 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
669 string ofile =
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
670 (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
671 : 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
672 fo << "pic/" << ofile << " " << ofile << " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
673 << dfile << line.substr (pos+2) << endl;
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
674 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
675 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
676 fo << line << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
677 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
678 pclose (fd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
679 fo.close ();
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
680 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
681
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
682 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
683 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
684
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
685 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
686 {
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
687 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
688 if (!vars["F77"].empty ())
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
689 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
690 string o;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
691 if (!outputfile.empty ())
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
692 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
693 if (link)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
694 o = b + ".o";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
695 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
696 o = outputfile;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
697 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
698 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
699 o = b + ".o";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
700 objfiles += (" " + o);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
701 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
702 + vars["ALL_FFLAGS"] + " " + incflags + " " + defs + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
703 + pass_on_options + " " + f + " -o " + o;
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
704 result = run_command (cmd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
705 }
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
706 else
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
707 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
708 cerr << "mkoctfile: no way to compile Fortran file " << f << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
709 return 1;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
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 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
712
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
713 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
714 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
715 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
716 if (!vars["CC"].empty ())
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
717 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
718 string b = basename (f, true), o;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
719 if (!outputfile.empty ())
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
720 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
721 if (link)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
722 o = b + ".o";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
723 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
724 o = outputfile;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
725 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
726 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
727 o = b + ".o";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
728 objfiles += (" " + o);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
729 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
730 + vars["CPICFLAG"] + " " + vars["ALL_CFLAGS"] + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
731 + pass_on_options + " " + incflags + " " + defs + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
732 + quote_path (f) + " -o " + quote_path (o);
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
733 result = run_command (cmd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
734 }
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
735 else
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
736 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
737 cerr << "mkoctfile: no way to compile C file " << f << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
738 return 1;
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 }
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
741
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
742 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
743 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
744 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
745 if (!vars["CXX"].empty ())
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
746 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
747 string b = basename (f, true), o;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
748 if (!outputfile.empty ())
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
749 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
750 if (link)
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
751 o = b + ".o";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
752 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
753 o = outputfile;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
754 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
755 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
756 o = b + ".o";
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
757 objfiles += (" " + o);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
758 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
759 + vars["CXXPICFLAG"] + " " + vars["ALL_CXXFLAGS"] + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
760 + pass_on_options + " " + incflags + " " + defs + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
761 + quote_path (f) + " -o " + quote_path (o);
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
762 result = run_command (cmd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
763 }
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
764 else
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
765 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
766 cerr << "mkoctfile: no way to compile C++ file " << f << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
767 return 1;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
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 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
770
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
771 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
772 {
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
773 if (link_stand_alone)
12174
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 if (!vars["LD_CXX"].empty ())
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
776 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
777 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
778 + vars["ALL_CXXFLAGS"] + " " + vars["RDYNAMIC_FLAG"]
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
779 + " " + vars["ALL_LDFLAGS"] + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
780 + pass_on_options + " " + output_option + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
781 + objfiles + " " + libfiles + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
782 + ldflags + " " + vars["LFLAGS"]
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
783 + " -loctinterp -loctave "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
784 + " " + vars["OCT_LINK_OPTS"]
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
785 + " " + vars["OCTAVE_LINK_DEPS"];
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
786 result = run_command (cmd);
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 else
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
789 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
790 cerr << "mkoctfile: no way to link stand-alone executable file"
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
791 << endl;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
792 return 1;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
793 }
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
794 }
8092
6a292b0fa88c mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: style fixes
John W. Eaton <jwe@octave.org>
parents: 8091
diff changeset
795 else
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
796 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
797 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
798 + pass_on_options + " -o " + octfile + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
799 + objfiles + " " + libfiles + " "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
800 + ldflags + " " + vars["LFLAGS"]
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
801 + " -loctinterp -loctave "
f2b047f9b605 Use GNU style coding conventions for code in src/.
Rik <rik@octave.org>
parents: 17744
diff changeset
802 + vars["OCT_LINK_OPTS"] + " " + vars["OCT_LINK_DEPS"];
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
803 result = run_command (cmd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
804 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
805
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
806 if (strip)
12174
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
807 {
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
808 string cmd = "strip " + octfile;
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
diff changeset
809 result = run_command (cmd);
db1f49eaba6b whitespace fixes
John W. Eaton <jwe@octave.org>
parents: 11561
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 }
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
812
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
813 return result;
8091
4e7527a7b3f9 mkoctfile.cc.in, octave-config.cc.in, octave-bug.cc.in: new files
Michael Goffioul
parents:
diff changeset
814 }