makefiles: Don't add a default crt lib for msvcrt dlls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
32eae49275
commit
27b20c1db5
|
@ -2276,7 +2276,7 @@ static struct strarray get_default_imports( const struct makefile *make )
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
* add_crt_import
|
* add_crt_import
|
||||||
*/
|
*/
|
||||||
static const char *add_crt_import( const struct makefile *make, struct strarray *imports )
|
static void add_crt_import( const struct makefile *make, struct strarray *imports, struct strarray *defs )
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
const char *crt_dll = NULL;
|
const char *crt_dll = NULL;
|
||||||
|
@ -2288,11 +2288,29 @@ static const char *add_crt_import( const struct makefile *make, struct strarray
|
||||||
crt_dll = imports->str[i];
|
crt_dll = imports->str[i];
|
||||||
}
|
}
|
||||||
if (!crt_dll && !strarray_exists( &make->extradllflags, "-nodefaultlibs" ))
|
if (!crt_dll && !strarray_exists( &make->extradllflags, "-nodefaultlibs" ))
|
||||||
|
{
|
||||||
|
if (make->module &&
|
||||||
|
(!strncmp( make->module, "msvcr", 5 ) ||
|
||||||
|
!strncmp( make->module, "ucrt", 4 ) ||
|
||||||
|
!strcmp( make->module, "crtdll.dll" )))
|
||||||
|
{
|
||||||
|
crt_dll = make->module;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
crt_dll = !make->testdll && !make->staticlib ? "ucrtbase" : "msvcrt";
|
crt_dll = !make->testdll && !make->staticlib ? "ucrtbase" : "msvcrt";
|
||||||
strarray_add( imports, crt_dll );
|
strarray_add( imports, crt_dll );
|
||||||
}
|
}
|
||||||
return crt_dll;
|
}
|
||||||
|
|
||||||
|
if (!defs) return;
|
||||||
|
if (crt_dll && !strncmp( crt_dll, "ucrt", 4 )) strarray_add( defs, "-D_UCRT" );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unsigned int version = 0;
|
||||||
|
if (crt_dll) sscanf( crt_dll, "msvcr%u", &version );
|
||||||
|
strarray_add( defs, strmake( "-D_MSVCR_VER=%u", version ));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3034,7 +3052,7 @@ static void output_source_spec( struct makefile *make, struct incl_file *source,
|
||||||
const char *debug_file;
|
const char *debug_file;
|
||||||
|
|
||||||
if (!imports.count) imports = make->imports;
|
if (!imports.count) imports = make->imports;
|
||||||
else if (make->use_msvcrt) add_crt_import( make, &imports );
|
else if (make->use_msvcrt) add_crt_import( make, &imports, NULL );
|
||||||
|
|
||||||
if (!dll_flags.count) dll_flags = make->extradllflags;
|
if (!dll_flags.count) dll_flags = make->extradllflags;
|
||||||
all_libs = add_import_libs( make, &dep_libs, imports, 0, 0 );
|
all_libs = add_import_libs( make, &dep_libs, imports, 0, 0 );
|
||||||
|
@ -4200,19 +4218,7 @@ static void load_sources( struct makefile *make )
|
||||||
make->use_msvcrt = 1;
|
make->use_msvcrt = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (make->use_msvcrt)
|
if (make->use_msvcrt) add_crt_import( make, &make->imports, &make->define_args );
|
||||||
{
|
|
||||||
const char *crt_dll = add_crt_import( make, &make->imports );
|
|
||||||
|
|
||||||
if (crt_dll && !strncmp( crt_dll, "ucrt", 4 )) strarray_add( &make->define_args, "-D_UCRT" );
|
|
||||||
else
|
|
||||||
{
|
|
||||||
unsigned int msvcrt_version = 0;
|
|
||||||
|
|
||||||
if (crt_dll) sscanf( crt_dll, "msvcr%u", &msvcrt_version );
|
|
||||||
strarray_add( &make->define_args, strmake( "-D_MSVCR_VER=%u", msvcrt_version ));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LIST_FOR_EACH_ENTRY( file, &make->includes, struct incl_file, entry ) parse_file( make, file, 0 );
|
LIST_FOR_EACH_ENTRY( file, &make->includes, struct incl_file, entry ) parse_file( make, file, 0 );
|
||||||
LIST_FOR_EACH_ENTRY( file, &make->sources, struct incl_file, entry ) get_dependencies( file, file );
|
LIST_FOR_EACH_ENTRY( file, &make->sources, struct incl_file, entry ) get_dependencies( file, file );
|
||||||
|
|
|
@ -1224,7 +1224,13 @@ static void build(struct options* opts)
|
||||||
add_library(opts, lib_dirs, files, "winecrt0");
|
add_library(opts, lib_dirs, files, "winecrt0");
|
||||||
if (opts->use_msvcrt)
|
if (opts->use_msvcrt)
|
||||||
{
|
{
|
||||||
if (!crt_lib) add_library(opts, lib_dirs, files, "ucrtbase");
|
if (!crt_lib)
|
||||||
|
{
|
||||||
|
if (strncmp( output_name, "msvcr", 5 ) &&
|
||||||
|
strncmp( output_name, "ucrt", 4 ) &&
|
||||||
|
strcmp( output_name, "crtdll.dll" ))
|
||||||
|
add_library(opts, lib_dirs, files, "ucrtbase");
|
||||||
|
}
|
||||||
else strarray_add(files, strmake("-a%s", crt_lib));
|
else strarray_add(files, strmake("-a%s", crt_lib));
|
||||||
}
|
}
|
||||||
if (opts->win16_app) add_library(opts, lib_dirs, files, "kernel");
|
if (opts->win16_app) add_library(opts, lib_dirs, files, "kernel");
|
||||||
|
|
Loading…
Reference in New Issue