Print this page
6205 onbld manuals should be declared as 1onbld
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Josef Sipek <jeffpc@josefsipek.net>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/cw/cw.1
+++ new/usr/src/tools/cw/cw.1onbld
1 1 .\"
2 2 .\" CDDL HEADER START
3 3 .\"
4 4 .\" The contents of this file are subject to the terms of the
5 5 .\" Common Development and Distribution License (the "License").
6 6 .\" You may not use this file except in compliance with the License.
7 7 .\"
8 8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 .\" or http://www.opensolaris.org/os/licensing.
10 10 .\" See the License for the specific language governing permissions
11 11 .\" and limitations under the License.
12 12 .\"
13 13 .\" When distributing Covered Code, include this CDDL HEADER in each
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
14 14 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 .\" If applicable, add the following below this CDDL HEADER, with the
16 16 .\" fields enclosed by brackets "[]" replaced with your own identifying
17 17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
18 18 .\"
19 19 .\" CDDL HEADER END
20 20 .\"
21 21 .\" Copyright 2010 Sun Microsystems, Inc. All rights reserved.
22 22 .\" Use is subject to license terms.
23 23 .\"
24 -.TH cw 1 "22 March 2010"
24 +.TH cw 1ONBLD "22 March 2010"
25 25 .SH NAME
26 26 .I cw
27 27 \- invoke one or more compilers with argument translation
28 28 .SH SYNOPSIS
29 29 \fBcw {-_cc|-_gcc|-_CC|-_g++} [options] [compiler args...]\fP
30 30 .LP
31 31 .SH DESCRIPTION
32 32 .IX "OS-Net build tools" "cw" "" "\fBcw\fP"
33 33 .LP
34 34 .I cw
35 35 is a facility for invoking one or more compilers, providing
36 36 translation from Sun Studio arguments as appropriate. This allows
37 37 the use of arbitrary compilers without the need to alter large
38 38 numbers of makefiles. A mode called shadow compilation, the default,
39 39 invokes two different compilers so that warnings and errors may be
40 40 obtained from both. See SHADOW COMPILATION for details. This version
41 41 of cw supports Sun Studio 10 and 11 and gcc 3.4.3 as shipped in
42 42 Solaris.
43 43 .LP
44 44 .SH ARGUMENTS
45 45 .LP
46 46 Exactly one of the following arguments is required, and must appear
47 47 immediately following \fBcw\fP in the argument list:
48 48 .TP 4
49 49 .B \-_cc
50 50 Select Sun Studio C (cc) as the primary compiler.
51 51 .TP 4
52 52 .B \-_gcc
53 53 Select GNU C (gcc) as the primary compiler.
54 54 .TP 4
55 55 .B \-_CC
56 56 Select Sun Studio C++ (CC) as the primary compiler.
57 57 .TP 4
58 58 .B \-_g++
59 59 Select GNU C++ (g++) as the primary compiler.
60 60 .LP
61 61 .SH OPTIONS
62 62 .LP
63 63 The following options are supported:
64 64 .TP 4
65 65 .B \-_compiler
66 66 Do not invoke any compiler; instead, write to standard output the
67 67 full path to the primary compiler that would be invoked. If this
68 68 option is given, it must appear immediately following the compiler
69 69 selection argument, and all other options will be disregarded.
70 70 .LP
71 71 .TP 4
72 72 .B \-_versions
73 73 Print the cw version, followed in turn by the path to and versions
74 74 of each compiler which would be invoked. If this option is given,
75 75 it must appear immediately following the compiler selection argument,
76 76 and all other options will be disregarded.
77 77 .LP
78 78 .TP 4
79 79 .B \-_noecho
80 80 Normally, cw writes to standard error the actual compiler commands
81 81 invoked, each prefixed with '+'. This option suppresses these
82 82 messages.
83 83 .LP
84 84 .TP 4
85 85 .B \-_cc=,\-_gcc=,\-_CC=,\-g++=
86 86 Pass compiler-dependent options. See ARGUMENT TRANSLATION.
87 87 .LP
88 88 .SH SHADOW COMPILATION
89 89 .LP
90 90 Unless otherwise directed by environment variables (see ENVIRONMENT),
91 91 \fBcw\fP will invoke both the compiler specified by its first argument
92 92 (primary) and a designated alternate compiler (shadow). The primary
93 93 compiler will be invoked with the arguments given to cw, translated
94 94 as described in ARGUMENT TRANSLATION. The secondary compiler will be
95 95 invoked in parallel with the primary (but see ENVIRONMENT); its
96 96 arguments will likewise be translated. However, the shadow compiler's
97 97 arguments will also be modified as follows:
98 98 .LP
99 99 .TP 4
100 100 .B 1.
101 101 If none of \fI-c\fP, \fI-E\fP, \fI-P\fP, or \fI-S\fP appears in the
102 102 argument list (that is, linking is attempted), the shadow compiler
103 103 will not be invoked. This is because the objects built with that
104 104 compiler which would be linked have been previously discarded.
105 105 .LP
106 106 .TP 4
107 107 .B 2.
108 108 If an option of the form \fI-ofilename\fP was provided, it will be
109 109 replaced by two options of the form \fI-o\fP \fItempfile\fP.
110 110 .LP
111 111 .TP 4
112 112 .B 3.
113 113 If the option \fI-o\fP was provided, its following argument will be
114 114 replaced by \fItempfile\fP.
115 115 .LP
116 116 .TP 4
117 117 .B 4.
118 118 If neither of the above options was provided, two options of the
119 119 form \fI-o\fP \fItempfile\fP will be added to the end of the argument
120 120 list used to invoke the shadow compiler.
121 121 .LP
122 122 In all three cases, \fItempfile\fP is the name of a temporary file
123 123 which will be removed by \fBcw\fP before it terminates.
124 124 .LP
125 125 When shadow compilation is in effect, \fBcw\fP writes to standard error
126 126 each compiler's standard error output following its argument list.
127 127 Messages from the two compilers will not be interleaved. If \fBcw\fP
128 128 is used to invoke the preprocessor and no output location is specified,
129 129 \fBcw\fP will write to standard output the primary compiler's
130 130 standard output, and the secondary compiler's standard output will
131 131 be discarded.
132 132 .LP
133 133 Because the Studio compilers write intermediate objects to fixed
134 134 filenames in the current directory when instructed to compile and
135 135 link multiple source files via a single command line, it would be
136 136 unsafe to invoke more than one compiler in this fashion. Therefore
137 137 \fBcw\fP does not accept multiple source files unless the
138 138 preprocessor is to be invoked. An attempt to invoke \fBcw\fP in
139 139 this manner will result in an error.
140 140 .LP
141 141 .SH ARGUMENT TRANSLATION
142 142 .LP
143 143 The arguments provided to \fBcw\fP will be passed through to each
144 144 compiler invoked, altered as follows:
145 145 .LP
146 146 .TP 4
147 147 .B 1.
148 148 Options intended for \fBcw\fP itself are removed.
149 149 .LP
150 150 .TP 4
151 151 .B 2.
152 152 The shadow compiler's arguments are modified as described in
153 153 SHADOW COMPILATION so that its output is discarded.
154 154 .LP
155 155 .TP 4
156 156 .B 3.
157 157 If the compiler to be invoked is a GNU C or C++ compiler, a set of
158 158 default flags is added to the beginning of the argument list, and the
159 159 remaining arguments are translated to their closest appropriate
160 160 semantic equivalents and passed in the same order as their
161 161 counterparts given to \fBcw\fP. Arguments which begin with
162 162 \fI-_gcc=\fP or \fI-_g++=\fP will be passed in place with the
163 163 leading portion removed. Arguments which begin with \fI-_cc=\fP or
164 164 \fI-_CC=\fP will be discarded. See the comments at the head of
165 165 \fIusr/src/tools/cw/cw.c\fP for a detailed list of translations.
166 166 .LP
167 167 .TP 4
168 168 .B 4.
169 169 If the compiler to be invoked is a Studio C or C++ compiler, the
170 170 remaining arguments are passed unmodified and in the same order as
171 171 given to \fBcw\fP. Arguments which begin with \fI-_cc=\fP or
172 172 \fI-_CC=\fP will be passed in place with the leading portion removed.
173 173 Arguments which begin with \fI-_gcc=\fP or \fI-_g++=\fP will be
174 174 discarded.
175 175 .LP
176 176 .SH ENVIRONMENT
177 177 .LP
178 178 .TP 4
179 179 .B CW_NO_SHADOW
180 180 If this variable is set in the environment, invoke only the
181 181 primary compiler.
182 182 .LP
183 183 .TP 4
184 184 .B CW_SHADOW_SERIAL
185 185 If this variable is set in the environment, invoke the primary compiler,
186 186 wait for it to complete, then invoke the shadow compiler. Normally
187 187 the two compilers are invoked in parallel. If CW_NO_SHADOW is set,
188 188 this has no effect.
189 189 .LP
190 190 .TP 4
191 191 .B CW_NO_EXEC
192 192 If this variable is set in the environment, write the usual output to
193 193 standard error but do not actually invoke any compiler. This is
194 194 useful for debugging the translation engine.
195 195 .LP
196 196 .TP 4
197 197 .B CW_CC, CW_CPLUSPLUS
198 198 If these variables are set in the environment, they specify the full
199 199 pathname for the Studio C and C++ compilers, respectively.
200 200 .LP
201 201 .TP 4
202 202 .B CW_CC_DIR, CW_CPLUSPLUS_DIR, SPRO_VROOT, SPRO_ROOT, BUILD_TOOLS
203 203 If CW_CC or CW_CPLUSPLUS are not set,
204 204 these variables define the search path for Studio compilers as
205 205 follows:
206 206 .B
207 207 If CW_CC_DIR is set, the Studio C compiler in \fI$CW_CC_DIR\fP
208 208 will be used. Likewise, if CW_CPLUSPLUS_DIR is set, the Studio C++
209 209 compiler in \fI$CW_CPLUSPLUS_DIR\fP will be used.
210 210 Otherwise, if SPRO_VROOT is set, the Studio C and C++ compilers
211 211 in \fI$SPRO_VROOT/bin\fP will be used.
212 212 Otherwise, if SPRO_ROOT is set, the Studio C and C++ compilers
213 213 in \fI$SPRO_ROOT/SS12/bin\fP will be used.
214 214 Otherwise, if BUILD_TOOLS is set, the Studio C and C++ compilers
215 215 in \fI$BUILD_TOOLS/SUNWspro/SS12/bin\fP will be used.
216 216 Otherwise, the Studio compilers in a predefined default location
217 217 will be used.
218 218 .LP
219 219 .TP 4
220 220 .B CW_GCC, CW_GPLUSPLUS
221 221 If these variables are set in the environment, they specify the full
222 222 pathname for the GNU C and C++ compilers, respectively.
223 223 .LP
224 224 .TP 4
225 225 .B CW_GCC_DIR, CW_GPLUSPLUS_DIR, GNU_ROOT
226 226 If CW_GCC or CW_GPLUSPLUS are not set,
227 227 these variables alter the search path for GNU compilers in a manner
228 228 similar to that described above for the Studio compilers. Specifically:
229 229 .B
230 230 If CW_GCC_DIR is set, the GNU C compiler in \fI$CW_GCC_DIR\fP
231 231 will be used. Likewise, if CW_GPLUSPLUS_DIR is set, the GNU C++
232 232 compiler in \fI$CW_GPLUSPLUS_DIR\fP will be used.
233 233 Otherwise, if GNU_ROOT is set, the GNU C and C++ compilers
234 234 in \fI$GCC_ROOT/bin\fP will be used.
235 235 Otherwise, the GNU compilers in a predefined default location
236 236 will be used.
237 237 .LP
238 238 .SH EXIT STATUS
239 239 .LP
240 240 The following exit status values are returned:
241 241 .IP "\fB0\fR" 4
242 242 .IX Item "0"
243 243 The primary compiler, and shadow compiler if invoked, both completed
244 244 successfully.
245 245 .IP "\fB>0\fR" 4
246 246 .IX Item ">0"
247 247 A usage error occurred, or one or more compilers returned a nonzero
248 248 exit status.
249 249 .LP
250 250 .SH BUGS
251 251 .LP
252 252 The translations provided for gcc are not always exact and in some
253 253 cases reflect local ON policy rather than actual equivalence.
254 254 .LP
255 255 Additional compiler types should be supported.
256 256 .LP
257 257 The translation engine is hacky.
258 258 .LP
259 259 .SH SEE ALSO
260 260 .LP
261 261 cc(1), CC(1), gcc(1)
↓ open down ↓ |
227 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX