Print this page
11461 should use a native link-editor during the build
11463 SUNWonld has passed its use-by date
11464 cmd/sgs/tools should contain tools, not common code
11465 sgsmsg should be built with the rest of the build tools


  19 .\" CDDL HEADER END
  20 .\"
  21 .\" Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  22 .\" Use is subject to license terms.
  23 .\"
  24 .\" Copyright 2018 Joyent, Inc.
  25 .\"
  26 .Dd September 4, 2018
  27 .Dt CW 1ONBLD
  28 .Os
  29 .Sh NAME
  30 .Nm cw
  31 .Nd invoke one or more compilers with argument translation
  32 .Sh SYNOPSIS
  33 .Nm cw
  34 .Op Fl C
  35 .Op Fl -versions
  36 .Op Fl -noecho
  37 .Fl -primary Ar compiler
  38 .Op Fl -shadow Ar compiler ...

  39 .Fl -
  40 .Ar compiler args ...
  41 .Sh DESCRIPTION
  42 .Nm cw
  43 is a facility for invoking one or more compilers, providing translation from
  44 Sun style arguments as appropriate.
  45 This allows the use of arbitrary compilers without the need to alter large
  46 numbers of makefiles.
  47 A mode called shadow compilation invokes multiple compilers so that warnings
  48 and errors may be obtained from all of them.
  49 See
  50 .Sx SHADOW COMPILATION
  51 for details.
  52 This version of cw supports compilers with both Sun Studio 12 and GCC-style
  53 command lines.
  54 .Sh ARGUMENTS
  55 Both the
  56 .Fl -primary
  57 and
  58 .Fl -shadow


  60 .Em compiler specification .
  61 This is a comma-separated list of the form
  62 .Ar name,executable,style
  63 Where
  64 .Ar name
  65 is a name for the compiler,
  66 .Ar executable
  67 is the full path to the compiler executable, and
  68 .Ar style
  69 is the style of command-line options the compiler expects, either
  70 .Em sun
  71 or
  72 .Em gnu .
  73 .Bl -tag -width indent
  74 .It Fl -primary Ar compiler
  75 Specify the compiler to be used primarily (that which is used for link-editing
  76 and pre-processing, and whos objects we deliver).
  77 .It Fl -shadow Ar compiler
  78 Specify a shadow compiler, which builds sources for the sake of checking code
  79 quality and compatibility, but has its output discarded.





  80 .It Fl -noecho
  81 Do not echo the actual command line of any compilers invoked.
  82 .It Fl -versions
  83 Request from each configured primary and shadow compiler its version
  84 information.
  85 .It Fl C
  86 The sources being compiled are C++.  This is necessary as it affects the
  87 translation of compiler arguments.
  88 .It Fl -
  89 Arguments intended for the compilers themselves must be separated from those
  90 of
  91 .Nm cw
  92 by a
  93 .Fl - .
  94 .It Fl _name=
  95 .It Fl _style=
  96 Parameters intended for the compiler be guarded with options of the form
  97 .Fl _name=
  98 and
  99 .Fl _style=


 193 for it to complete, then invoke the shadow compilers.
 194 Normally the primary and shadow compilers are invoked in parallel.
 195 .It CW_NO_EXEC
 196 f this variable is set in the environment, write the usual output to
 197 standard error but do not actually invoke any compiler.
 198 This is useful for debugging the translation engine.
 199 .El
 200 .Sh EXIT STATUS
 201 The following exit status values are returned:
 202 .Bl -tag -width indent
 203 .It 0
 204 The primary compiler, and shadow compilers if invoked, all completed
 205 successfully.
 206 .It >0
 207 A usage error occurred, or one or more compilers returned a nonzero
 208 exit status.
 209 .El
 210 .Sh SEE ALSO
 211 .Xr cc 1 ,
 212 .Xr CC 1 ,
 213 .Xr gcc 1

 214 .Sh BUGS
 215 The translations provided for gcc are not always exact and in some cases
 216 reflect local policy rather than actual equivalence.
 217 .Pp
 218 Additional compiler types should be supported.
 219 .Pp
 220 The translation engine is hacky.


  19 .\" CDDL HEADER END
  20 .\"
  21 .\" Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  22 .\" Use is subject to license terms.
  23 .\"
  24 .\" Copyright 2018 Joyent, Inc.
  25 .\"
  26 .Dd September 4, 2018
  27 .Dt CW 1ONBLD
  28 .Os
  29 .Sh NAME
  30 .Nm cw
  31 .Nd invoke one or more compilers with argument translation
  32 .Sh SYNOPSIS
  33 .Nm cw
  34 .Op Fl C
  35 .Op Fl -versions
  36 .Op Fl -noecho
  37 .Fl -primary Ar compiler
  38 .Op Fl -shadow Ar compiler ...
  39 .Op Fl -linker Ar linker
  40 .Fl -
  41 .Ar compiler args ...
  42 .Sh DESCRIPTION
  43 .Nm cw
  44 is a facility for invoking one or more compilers, providing translation from
  45 Sun style arguments as appropriate.
  46 This allows the use of arbitrary compilers without the need to alter large
  47 numbers of makefiles.
  48 A mode called shadow compilation invokes multiple compilers so that warnings
  49 and errors may be obtained from all of them.
  50 See
  51 .Sx SHADOW COMPILATION
  52 for details.
  53 This version of cw supports compilers with both Sun Studio 12 and GCC-style
  54 command lines.
  55 .Sh ARGUMENTS
  56 Both the
  57 .Fl -primary
  58 and
  59 .Fl -shadow


  61 .Em compiler specification .
  62 This is a comma-separated list of the form
  63 .Ar name,executable,style
  64 Where
  65 .Ar name
  66 is a name for the compiler,
  67 .Ar executable
  68 is the full path to the compiler executable, and
  69 .Ar style
  70 is the style of command-line options the compiler expects, either
  71 .Em sun
  72 or
  73 .Em gnu .
  74 .Bl -tag -width indent
  75 .It Fl -primary Ar compiler
  76 Specify the compiler to be used primarily (that which is used for link-editing
  77 and pre-processing, and whos objects we deliver).
  78 .It Fl -shadow Ar compiler
  79 Specify a shadow compiler, which builds sources for the sake of checking code
  80 quality and compatibility, but has its output discarded.
  81 .It Fl -linker Ar linker
  82 Specify a link-editor to use in place of
  83 .Pa /usr/bin/ld .
  84 .Xr ld 1
  85 itself arranges for this to be executed by any subprocesses.
  86 .It Fl -noecho
  87 Do not echo the actual command line of any compilers invoked.
  88 .It Fl -versions
  89 Request from each configured primary and shadow compiler its version
  90 information.
  91 .It Fl C
  92 The sources being compiled are C++.  This is necessary as it affects the
  93 translation of compiler arguments.
  94 .It Fl -
  95 Arguments intended for the compilers themselves must be separated from those
  96 of
  97 .Nm cw
  98 by a
  99 .Fl - .
 100 .It Fl _name=
 101 .It Fl _style=
 102 Parameters intended for the compiler be guarded with options of the form
 103 .Fl _name=
 104 and
 105 .Fl _style=


 199 for it to complete, then invoke the shadow compilers.
 200 Normally the primary and shadow compilers are invoked in parallel.
 201 .It CW_NO_EXEC
 202 f this variable is set in the environment, write the usual output to
 203 standard error but do not actually invoke any compiler.
 204 This is useful for debugging the translation engine.
 205 .El
 206 .Sh EXIT STATUS
 207 The following exit status values are returned:
 208 .Bl -tag -width indent
 209 .It 0
 210 The primary compiler, and shadow compilers if invoked, all completed
 211 successfully.
 212 .It >0
 213 A usage error occurred, or one or more compilers returned a nonzero
 214 exit status.
 215 .El
 216 .Sh SEE ALSO
 217 .Xr cc 1 ,
 218 .Xr CC 1 ,
 219 .Xr gcc 1 ,
 220 .Xr ld 1
 221 .Sh BUGS
 222 The translations provided for gcc are not always exact and in some cases
 223 reflect local policy rather than actual equivalence.
 224 .Pp
 225 Additional compiler types should be supported.
 226 .Pp
 227 The translation engine is hacky.