makedep: Use -Wl,-delayload option for winebuild delayimports.

Also fixes winebuild to correctly handle module extensions.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-11-11 19:59:13 +01:00 committed by Alexandre Julliard
parent 9180dec0b7
commit 4346d68e1b
3 changed files with 19 additions and 5 deletions

View File

@ -2,7 +2,7 @@ EXTRADEFS = -D_SETUPAPI_
MODULE = setupapi.dll
IMPORTLIB = setupapi
IMPORTS = uuid version advapi32 rpcrt4
DELAYIMPORTS = shell32 wintrust ole32 winspool comdlg32 user32
DELAYIMPORTS = shell32 wintrust ole32 winspool.drv comdlg32 user32
EXTRADLLFLAGS = -mno-cygwin

View File

@ -574,6 +574,19 @@ static char *get_extension( char *filename )
}
/*******************************************************************
* get_base_name
*/
static const char *get_base_name( const char *name )
{
char *base;
if (!strchr( name, '.' )) return name;
base = strdup( name );
*strrchr( base, '.' ) = 0;
return base;
}
/*******************************************************************
* replace_extension
*/
@ -2172,7 +2185,7 @@ static struct strarray add_import_libs( const struct makefile *make, struct stra
for (i = 0; i < imports.count; i++)
{
const char *name = imports.str[i];
const char *name = get_base_name( imports.str[i] );
const char *lib = NULL;
for (j = 0; j < top_makefile->subdirs.count; j++)
@ -3211,7 +3224,8 @@ static void output_module( struct makefile *make )
if (*dll_ext)
{
for (i = 0; i < make->delayimports.count; i++)
strarray_add( &all_libs, strmake( "-Wb,-d%s", make->delayimports.str[i] ));
strarray_add( &all_libs, strmake( "-Wl,-delayload,%s%s", make->delayimports.str[i],
strchr( make->delayimports.str[i], '.' ) ? "" : ".dll" ));
strarray_add( &make->all_targets, strmake( "%s%s", make->module, dll_ext ));
strarray_add( &make->all_targets, strmake( "%s.fake", make->module ));
add_install_rule( make, make->module, strmake( "%s%s", make->module, dll_ext ),
@ -4235,7 +4249,7 @@ static void load_sources( struct makefile *make )
if (!*dll_ext || make->is_cross)
for (i = 0; i < make->delayimports.count; i++)
strarray_add_uniq( &delay_import_libs, make->delayimports.str[i] );
strarray_add_uniq( &delay_import_libs, get_base_name( make->delayimports.str[i] ));
}

View File

@ -371,7 +371,7 @@ void add_import_dll( const char *name, const char *filename )
imp->dll_name = spec->file_name ? spec->file_name : dll_name;
imp->c_name = make_c_identifier( imp->dll_name );
if (is_delayed_import( dll_name ))
if (is_delayed_import( imp->dll_name ))
list_add_tail( &dll_delayed, &imp->entry );
else
list_add_tail( &dll_imports, &imp->entry );