Removed support for 'rsrc' spec file statement.

This commit is contained in:
Alexandre Julliard 2002-11-18 23:16:09 +00:00
parent 4162abbaf4
commit a9135e8333
14 changed files with 48 additions and 57 deletions

View File

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

View File

@ -1,5 +1,3 @@
rsrc version16.res
1 pascal SetBkColor(word long) SetBkColor16 1 pascal SetBkColor(word long) SetBkColor16
2 pascal16 SetBkMode(word word) SetBkMode16 2 pascal16 SetBkMode(word word) SetBkMode16
3 pascal16 SetMapMode(word word) SetMapMode16 3 pascal16 SetMapMode(word word) SetMapMode16

View File

@ -52,8 +52,8 @@ kernel.res: $(MC_SRCS:.mc=.mc.rc)
# Special rules for 16-bit resource and spec files # Special rules for 16-bit resource and spec files
krnl386.exe.spec.c: krnl386.exe.spec version16.res $(WINEBUILD) krnl386.exe.spec.c: krnl386.exe.spec version16.res
$(LDPATH) $(WINEBUILD) $(DEFS) -N kernel -o $@ -M $(MODULE) --spec $(SRCDIR)/krnl386.exe.spec $(LDPATH) $(WINEBUILD) $(DEFS) -N kernel -o $@ -M $(MODULE) -r version16.res --spec $(SRCDIR)/krnl386.exe.spec
version16.res: version16.rc version16.res: version16.rc
$(LDPATH) $(WRC) $(DIVINCL) -o $@ -w16 -m -r $(SRCDIR)/version16.rc $(LDPATH) $(WRC) $(DIVINCL) -o $@ -w16 -m -r $(SRCDIR)/version16.rc

View File

@ -1,5 +1,3 @@
rsrc version16.res
# 1-207 are the basic functions, those are (with minor variations) # 1-207 are the basic functions, those are (with minor variations)
# present in win31, win95 and nt351 # present in win31, win95 and nt351

View File

@ -67,6 +67,7 @@ uninstall::
version16.res: version16.rc version16.res: version16.rc
$(LDPATH) $(WRC) $(DIVINCL) -o $@ -w16 -m -r $(SRCDIR)/version16.rc $(LDPATH) $(WRC) $(DIVINCL) -o $@ -w16 -m -r $(SRCDIR)/version16.rc
shell.spec.c: version16.res shell.spec.c: shell.spec version16.res
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -M $(MODULE) -r version16.res --spec $(SRCDIR)/shell.spec
### Dependencies: ### Dependencies:

View File

@ -1,5 +1,3 @@
rsrc version16.res
1 pascal RegOpenKey(long str ptr) RegOpenKey16 1 pascal RegOpenKey(long str ptr) RegOpenKey16
2 pascal RegCreateKey(long str ptr) RegCreateKey16 2 pascal RegCreateKey(long str ptr) RegCreateKey16
3 pascal RegCloseKey(long) RegCloseKey16 3 pascal RegCloseKey(long) RegCloseKey16

View File

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

View File

@ -1,5 +1,3 @@
rsrc resources/display.res
1 stub BitBlt 1 stub BitBlt
2 stub ColorInfo 2 stub ColorInfo
3 stub Control 3 stub Control

View File

@ -1,5 +1,3 @@
rsrc resources/mouse.res
1 pascal16 Inquire(ptr) MOUSE_Inquire 1 pascal16 Inquire(ptr) MOUSE_Inquire
2 pascal16 Enable(segptr) MOUSE_Enable 2 pascal16 Enable(segptr) MOUSE_Enable
3 pascal16 Disable() MOUSE_Disable 3 pascal16 Disable() MOUSE_Disable

View File

@ -1,5 +1,3 @@
rsrc resources/version16.res
1 pascal16 MessageBox(word str str word) MessageBox16 1 pascal16 MessageBox(word str str word) MessageBox16
2 stub OldExitWindows 2 stub OldExitWindows
3 stub EnableOEMLayer 3 stub EnableOEMLayer

View File

