winebuild: Add support for generating import libs for 16-bit dlls.

This commit is contained in:
Alexandre Julliard 2009-12-30 12:32:17 +01:00
parent 9d55475eee
commit 76ac103b80
4 changed files with 16 additions and 9 deletions

View File

@ -657,7 +657,6 @@ int main(int argc, char **argv)
break;
case MODE_DEF:
if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] );
if (spec->type == SPEC_WIN16) fatal_error( "Cannot yet build .def file for 16-bit dlls\n" );
if (!spec_file_name) fatal_error( "missing .spec file\n" );
if (!parse_input_file( spec )) break;
BuildDef32File( spec );

View File

@ -744,6 +744,13 @@ void add_16bit_exports( DLLSPEC *spec32, DLLSPEC *spec16 )
int i;
ORDDEF *odp;
spec32->file_name = xstrdup( spec16->file_name );
if (spec16->characteristics & IMAGE_FILE_DLL)
{
spec32->characteristics = IMAGE_FILE_DLL;
spec32->init_func = xstrdup( "__wine_spec_dll_entry" );
}
/* add an export for the NE module */
odp = add_entry_point( spec32 );

View File

@ -860,14 +860,6 @@ void output_spec16_file( DLLSPEC *spec16 )
{
DLLSPEC *spec32 = alloc_dll_spec();
spec32->file_name = xstrdup( spec16->file_name );
if (spec16->characteristics & IMAGE_FILE_DLL)
{
spec32->characteristics = IMAGE_FILE_DLL;
spec32->init_func = xstrdup( "__wine_spec_dll_entry" );
}
resolve_imports( spec16 );
add_16bit_exports( spec32, spec16 );

View File

@ -768,9 +768,17 @@ void output_fake_module( DLLSPEC *spec )
*/
void BuildDef32File( DLLSPEC *spec )
{
DLLSPEC *spec32 = NULL;
const char *name;
int i, total;
if (spec->type == SPEC_WIN16)
{
spec32 = alloc_dll_spec();
add_16bit_exports( spec32, spec );
spec = spec32;
}
if (spec_file_name)
output( "; File generated automatically from %s; do not edit!\n\n",
spec_file_name );
@ -835,4 +843,5 @@ void BuildDef32File( DLLSPEC *spec )
output( "\n" );
}
if (!total) warning( "%s: Import library doesn't export anything\n", spec->file_name );
if (spec32) free_dll_spec( spec32 );
}