From 96376059efb3e54e661da7f6c2d209e57f96175d Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 23 Feb 2016 20:21:47 +0900 Subject: [PATCH] makefiles: Generate dependencies for default import libraries. Signed-off-by: Alexandre Julliard --- tools/makedep.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/makedep.c b/tools/makedep.c index 8ef8f16b9a1..e1897bc191e 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -1987,6 +1987,23 @@ static struct strarray add_import_libs( const struct makefile *make, struct stra } +/******************************************************************* + * get_default_imports + */ +static struct strarray get_default_imports( const struct makefile *make ) +{ + struct strarray ret = empty_strarray; + + if (strarray_exists( &make->extradllflags, "-nodefaultlibs" )) return ret; + if (strarray_exists( &make->appmode, "-mno-cygwin" )) strarray_add( &ret, "msvcrt" ); + if (make->is_win16) strarray_add( &ret, "kernel" ); + strarray_add( &ret, "kernel32" ); + strarray_add( &ret, "ntdll" ); + strarray_add( &ret, "winecrt0" ); + return ret; +} + + /******************************************************************* * add_install_rule */ @@ -2527,6 +2544,7 @@ static struct strarray output_sources( const struct makefile *make ) spec_file = src_dir_path( make, replace_extension( make->module, ".dll", ".spec" )); strarray_addall( &all_libs, add_import_libs( make, &dep_libs, make->delayimports, 0 )); strarray_addall( &all_libs, add_import_libs( make, &dep_libs, make->imports, 0 )); + add_import_libs( make, &dep_libs, get_default_imports( make ), 0 ); /* dependencies only */ for (i = 0; i < make->delayimports.count; i++) strarray_add( &all_libs, strmake( "-Wb,-d%s", make->delayimports.str[i] )); strarray_add( &all_libs, "-lwine" ); @@ -2758,6 +2776,7 @@ static struct strarray output_sources( const struct makefile *make ) struct strarray dep_libs = empty_strarray; struct strarray all_libs = add_import_libs( make, &dep_libs, make->imports, 0 ); + add_import_libs( make, &dep_libs, get_default_imports( make ), 0 ); /* dependencies only */ strarray_addall( &all_libs, libs ); strarray_add( &all_targets, strmake( "%s%s", testmodule, dll_ext )); strarray_add( &clean_files, strmake( "%s%s", stripped, dll_ext )); @@ -2805,6 +2824,7 @@ static struct strarray output_sources( const struct makefile *make ) dep_libs = empty_strarray; all_libs = add_import_libs( make, &dep_libs, make->imports, 1 ); + add_import_libs( make, &dep_libs, get_default_imports( make ), 1 ); /* dependencies only */ strarray_addall( &all_libs, libs ); strarray_add( &clean_files, crosstest ); output( "%s: %s\n", obj_dir_path( make, "crosstest" ), obj_dir_path( make, crosstest ));