Commit 2de0c163 authored by Alexandre Julliard's avatar Alexandre Julliard

winegcc: Add support for building fake modules.

parent f7f50d12
...@@ -556,6 +556,7 @@ static void build(struct options* opts) ...@@ -556,6 +556,7 @@ static void build(struct options* opts)
const char *spec_o_name; const char *spec_o_name;
const char *output_name, *spec_file, *lang; const char *output_name, *spec_file, *lang;
int generate_app_loader = 1; int generate_app_loader = 1;
int fake_module = 0;
unsigned int j; unsigned int j;
/* NOTE: for the files array we'll use the following convention: /* NOTE: for the files array we'll use the following convention:
...@@ -581,6 +582,8 @@ static void build(struct options* opts) ...@@ -581,6 +582,8 @@ static void build(struct options* opts)
if (opts->shared || strendswith(output_file, ".so")) if (opts->shared || strendswith(output_file, ".so"))
generate_app_loader = 0; generate_app_loader = 0;
if (strendswith(output_file, ".fake")) 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 (strendswith(output_file, ".so")) if (strendswith(output_file, ".so"))
output_file[strlen(output_file) - 3] = 0; output_file[strlen(output_file) - 3] = 0;
...@@ -802,8 +805,17 @@ static void build(struct options* opts) ...@@ -802,8 +805,17 @@ static void build(struct options* opts)
strarray_add(spec_args, strmake("-m%u", 8 * opts->force_pointer_size )); strarray_add(spec_args, strmake("-m%u", 8 * opts->force_pointer_size ));
strarray_addall(spec_args, strarray_fromstring(DLLFLAGS, " ")); strarray_addall(spec_args, strarray_fromstring(DLLFLAGS, " "));
strarray_add(spec_args, opts->shared ? "--dll" : "--exe"); strarray_add(spec_args, opts->shared ? "--dll" : "--exe");
strarray_add(spec_args, "-o"); if (fake_module)
strarray_add(spec_args, spec_o_name); {
strarray_add(spec_args, "--fake-module");
strarray_add(spec_args, "-o");
strarray_add(spec_args, output_file);
}
else
{
strarray_add(spec_args, "-o");
strarray_add(spec_args, spec_o_name);
}
if (spec_file) if (spec_file)
{ {
strarray_add(spec_args, "-E"); strarray_add(spec_args, "-E");
...@@ -850,6 +862,7 @@ static void build(struct options* opts) ...@@ -850,6 +862,7 @@ static void build(struct options* opts)
spawn(opts->prefix, spec_args, 0); spawn(opts->prefix, spec_args, 0);
strarray_free (spec_args); strarray_free (spec_args);
if (fake_module) return; /* nothing else to do */
/* link everything together now */ /* link everything together now */
strarray_addall(link_args, get_translator(opts)); strarray_addall(link_args, get_translator(opts));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment