From: Rémi Bernon rbernon@codeweavers.com
--- tools/makedep.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/makedep.c b/tools/makedep.c index d3064ea4ff1..97d0f3d587d 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -3066,13 +3066,14 @@ static void output_source_spec( struct makefile *make, struct incl_file *source, struct strarray dll_flags = empty_strarray; struct strarray default_imports = empty_strarray; struct strarray all_libs, dep_libs; - const char *dll_name, *obj_name, *res_name, *output_rsrc, *output_file, *debug_file; + const char *dll_name, *obj_name, *res_name, *output_rsrc, *output_file, *debug_file, *ext = ".dll"; unsigned int arch;
if (!imports.count) imports = make->imports; strarray_addall( &dll_flags, make->extradllflags ); strarray_addall( &dll_flags, get_expanded_file_local_var( make, obj, "EXTRADLLFLAGS" )); if (!strarray_exists( &dll_flags, "-nodefaultlibs" )) default_imports = get_default_imports( make, imports ); + if (strarray_exists( &dll_flags, "-Wl,--subsystem,console" )) ext = ".exe";
for (arch = 0; arch < archs.count; arch++) { @@ -3081,7 +3082,7 @@ static void output_source_spec( struct makefile *make, struct incl_file *source, strarray_addall( &all_libs, add_import_libs( make, &dep_libs, imports, IMPORT_TYPE_DIRECT, arch ) ); strarray_addall( &all_libs, add_import_libs( make, &dep_libs, default_imports, IMPORT_TYPE_DEFAULT, arch ) ); if (!arch) strarray_addall( &all_libs, libs ); - dll_name = arch_module_name( strmake( "%s.dll", obj ), arch ); + dll_name = arch_module_name( strmake( "%s%s", obj, ext ), arch ); obj_name = obj_dir_path( make, strmake( "%s%s.o", arch_dirs[arch], obj )); output_file = obj_dir_path( make, dll_name ); output_rsrc = strmake( "%s.res", dll_name ); @@ -3095,7 +3096,7 @@ static void output_source_spec( struct makefile *make, struct incl_file *source, output_filename( output_file ); output_filename( tools_path( make, "wrc" )); output( "\n" ); - output( "\t%secho "%s.dll TESTDLL \"%s\"" | %s -u -o $@\n", cmd_prefix( "WRC" ), obj, output_file, + output( "\t%secho "%s%s TESTDLL \"%s\"" | %s -u -o $@\n", cmd_prefix( "WRC" ), obj, ext, output_file, tools_path( make, "wrc" ));
output( "%s:", output_file ); @@ -3110,7 +3111,7 @@ static void output_source_spec( struct makefile *make, struct incl_file *source, output_filename( "-s" ); output_filenames( dll_flags ); if (arch) output_filenames( get_expanded_arch_var_array( make, "EXTRADLLFLAGS", arch )); - output_filename( "-shared" ); + if (!strcmp( ext, ".dll" )) output_filename( "-shared" ); output_filename( source->filename ); output_filename( obj_name ); if (res_name) output_filename( res_name );