winegcc: Support an explicit --fake-module option.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d969d02e21
commit
9ac2eecbba
|
@ -179,6 +179,7 @@ struct options
|
||||||
int force_pointer_size;
|
int force_pointer_size;
|
||||||
int large_address_aware;
|
int large_address_aware;
|
||||||
int wine_builtin;
|
int wine_builtin;
|
||||||
|
int fake_module;
|
||||||
int unwind_tables;
|
int unwind_tables;
|
||||||
int strip;
|
int strip;
|
||||||
int pic;
|
int pic;
|
||||||
|
@ -1002,7 +1003,6 @@ static const char *build_spec_obj( struct options *opts, const char *spec_file,
|
||||||
struct strarray spec_args = get_winebuild_args( opts );
|
struct strarray spec_args = get_winebuild_args( opts );
|
||||||
struct strarray tool;
|
struct strarray tool;
|
||||||
const char *spec_o_name, *output_name;
|
const char *spec_o_name, *output_name;
|
||||||
int fake_module = strendswith(output_file, ".fake");
|
|
||||||
|
|
||||||
/* get the filename from the path */
|
/* get the filename from the path */
|
||||||
output_name = get_basename( output_file );
|
output_name = get_basename( output_file );
|
||||||
|
@ -1020,7 +1020,7 @@ static const char *build_spec_obj( struct options *opts, const char *spec_file,
|
||||||
strarray_add(&spec_args, strmake("-m%u", 8 * opts->force_pointer_size ));
|
strarray_add(&spec_args, strmake("-m%u", 8 * opts->force_pointer_size ));
|
||||||
if (opts->pic && !is_pe) strarray_add(&spec_args, "-fPIC");
|
if (opts->pic && !is_pe) strarray_add(&spec_args, "-fPIC");
|
||||||
strarray_add(&spec_args, opts->shared ? "--dll" : "--exe");
|
strarray_add(&spec_args, opts->shared ? "--dll" : "--exe");
|
||||||
if (fake_module)
|
if (opts->fake_module)
|
||||||
{
|
{
|
||||||
strarray_add(&spec_args, "--fake-module");
|
strarray_add(&spec_args, "--fake-module");
|
||||||
strarray_add(&spec_args, "-o");
|
strarray_add(&spec_args, "-o");
|
||||||
|
@ -1101,7 +1101,6 @@ static void build(struct options* opts)
|
||||||
const char *output_name, *spec_file, *lang;
|
const char *output_name, *spec_file, *lang;
|
||||||
int generate_app_loader = 1;
|
int generate_app_loader = 1;
|
||||||
const char *crt_lib = NULL, *entry_point = NULL;
|
const char *crt_lib = NULL, *entry_point = NULL;
|
||||||
int fake_module = 0;
|
|
||||||
int is_pe = is_pe_target( opts );
|
int is_pe = is_pe_target( opts );
|
||||||
unsigned int j;
|
unsigned int j;
|
||||||
|
|
||||||
|
@ -1128,7 +1127,7 @@ static void build(struct options* opts)
|
||||||
if (opts->shared || is_pe || strendswith(output_file, ".so"))
|
if (opts->shared || is_pe || strendswith(output_file, ".so"))
|
||||||
generate_app_loader = 0;
|
generate_app_loader = 0;
|
||||||
|
|
||||||
if (strendswith(output_file, ".fake")) fake_module = 1;
|
if (strendswith(output_file, ".fake")) opts->fake_module = 1;
|
||||||
|
|
||||||
/* normalize the filename a bit: strip .so, ensure it has proper ext */
|
/* normalize the filename a bit: strip .so, ensure it has proper ext */
|
||||||
if (!strchr(get_basename( output_file ), '.'))
|
if (!strchr(get_basename( output_file ), '.'))
|
||||||
|
@ -1250,7 +1249,7 @@ static void build(struct options* opts)
|
||||||
if (spec_file || !opts->unix_lib)
|
if (spec_file || !opts->unix_lib)
|
||||||
spec_o_name = build_spec_obj( opts, spec_file, output_file, files, lib_dirs, entry_point );
|
spec_o_name = build_spec_obj( opts, spec_file, output_file, files, lib_dirs, entry_point );
|
||||||
|
|
||||||
if (fake_module) return; /* nothing else to do */
|
if (opts->fake_module) return; /* nothing else to do */
|
||||||
|
|
||||||
/* link everything together now */
|
/* link everything together now */
|
||||||
link_args = get_link_args( opts, output_name );
|
link_args = get_link_args( opts, output_name );
|
||||||
|
@ -1880,9 +1879,13 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
else if (strncmp("-Wb,", opts.args.str[i], 4) == 0)
|
else if (strncmp("-Wb,", opts.args.str[i], 4) == 0)
|
||||||
{
|
{
|
||||||
strarray_addall( &opts.winebuild_args,
|
unsigned int j;
|
||||||
strarray_fromstring( opts.args.str[i] + 4, ",") );
|
struct strarray Wb = strarray_fromstring(opts.args.str[i] + 4, ",");
|
||||||
/* don't pass it to the compiler, it generates errors */
|
for (j = 0; j < Wb.count; j++)
|
||||||
|
{
|
||||||
|
if (!strcmp(Wb.str[j], "--fake-module")) opts.fake_module = 1;
|
||||||
|
else strarray_add( &opts.winebuild_args, Wb.str[j] );
|
||||||
|
}
|
||||||
raw_compiler_arg = raw_linker_arg = 0;
|
raw_compiler_arg = raw_linker_arg = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1958,7 +1961,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
if (!opts.wine_objdir && is_pe_target( &opts )) opts.use_msvcrt = 1;
|
if (!opts.wine_objdir && is_pe_target( &opts )) opts.use_msvcrt = 1;
|
||||||
|
|
||||||
if (opts.files.count == 0) forward(&opts);
|
if (opts.files.count == 0 && !opts.fake_module) forward(&opts);
|
||||||
else if (linking) build(&opts);
|
else if (linking) build(&opts);
|
||||||
else compile(&opts, lang);
|
else compile(&opts, lang);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue