Alexandre Julliard : makefiles: Only cross-compile the static libraries that are actually used.
Alexandre Julliard
julliard at winehq.org
Fri May 3 15:46:16 CDT 2019
Module: wine
Branch: master
Commit: c685acba64f57a35fb2d04630ee0bbd6d0aa01bd
URL: https://source.winehq.org/git/wine.git/?a=commit;h=c685acba64f57a35fb2d04630ee0bbd6d0aa01bd
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri May 3 11:18:00 2019 +0200
makefiles: Only cross-compile the static libraries that are actually used.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
tools/makedep.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/tools/makedep.c b/tools/makedep.c
index d9d4d1a..97017d7 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -2086,8 +2086,14 @@ static struct makefile *get_parent_makefile( struct makefile *make )
static int needs_cross_lib( const struct makefile *make )
{
if (!crosstarget) return 0;
- if (!make->importlib) return 0;
- return strarray_exists( &cross_import_libs, make->importlib );
+ if (make->importlib) return strarray_exists( &cross_import_libs, make->importlib );
+ if (make->staticlib)
+ {
+ const char *name = replace_extension( make->staticlib, ".a", "" );
+ if (!strncmp( name, "lib", 3 )) name += 3;
+ return strarray_exists( &cross_import_libs, name );
+ }
+ return 0;
}
@@ -2974,7 +2980,7 @@ static void output_source_default( struct makefile *make, struct incl_file *sour
(make->is_cross ||
((source->file->flags & FLAG_C_IMPLIB) &&
(needs_cross_lib( make ) || needs_delay_lib( make ))) ||
- (make->module && make->staticlib)));
+ (make->staticlib && needs_cross_lib( make ))));
int need_obj = (!need_cross ||
(source->file->flags & FLAG_C_IMPLIB) ||
(make->module && make->staticlib));
@@ -3289,7 +3295,7 @@ static void output_static_lib( struct makefile *make )
output( "\n\t%s $@\n", ranlib );
add_install_rule( make, make->staticlib, make->staticlib,
strmake( "d$(dlldir)/%s", make->staticlib ));
- if (crosstarget && make->module)
+ if (needs_cross_lib( make ))
{
char *name = replace_extension( make->staticlib, ".a", ".cross.a" );
More information about the wine-cvs
mailing list