Alexandre Julliard : winebuild: Add support for generating import libs for 16-bit dlls.
Alexandre Julliard
julliard at winehq.org
Wed Dec 30 10:18:12 CST 2009
Module: wine
Branch: master
Commit: 76ac103b8022a05c14724ac2edc09b3910954d5a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=76ac103b8022a05c14724ac2edc09b3910954d5a
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Dec 30 12:32:17 2009 +0100
winebuild: Add support for generating import libs for 16-bit dlls.
---
tools/winebuild/main.c | 1 -
tools/winebuild/parser.c | 7 +++++++
tools/winebuild/spec16.c | 8 --------
tools/winebuild/spec32.c | 9 +++++++++
4 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c
index ae7904d..3dd4fea 100644
--- a/tools/winebuild/main.c
+++ b/tools/winebuild/main.c
@@ -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 );
diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c
index d08a190..f48471c 100644
--- a/tools/winebuild/parser.c
+++ b/tools/winebuild/parser.c
@@ -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 );
diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c
index abc090d..c06b4a1 100644
--- a/tools/winebuild/spec16.c
+++ b/tools/winebuild/spec16.c
@@ -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 );
diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c
index c2b11af..08703a2 100644
--- a/tools/winebuild/spec32.c
+++ b/tools/winebuild/spec32.c
@@ -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 );
}
More information about the wine-cvs
mailing list