@ -166,7 +166,7 @@ extern void BuildSpec16File( FILE *outfile );
extern void BuildSpec32File( FILE *outfile ); extern void BuildSpec32File( FILE *outfile );
extern void BuildDef32File( FILE *outfile ); extern void BuildDef32File( FILE *outfile );
extern void BuildDebugFile( FILE *outfile, const char *srcdir, char **argv ); extern void BuildDebugFile( FILE *outfile, const char *srcdir, char **argv );
extern SPEC_TYPE ParseTopLevel( FILE *file, int def_only ); extern void ParseTopLevel( FILE *file );
/* global variables */ /* global variables */
@ -196,5 +196,6 @@ extern ORDDEF *EntryPoints[MAX_ORDINALS];
extern ORDDEF *Ordinals[MAX_ORDINALS]; extern ORDDEF *Ordinals[MAX_ORDINALS];
extern ORDDEF *Names[MAX_ORDINALS]; extern ORDDEF *Names[MAX_ORDINALS];
extern SPEC_MODE SpecMode; extern SPEC_MODE SpecMode;
extern SPEC_TYPE SpecType;
#endif /* __WINE_BUILD_H */ #endif /* __WINE_BUILD_H */

View File

@ -38,6 +38,8 @@ ORDDEF *Ordinals[MAX_ORDINALS];
ORDDEF *Names[MAX_ORDINALS]; ORDDEF *Names[MAX_ORDINALS];
SPEC_MODE SpecMode = SPEC_MODE_DLL; SPEC_MODE SpecMode = SPEC_MODE_DLL;
SPEC_TYPE SpecType = SPEC_WIN32;
int Base = MAX_ORDINALS; int Base = MAX_ORDINALS;
int Limit = 0; int Limit = 0;
int DLLHeapSize = 0; int DLLHeapSize = 0;
@ -69,6 +71,8 @@ const char *output_file_name = NULL;
static FILE *input_file; static FILE *input_file;
static FILE *output_file; static FILE *output_file;
static const char *current_src_dir; static const char *current_src_dir;
static int nb_res_files;
static char **res_files;
/* execution mode */ /* execution mode */
static enum static enum
@ -285,6 +289,7 @@ static void do_exe_mode( const char *arg )
static void do_module( const char *arg ) static void do_module( const char *arg )
{ {
strcpy( owner_name, arg ); strcpy( owner_name, arg );
SpecType = SPEC_WIN16;
} }
static void do_glue(void) static void do_glue(void)
@ -334,7 +339,8 @@ static void do_dimport( const char *arg )
static void do_rsrc( const char *arg ) static void do_rsrc( const char *arg )
{ {
load_res32_file( arg ); res_files = xrealloc( res_files, (nb_res_files+1) * sizeof(*res_files) );
res_files[nb_res_files++] = xstrdup( arg );
} }
/* parse options from the argv array and remove all the recognized ones */ /* parse options from the argv array and remove all the recognized ones */
@ -387,6 +393,22 @@ static void parse_options( char *argv[] )
} }
/* load all specified resource files */
static void load_resources(void)
{
int i;
switch (SpecType)
{
case SPEC_WIN16:
for (i = 0; i < nb_res_files; i++) load_res16_file( res_files[i] );
break;
case SPEC_WIN32:
for (i = 0; i < nb_res_files; i++) load_res32_file( res_files[i] );
break;
}
}
/******************************************************************* /*******************************************************************
* main * main
*/ */
@ -398,7 +420,9 @@ int main(int argc, char **argv)
switch(exec_mode) switch(exec_mode)
{ {
case MODE_SPEC: case MODE_SPEC:
switch (ParseTopLevel( input_file, 0 )) load_resources();
ParseTopLevel( input_file );
switch (SpecType)
{ {
case SPEC_WIN16: case SPEC_WIN16:
if (argv[1]) if (argv[1])
@ -413,22 +437,18 @@ int main(int argc, char **argv)
} }
break; break;
case MODE_EXE: case MODE_EXE:
if (SpecType == SPEC_WIN16) fatal_error( "Cannot build 16-bit exe files\n" );
load_resources();
read_undef_symbols( argv + 1 ); read_undef_symbols( argv + 1 );
BuildSpec32File( output_file ); BuildSpec32File( output_file );
break; break;
case MODE_DEF: case MODE_DEF:
if (argv[1]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[1] ); if (argv[1]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[1] );
switch (ParseTopLevel( input_file, 1 )) if (SpecType == SPEC_WIN16) fatal_error( "Cannot yet build .def file for 16-bit dlls\n" );
{ load_resources();
case SPEC_WIN16: ParseTopLevel( input_file );
fatal_error( "Cannot yet build .def file for 16-bit dlls\n" );
break;
case SPEC_WIN32:
BuildDef32File( output_file ); BuildDef32File( output_file );
break; break;
default: assert(0);
}
break;
case MODE_DEBUG: case MODE_DEBUG:
BuildDebugFile( output_file, current_src_dir, argv + 1 ); BuildDebugFile( output_file, current_src_dir, argv + 1 );
break; break;

View File

@ -36,8 +36,6 @@
int current_line = 0; int current_line = 0;
static SPEC_TYPE SpecType = SPEC_WIN32;
static char ParseBuffer[512]; static char ParseBuffer[512];
static char TokenBuffer[512]; static char TokenBuffer[512];
static char *ParseNext = ParseBuffer; static char *ParseNext = ParseBuffer;
@ -494,26 +492,16 @@ static void sort_names(void)
* *
* Parse a spec file. * Parse a spec file.
*/ */
SPEC_TYPE ParseTopLevel( FILE *file, int def_only ) void ParseTopLevel( FILE *file )
{ {
const char *token; const char *token;
input_file = file; input_file = file;
current_line = 0; current_line = 0;
if (owner_name[0]) SpecType = SPEC_WIN16;
while ((token = GetToken(1)) != NULL) while ((token = GetToken(1)) != NULL)
{ {
if (strcmp(token, "rsrc") == 0) if (strcmp(token, "ignore") == 0)
{
if (!def_only)
{
if (SpecType != SPEC_WIN16) load_res32_file( GetToken(0) );
else load_res16_file( GetToken(0) );
}
else GetToken(0); /* skip it */
}
else if (strcmp(token, "ignore") == 0)
{ {
if (SpecType != SPEC_WIN32) if (SpecType != SPEC_WIN32)
fatal_error( "'ignore' only supported for Win32 spec files\n" ); fatal_error( "'ignore' only supported for Win32 spec files\n" );
@ -533,12 +521,8 @@ SPEC_TYPE ParseTopLevel( FILE *file, int def_only )
fatal_error( "Expected ordinal declaration\n" ); fatal_error( "Expected ordinal declaration\n" );
} }
if (SpecType == SPEC_WIN16 && !owner_name[0])
fatal_error( "'owner' not specified for Win16 dll\n" );
current_line = 0; /* no longer parsing the input file */ current_line = 0; /* no longer parsing the input file */
sort_names(); sort_names();
return SpecType;
} }

View File

@ -167,8 +167,6 @@ Turn on warnings.
A spec file should contain a number of optional directives, and then a A spec file should contain a number of optional directives, and then a
list of ordinal declarations. The general syntax is the following: list of ordinal declarations. The general syntax is the following:
.PP .PP
.RB [ rsrc\ \fIresfile\fR]
.br
.RB [ ignore\ (\ [ \fIsymbols...\fR ]\ )\ ] .RB [ ignore\ (\ [ \fIsymbols...\fR ]\ )\ ]
.br .br
.BI #\ comments .BI #\ comments
@ -191,9 +189,6 @@ list of ordinal declarations. The general syntax is the following:
.IB ordinal\ forward .IB ordinal\ forward
.RI [ flags ]\ exportname\ forwardname .RI [ flags ]\ exportname\ forwardname
.SS "Optional directives" .SS "Optional directives"
.B rsrc
specifies the path of the compiled resource file.
.PP
.B ignore .B ignore
specifies a list of symbols that should be ignored when specifies a list of symbols that should be ignored when
resolving undefined symbols against the imported libraries. resolving undefined symbols against the imported libraries.