Replaced 'heap' .spec statement by a command line option.

Updated winebuild manpage.
This commit is contained in:
Alexandre Julliard 2002-09-12 22:51:20 +00:00
parent 6026417ff0
commit 16a303b376
7 changed files with 30 additions and 44 deletions

View file

@ -77,11 +77,12 @@ EXTRASUBDIRS = \
@MAKE_DLL_RULES@
# Special rules for 16-bit resource files
# Special rules for 16-bit resource and spec files
gdi.exe.spec.c: gdi.exe.spec version16.res
$(LDPATH) $(WINEBUILD) $(DEFS) -H 65520 -o $@ -M $(MODULE) -spec $(SRCDIR)/gdi.exe.spec
version16.res: version16.rc
$(LDPATH) $(WRC) $(DIVINCL) -o $@ -w16 -m -r $(SRCDIR)/version16.rc
gdi.exe.spec.c: version16.res
### Dependencies:

View file

@ -1,4 +1,3 @@
heap 65520
rsrc version16.res
1 pascal SetBkColor(word long) SetBkColor16

View file

@ -98,7 +98,10 @@ EXTRASUBDIRS = \
@MAKE_DLL_RULES@
# Special rules for 16-bit resource files
# Special rules for 16-bit resource and spec files
user.exe.spec.c: user.exe.spec resources/version16.res
$(LDPATH) $(WINEBUILD) $(DEFS) -H 65520 -o $@ -M $(MODULE) -spec $(SRCDIR)/user.exe.spec
resources/display.res: resources/display.rc
$(LDPATH) $(WRC) $(DIVINCL) -o $@ -w16 -m -r $(SRCDIR)/resources/display.rc
@ -113,6 +116,4 @@ display.spec.c: resources/display.res
mouse.spec.c: resources/mouse.res
user.exe.spec.c: resources/version16.res
### Dependencies:

View file

@ -1,4 +1,3 @@
heap 65520
rsrc resources/version16.res
1 pascal16 MessageBox(word str str word) MessageBox16

View file

@ -122,6 +122,7 @@ static void do_include( const char *arg );
static void do_k_flags( const char *arg );
static void do_exe_mode( const char *arg );
static void do_module( const char *arg );
static void do_heap( const char *arg );
static void do_name( const char *arg );
static void do_spec( const char *arg );
static void do_def( const char *arg );
@ -151,6 +152,7 @@ static const struct option_descr option_table[] =
{ "-L", 1, do_lib, "-L directory Look for imports libraries in 'directory'" },
{ "-l", 1, do_import, "-l lib.dll Import the specified library" },
{ "-dl", 1, do_dimport, "-dl lib.dll Delay-import the specified library" },
{ "-H", 1, do_heap, "-H size Set the heap size for a Win16 dll" },
{ "-N", 1, do_name, "-N dllname Set the DLL name (default: set from input file name)" },
{ "-res", 1, do_rsrc, "-res rsrc.res Load resources from rsrc.res" },
{ "-o", 1, do_output, "-o name Set the output file name (default: stdout)\n" },
@ -221,6 +223,14 @@ static void do_k_flags( const char *arg )
/* ignore all other flags */
}
static void do_heap( const char *arg )
{
if (!isdigit(arg[0]))
fatal_error( "Expected number argument with -H option instead of '%s'\n", arg );
DLLHeapSize = atoi(arg);
if (DLLHeapSize > 65535) fatal_error( "Invalid heap size %d, maximum is 65535\n", DLLHeapSize );
}
static void do_name( const char *arg )
{
strncpy( DLLName, arg, sizeof(DLLName) );

View file

@ -504,13 +504,7 @@ SPEC_TYPE ParseTopLevel( FILE *file, int def_only )
while ((token = GetToken(1)) != NULL)
{
if (strcmp(token, "heap") == 0)
{
token = GetToken(0);
if (!IsNumberString(token)) fatal_error( "Expected number after heap\n" );
DLLHeapSize = atoi(token);
}
else if (strcmp(token, "init") == 0)
if (strcmp(token, "init") == 0)
{
if (SpecType == SPEC_WIN16)
fatal_error( "init cannot be used for Win16 spec files\n" );
@ -542,7 +536,7 @@ SPEC_TYPE ParseTopLevel( FILE *file, int def_only )
ParseOrdinal( atoi(token) );
}
else
fatal_error( "Expected name, id, length or ordinal\n" );
fatal_error( "Expected ordinal declaration\n" );
}
if (SpecType == SPEC_WIN16 && !owner_name[0])

View file

@ -83,6 +83,10 @@ Ignored for compatibility with the C compiler.
.B \-h
Display a usage message and exit.
.TP
.BI \-H\ size
Specify the size of the module local heap in bytes (only valid for
Win16 modules); default is no local heap.
.TP
.BI \-I\ directory
Ignored for compatibility with the C compiler.
.TP
@ -130,10 +134,15 @@ passed to the entry point.
.br
This option is only meaningful in \fB-exe\fR mode.
.TP
.BI \-N\ dllname
Set the internal name of the module. It is only used in Win16
modules. The default is to use the base name of the spec file (without
any extension). This is used for KERNEL, since it lives in
KRNL386.EXE. It shouldn't be needed otherwise.
.TP
.BI \-o\ file
Set the name of the output file (default is standard output).
.TP
.TP
.BI \-res\ rsrc.res
Load resources from the specified binary resource file. The
\fIrsrc.res\fR can be produced from a source resource file with
@ -147,14 +156,6 @@ Turn on warnings.
A spec file should contain a number of optional directives, and then a
list of ordinal declarations. The general syntax is the following:
.PP
.RB [ name\ \fIname\fR]
.br
.RB [ file\ \fIwinfilename\fR]
.br
.RB [ mode\ dll | cuiexe | guiexe | cuiexe_unicode | guiexe_unicode ]
.br
.RB [ heap\ \fIsize\fR]
.br
.RB [ init\ \fIfunction\fR]
.br
.RB [ rsrc\ \fIresfile\fR]
@ -181,25 +182,6 @@ list of ordinal declarations. The general syntax is the following:
.IB ordinal\ forward
.RI [ flags ]\ exportname\ forwardname
.SS "Optional directives"
.B name
is the internal name of the module. It is only used in Win16
modules. The default is to use the base name of the spec file (without
any extension). This is used for KERNEL, since it lives in
KRNL386.EXE. It shouldn't be needed otherwise.
.PP
.B file
is used to give the name of the file containing the dll. If not
specified it is determined from the name of the source spec
file. Normally you shouldn't ever need to specify it explicitly.
.PP
.B mode
is used to specify whether this is the spec file for a dll or the main
exe. This is only valid for Win32 spec files.
.PP
.B heap
specifies the size of the module local heap (only valid for Win16
modules); default is no local heap.
.PP
.B init
specifies a function which will be called when this dll is
loaded. This is only valid for Win32 modules.