2 .TH WINEBUILD 1 "March 2003" "@PACKAGE_STRING@" "Wine dll builder"
4 winebuild \- Wine dll builder
6 .BI winebuild\ [options]\ [input\ files]
9 generates the C and assembly files that are necessary to build a Wine
10 dll, which is basically a Win32 dll encapsulated inside a Unix
14 has different modes, depending on what kind of file it is asked to
15 generate. The mode is specified by one of the mode options specified
16 below. In addition to the mode option, various other command-line
17 option can be specified, as described in the \fBOPTIONS\fR section.
19 You have to specify exactly one of the following options, depending on
20 what you want winebuild to generate.
23 Build a C file from a .spec file (see \fBSPEC FILE SYNTAX\fR for
24 details), or from a standard Windows .def file. The resulting C file
25 must be compiled and linked to the other object files to build a
30 should be the list of all object files that will be linked into the
33 to get the list of all undefined symbols that need to be imported from
37 Build a C file for the named executable. This is basically the same as
38 the --dll mode except that it doesn't require a .spec file as input,
39 since an executable doesn't export functions. The resulting C file
40 must be compiled and linked to the other object files to build a
41 working Wine executable, and all the other object files must be listed
46 Build a .def file from a spec file. This is used when building dlls
47 with a PE (Win32) compiler.
50 Build a C file containing the definitions for debugging channels. In
53 should be a list of C files to search for debug channel
54 definitions. The resulting C file must be compiled and linked with the
58 Generate the assembly code for the 16-bit relay routines. This is for
59 Wine internal usage only, you should never need to use this option.
62 Generate the assembly code for the 32-bit relay routines. This is for
63 Wine internal usage only, you should never need to use this option.
66 .BI \-C,\ --source-dir= directory
67 Change to the specified directory before reading source files. Only
72 Ignored for compatibility with the C compiler.
74 .BI \-e,\ --entry= function
75 Specify the module entry point function; if not specified, the default
82 for CUI or GUI executables respectively. This is only valid for Win32
86 Ignored for compatibility with the C compiler.
88 .BI \-F,\ --filename= filename
89 Set the file name of the module. The default is to use the base name
90 of the spec file (without any extension).
93 Display a usage message and exit.
95 .BI \-H,\ --heap= size
96 Specify the size of the module local heap in bytes (only valid for
97 Win16 modules); default is no local heap.
99 .BI \-i,\ --ignore= [-]symbol[,[-]symbol]
100 Specify a list of symbols that should be ignored when resolving
101 undefined symbols against the imported libraries. This forces these
102 symbols to be resolved from the Unix C library (or from another Unix
103 library linked with the application). If a symbol is prefixed by '-'
104 it is removed from the list instead of being added; a stand-alone '-'
105 clears the whole list.
108 Ignored for compatibility with the C compiler.
111 Remove the stdcall decorations from the symbol names in the
112 generated .def file. Only meaningful in \fB--def\fR mode.
115 Ignored for compatibility with the C compiler.
117 .BI \-L,\ --library-path= directory
118 Append the specified directory to the list of directories that are
119 searched for import libraries.
121 .BI \-l,\ --library= name
122 Import the specified library, looking for a corresponding
123 \fIlibname.def\fR file in the directories specified with the \fB-L\fR
126 .BI \-d,\ --delay-lib= name
127 Same as the \fB-l\fR option, but import the specified library in
128 delayed mode (i.e. the library won't be loaded until a function
129 imported from it is actually called).
131 .BI \-M,\ --main-module= module
132 Specify that we are building a 16-bit dll, that will ultimately be
133 linked together with the 32-bit dll specified in \fImodule\fR. Only
134 meaningful in \fB--dll\fR mode.
136 .BI \-N,\ --dll-name= dllname
137 Set the internal name of the module. It is only used in Win16
138 modules. The default is to use the base name of the spec file (without
139 any extension). This is used for KERNEL, since it lives in
140 KRNL386.EXE. It shouldn't be needed otherwise.
142 .BI \-o,\ --output= file
143 Set the name of the output file (default is standard output).
145 .BI \-r,\ --res= rsrc.res
146 Load resources from the specified binary resource file. The
147 \fIrsrc.res\fR can be produced from a source resource file with
149 (or with a Windows resource compiler).
151 This option is only necessary for Win16 resource files, the Win32 ones
154 and will automatically be handled correctly (though the
156 option will also work for Win32 files).
158 .BI --subsystem= subsystem[:major[.minor]]
159 Set the subsystem of the executable, which can be one of the following:
162 for a command line executable,
165 for a graphical executable,
168 for a native-mode dll.
170 The entry point of a command line executable is a normal C \fBmain\fR
171 function. A \fBwmain\fR function can be used instead if you need the
172 argument array to use Unicode strings. A graphical executable has a
173 \fBWinMain\fR entry point.
175 Optionally a major and minor subsystem version can also be specified;
176 the default subsystem version is 4.0.
179 Display the program version and exit.
183 .SH "SPEC FILE SYNTAX"
185 A spec file should contain a list of ordinal declarations. The general
186 syntax is the following:
189 .RI [ flags ]\ exportname \ \fB(\fR\ [ args... ] \ \fB) \ [ handler ]
191 .IB ordinal\ variable
192 .RI [ flags ]\ exportname \ \fB(\fR\ [ data... ] \ \fB)
195 .RI [ flags ]\ exportname \ [ symbolname ]
198 .RI [ flags ]\ exportname
201 .RI [ flags ]\ exportname\ data
205 Declarations must fit on a single line, except if the end of line is
206 escaped using a backslash character. The
208 character anywhere in a line causes the rest of the line to be ignored
212 specifies the ordinal number corresponding to the entry point, or '@'
213 for automatic ordinal allocation (Win32 only).
216 is a series of optional flags, preceded by a '-' character. The
221 The entry point is not displayed in relay debugging traces (Win32
225 The entry point will be imported by ordinal instead of by name.
228 The function returns a 16-bit value (Win16 only).
231 The function returns a 64-bit value (Win32 only).
234 The entry point is only available on i386 platforms.
237 The function uses CPU register to pass arguments.
240 The function cannot be imported from other dlls, it can only be
241 accessed through GetProcAddress.
242 .SS "Function ordinals"
246 .RI [ flags ]\ exportname \ \fB(\fR\ [ args... ] \ \fB) \ [ handler ]
249 This declaration defines a function entry point. The prototype defined by
250 .IR exportname \ \fB(\fR\ [ args... ] \ \fB)
251 specifies the name available for dynamic linking and the format of the
252 arguments. '@' can be used instead of
254 for ordinal-only exports.
261 for a normal Win32 function
264 for a normal Win16 function
267 for a Win16 or Win32 function using the C calling convention
270 for a Win16 or Win32 function using the C calling convention with a
271 variable number of arguments
275 should be one or several of:
279 (16-bit unsigned value)
294 (linear pointer to a null-terminated ASCII string)
297 (linear pointer to a null-terminated Unicode string)
303 (segmented pointer to a null-terminated ASCII string).
305 .RB Only\ ptr ,\ str ,\ wstr ,\ long\ and\ double
306 are valid for Win32 functions.
310 is the name of the actual C function that will implement that entry
311 point in 32-bit mode. The handler can also be specified as
312 .IB dllname . function
313 to define a forwarded function (one whose implementation is in another
316 is not specified, it is assumed to be identical to
319 This first example defines an entry point for the 32-bit GetFocus()
322 @ stdcall GetFocus() GetFocus
324 This second example defines an entry point for the 16-bit
325 CreateWindow() call (the ordinal 100 is just an example); it also
326 shows how long lines can be split using a backslash:
328 100 pascal CreateWindow(ptr ptr long s_word s_word s_word \\
329 s_word word word word ptr) WIN_CreateWindow
331 To declare a function using a variable number of arguments, specify
334 and declare it in the C file with a '...' parameter for a Win32
335 function, or with an extra VA_LIST16 argument for a Win16 function.
336 See the wsprintf* functions in user.exe.spec and user32.spec for an
338 .SS "Variable ordinals"
341 .IB ordinal\ variable
342 .RI [ flags ]\ exportname \ \fB(\fR\ [ data... ] \ \fB)
344 This declaration defines data storage as 32-bit words at the ordinal
347 will be the name available for dynamic
350 can be a decimal number or a hex number preceeded by "0x". The
351 following example defines the variable VariableA at ordinal 2 and
354 2 variable VariableA(-1 0xff 0 0)
356 This declaration only works in Win16 spec files. In Win32 you should
360 .SS "Extern ordinals"
364 .RI [ flags ]\ exportname \ [ symbolname ]
366 This declaration defines an entry that simply maps to a C symbol
367 (variable or function). It only works in Win32 spec files.
369 will point to the symbol
371 that must be defined in the C code. Alternatively, it can be of the
373 .IB dllname . symbolname
374 to define a forwarded symbol (one whose implementation is in another
377 is not specified, it is assumed to be identical to
383 .RI [ flags ]\ exportname
385 This declaration defines a stub function. It makes the name and
386 ordinal available for dynamic linking, but will terminate execution
387 with an error message if the function is ever called.
388 .SS "Equate ordinals"
392 .RI [ flags ]\ exportname\ data
394 This declaration defines an ordinal as an absolute value.
396 will be the name available for dynamic linking.
398 can be a decimal number or a hex number preceeded by "0x".
401 has been worked on by many people over the years. The main authors are
402 Robert J. Amstadt, Alexandre Julliard, Martin von Loewis, Ulrich
403 Weigand and Eric Youngdale. Many other Wine developers have
404 contributed, please check the file Changelog in the Wine distribution
405 for the complete details.
407 It is not yet possible to use a PE-format dll in an import
408 specification; only Wine dlls can be imported.
410 If you find a bug, please submit a bug report at
411 .UR http://bugs.winehq.org
412 .B http://bugs.winehq.org.
416 is part of the wine distribution, which is available through WineHQ,
419 development headquarters, at
420 .UR http://www.winehq.org/
421 .B http://www.winehq.org/.