wrc.man.in 7.99 KB
Newer Older
1
.TH WRC 1 "October 2005" "@PACKAGE_STRING@" "Wine Developers Manual"
2 3 4
.SH NAME
wrc \- Wine Resource Compiler
.SH SYNOPSIS
5 6
.B wrc
.RI [ options ]\ [ inputfile ...]
7 8
.SH DESCRIPTION
.B wrc
9
compiles resources from \fIinputfile\fR
10
into win16 and win32 compatible binary format.
11
.PP
12
The source file is preprocessed with a builtin ANSI\-C compatible
13 14 15 16
preprocessor before the resources are compiled. See \fBPREPROCESSOR\fR
below.
.PP
.B wrc
17 18 19 20
takes a series of \fIinputfile\fR as argument. The resources are read from
standard input if no inputfile is given. If the output file is not
specified with \fB-o\fR, then \fBwrc\fR will write the output to
\fIinputfile.res\fR with \fI.rc\fR stripped, or to \fIwrc.tab.res\fR if
21
no inputfile was given.
22 23
.SH OPTIONS
.TP
24
.BI \-b,\ --target= cpu-manufacturer\fR[\fI\fB-\fIkernel\fR]\fB-\fIos
25 26
Specify the target CPU and platform on which the generated code will
be built. The target specification is in the standard autoconf format
27
as returned by \fBconfig.sub\fR.
28
.TP
29
.I \fB\-D\fR, \fB\-\-define\fR=\fIid\fR[\fB=\fIval\fR]
30 31 32 33 34
Define preprocessor identifier \fIid\fR to (optionally) value \fIval\fR.
See also
.B PREPROCESSOR
below.
.TP
35 36 37 38 39
.I \fB\-\-debug\fR=\fInn\fR
Set debug level to \fInn\fR. The value is a bitmask consisting of
1=verbose, 2=dump internals, 4=resource parser trace, 8=preprocessor
messages, 16=preprocessor scanner and 32=preprocessor parser trace.
.TP
40
.I \fB\-\-endianness\fR=\fIe\fR
41
Win32 only; set output byte\-ordering, where \fIe\fR is one of n[ative],
42
l[ittle] or b[ig].  Only resources in source-form can be reordered. Native
43
ordering depends on the system on which \fBwrc\fR was built. You can see
44
the native ordering by typing \fIwrc \-h\fR.
45
.TP
46
.I \fB\-E\fR
47 48 49 50
Preprocess only. The output is written to standard output if no
outputfile was selected. The output is compatible with what gcc would
generate.
.TP
51
.I \fB\-h\fR, \fB\-\-help\fR
52 53
Prints a summary message and exits.
.TP
54 55 56 57 58
.I \fB\-i\fR, \fB\-\-input\fR=\fIfile\fR
The name of the input file. If this option is not used, then \fBwrc\fR 
will use the first non-option argument as the input file name. If there 
are no non-option arguments, then \fBwrc\fR will read from standard input.
.TP
59 60
.I \fB\-I\fR, \fB\-\-include\-dir\fR=\fIpath\fR
Add \fIpath\fR to include search directories. \fIpath\fR may contain
61
multiple directories, separated with ':'. It is allowed to specify
62 63
\fB\-I\fR multiple times. Include files are searched in the order in
which the \fB\-I\fR options were specified.
64 65
.br
The search is compatible with gcc, in which '<>' quoted filenames are
66
searched exclusively via the \fB\-I\fR set path, whereas the '""' quoted
67 68 69
filenames are first tried to be opened in the current directory. Also
resource statements with file references are located in the same way.
.TP
70 71 72 73
.I \fB\-J\fR, \fB\-\-input\-format\fR=\fIformat\fR
Sets the input format. Valid options are 'rc' or 'rc16'. Setting the
input to 'rc16' disables the recognition of win32 keywords.
.TP
74 75
.I \fB\-l\fR, \fB\-\-language\fR=\fIlang\fR
Set default language to \fIlang\fR. Default is the neutral language 0
76 77
(i.e. "LANGUAGE 0, 0").
.TP
78
.B \-m16, -m32, -m64
79 80
Generate resources for 16-bit, 32-bit or 64-bit platforms respectively.
The only difference between 32-bit and 64-bit is whether
81 82
the _WIN64 preprocessor symbol is defined.
.TP
83
.I \fB\-\-nostdinc\fR
84
Do not search the standard include path, look for include files only
85
in the directories explicitly specified with the \fB\-I\fR option.
86
.TP
87
.I \fB\-\-no\-use\-temp\-file\fR
88
Ignored for compatibility with \fIwindres\fR.
89
.TP
90
.I \fB\-o\fR, \fB\-fo\fR, \fB\-\-output\fR=\fIfile\fR
91 92 93
Write output to \fIfile\fR. Default is \fBinputfile.res\fR
with \fB.rc\fR stripped or \fBwrc.tab.res\fR if input is read
from standard input.
94
.TP
95
.I \fB\-O\fR, \fB\-\-output\-format\fR=\fIformat\fR
96 97 98 99 100 101 102
Sets the output format. The supported formats are \fBpo\fR, \fBpot\fR,
\fBres\fR, and \fBres16\fR.  If this option is not specified, the
format defaults to \fBres\fR.
.br
In \fBpo\fR mode, if an output file name is specified it must match a
known language name, like \fBen_US.po\fR; only resources for the
specified language are output. If no output file name is specified, a
103
separate \fI.po\fR file is created for every language encountered in the
104
input.
105
.TP
106 107 108 109
.I \fB\-\-pedantic\fR
Enable pedantic warnings. Notably redefinition of #define statements can
be discovered with this option.
.TP
110
.I \fB\-\-po-dir=\fIdir\fR
111
Enable the generation of resource translations based on mo files
112
loaded from the specified directory. That directory must follow the
113
gettext convention, in particular it must contain one \fI.mo\fR file for
114 115
each language, and a LINGUAS file listing the available languages.
.TP
116 117 118
.I \fB\-r\fR
Ignored for compatibility with \fIrc\fR.
.TP
119
.I \fB\-\-preprocessor\fR=\fIprogram\fR
120 121
This option may be used to specify the preprocessor to use, including any 
leading arguments. If not specified, \fBwrc\fR uses its builtin processor.
122
To disable preprocessing, use \fB--preprocessor=cat\fR.
123
.TP
124 125 126 127 128 129 130 131
.I \fB\-U\fR, \fB\-\-undefine\fR=\fIid\fR
Undefine preprocessor identifier \fIid\fR.  Please note that only macros 
defined up to this point are undefined by this command. However, these 
include the special macros defined automatically by \fIwrc\fR.
See also
.B PREPROCESSOR
below.
.TP
132
.I \fB\-\-use\-temp\-file\fR
133
Ignored for compatibility with \fIwindres\fR.
134
.TP
135
.I \fB\-v\fR, \fB\-\-verbose\fR
136
Turns on verbose mode (equivalent to \fB-d 1\fR).
137
.TP
138
.I \fB\-\-version\fR
139
Print version and exit.
140
.SH PREPROCESSOR
141 142
The preprocessor is ANSI\-C compatible with some of the extensions of 
the gcc preprocessor. 
143 144 145 146 147 148
.PP
The preprocessor recognizes these directives: #include, #define (both
simple and macro), #undef, #if, #ifdef, #ifndef, #elif, #else, #endif,
#error, #warning, #line, # (both null\- and line\-directive), #pragma
(ignored), #ident (ignored).
.PP
149
The preprocessor sets by default several defines:
150 151 152 153 154 155 156
.br
RC_INVOKED      set to 1
.br
__WRC__         Major version of wrc
.br
__WRC_MINOR__   Minor version of wrc
.br
157
__WRC_PATCHLEVEL__   Patch level
158
.PP
159
Win32 compilation mode also sets _WIN32 to 1.
160 161 162
.PP
Special macros __FILE__, __LINE__, __TIME__ and __DATE__ are also
recognized and expand to their respective equivalent.
163 164
.SH "LANGUAGE SUPPORT"
Language, version and characteristics can be bound to all resource types that
165
have inline data, such as RCDATA. This is an extension to Microsoft's resource
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
compiler, which lacks this support completely. Only VERSIONINFO cannot have
version and characteristics attached, but languages are propagated properly if
you declare it correctly before the VERSIONINFO resource starts.
.PP
Example:
.PP
1 RCDATA DISCARDABLE
.br
LANGUAGE 1, 0
.br
VERSION 312
.br
CHARACTERISTICS 876
.br
{
.br
	1, 2, 3, 4, 5, "and whatever more data you want"
.br
	'00 01 02 03 04 05 06 07 08'
.br
}
187 188 189 190
.SH AUTHORS
.B wrc
was written by Bertho A. Stultiens and is a nearly complete rewrite of
the first wine resource compiler (1994) by Martin von Loewis.
191
Additional resource\-types were contributed by Ulrich Czekalla and Albert
192 193
den Haan. Many cleanups by Dimitrie O. Paun in 2002-2003.
Bugfixes have been contributed by many Wine developers.
194 195
.SH BUGS
\- The preprocessor recognizes variable argument macros, but does not
196
expand them correctly.
197
.br
198 199
\- Error reporting should be more precise, as currently the column and
line number reported are those of the next token. 
200 201 202
.br
\- Default memory options should differ between win16 and win32.
.PP
203
There is no support for:
204
.br
205
\- RT_DLGINCLUDE, RT_VXD, RT_PLUGPLAY and RT_HTML (unknown format)
206
.br
207 208 209 210 211
\- PUSHBOX control is unsupported due to lack of original functionality.
.PP
Fonts are parsed and generated, but there is no support for the
generation of the FONTDIR yet. The user must supply the FONTDIR
resource in the source to match the FONT resources.
212 213 214 215 216
.PP
Bugs can be reported on the
.UR http://bugs.winehq.org
.B Wine bug tracker
.UE .
217 218
.SH AVAILABILITY
.B wrc
219 220 221 222 223
is part of the Wine distribution, which is available through WineHQ,
the
.UR http://www.winehq.org/
.B Wine development headquarters
.UE .
224
.SH "SEE ALSO"
225 226 227 228 229
.BR wine (1),
.br
.UR http://www.winehq.org/help
.B Wine documentation and support
.UE .