CW(1ONBLD) illumos Build Tools CW(1ONBLD) NNAAMMEE ccww - invoke one or more compilers with argument translation SSYYNNOOPPSSIISS ccww [--CC] [----vveerrssiioonnss] [----nnooeecchhoo] ----pprriimmaarryy _c_o_m_p_i_l_e_r [----sshhaaddooww _c_o_m_p_i_l_e_r _._._.] ---- _c_o_m_p_i_l_e_r _a_r_g_s _._._. DDEESSCCRRIIPPTTIIOONN ccww is a facility for invoking one or more compilers, providing translation from Sun style arguments as appropriate. This allows the use of arbitrary compilers without the need to alter large numbers of makefiles. A mode called shadow compilation invokes multiple compilers so that warnings and errors may be obtained from both. See SHADOW COMPILATION for details. This version of cw supports compilers with both Sun Studio 12 and GCC-style command lines. AARRGGUUMMEENNTTSS Both the ----pprriimmaarryy and ----sshhaaddooww parameters take a _c_o_m_p_i_l_e_r _s_p_e_c_i_f_i_c_a_t_i_o_n. This is a comma-separated list of the form _n_a_m_e_,_e_x_e_c_u_t_a_b_l_e_,_s_t_y_l_e Where _n_a_m_e is a name for the compiler, _e_x_e_c_u_t_a_b_l_e is the full path to the compiler executable, and _s_t_y_l_e is the style of command-line options the compiler expects, either _s_u_n or _g_n_u. ----pprriimmaarryy _c_o_m_p_i_l_e_r Specify the compiler to be used primarily (that which is used for link-editing and pre-processing, and whos objects we deliver). ----sshhaaddooww _c_o_m_p_i_l_e_r Specify a shadow compiler, which builds sources for the sake of checking code quality and compatibility, but has its output discarded. ----nnooeecchhoo Do not echo the actual command line of any compilers invoked. ----vveerrssiioonnss Request from each configured primary and shadow compiler its version information. --CC The sources being compiled are C++. This is necessary as it affects the translation of compiler arguments. ---- Arguments intended for the compilers themselves must be separated from those of ccww by a ----. --__nnaammee== --__ssttyyllee== Parameters intended for the compiler be guarded with options of the form --__nnaammee== and --__ssttyyllee== Where _n_a_m_e and _s_t_y_l_e are those passed to ----pprriimmaarryy and ----sshhaaddooww this allows certain flags to be passed only to certain classes of compiler. For historical reasons, the --__ssttyyllee== option is also translated such that a style of _s_u_n may use the flag --__cccc== and a style of _g_n_u may use the flag --__ggcccc==, and when the --CC option is given and C++ is in use the style of _s_u_n may use the flag --__CCCC== and the style of _g_n_u may use the flag --__gg++++==. SSHHAADDOOWW CCOOMMPPIILLAATTIIOONN If ----sshhaaddooww compilers are specified ccww will invoke shadow compiler, with the outputs modified (as well as any translation for compiler style) as follows: 1. If neither of --cc, --SS appears in the argument list (that is, linking is attempted or only the pre-processor is invoked), the shadow compilers will not be invoked. 2. If the --oo _f_i_l_e_n_a_m_e option was provided, with or without a separating space, it will be replaced with --oo _t_e_m_p_f_i_l_e 3. If the option --oo was not provided, --oo _t_e_m_p_f_i_l_e will be added to the end of the argument list used to invoke the shadow compilers. When shadow compilation is in effect, ccww writes to standard error each compiler's standard error output following its argument list. Messages from the compilers will not be interleaved. If ccww is used to invoke the preprocessor and no output location is specified, ccww will write to standard output the primary compiler's standard output. Because the Sun compilers write intermediate objects to fixed filenames in the current directory when instructed to compile and link multiple source files via a single command line, it would be unsafe to invoke more than one compiler in this fashion. Therefore ccww does not accept multiple source files unless the preprocessor is to be invoked. An attempt to invoke ccww in this manner will result in an error. AARRGGUUMMEENNTT TTRRAANNSSLLAATTIIOONN If the compiler to be invoked is a GNU-style C or C++ compiler, a set of default flags is added to the beginning of the argument list, and the remaining arguments are translated to their closest appropriate semantic equivalents and passed in the same order as their counterparts given to ccww. See the comments at the head of _u_s_r_/_s_r_c_/_t_o_o_l_s_/_c_w_/_c_w_._c for a detailed list of translations. EENNVVIIRROONNMMEENNTT CW_SHADOW_SERIAL If this variable is set in the environment, invoke the primary compiler, wait for it to complete, then invoke the shadow compilers. Normally the primary and shadow compilers are invoked in parallel. CW_NO_EXEC If this variable is set in the environment, write the usual output to standard error but do not actually invoke any compiler. This is useful for debugging the translation engine. EEXXIITT SSTTAATTUUSS The following exit status values are returned: 0 The primary compiler, and shadow compilers if invoked, both completed successfully. >0 A usage error occurred, or one or more compilers returned a nonzero exit status. SSEEEE AALLSSOO cc(1), CC(1), gcc(1) BBUUGGSS The translations provided for gcc are not always exact and in some cases reflect local policy rather than actual equivalence. Additional compiler types should be supported. The translation engine is hacky. illumos February 10, 2018 illumos