Module: wine Branch: master Commit: 2de0c16363c61504082bbabdcdddeaa99ebf806f URL: http://source.winehq.org/git/wine.git/?a=commit;h=2de0c16363c61504082bbabdcd...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Aug 18 11:26:43 2009 +0200
winegcc: Add support for building fake modules.
---
tools/winegcc/winegcc.c | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index b337630..56d9c5f 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -556,6 +556,7 @@ static void build(struct options* opts) const char *spec_o_name; const char *output_name, *spec_file, *lang; int generate_app_loader = 1; + int fake_module = 0; unsigned int j;
/* NOTE: for the files array we'll use the following convention: @@ -581,6 +582,8 @@ static void build(struct options* opts) if (opts->shared || strendswith(output_file, ".so")) generate_app_loader = 0;
+ if (strendswith(output_file, ".fake")) fake_module = 1; + /* normalize the filename a bit: strip .so, ensure it has proper ext */ if (strendswith(output_file, ".so")) output_file[strlen(output_file) - 3] = 0; @@ -802,8 +805,17 @@ static void build(struct options* opts) strarray_add(spec_args, strmake("-m%u", 8 * opts->force_pointer_size )); strarray_addall(spec_args, strarray_fromstring(DLLFLAGS, " ")); strarray_add(spec_args, opts->shared ? "--dll" : "--exe"); - strarray_add(spec_args, "-o"); - strarray_add(spec_args, spec_o_name); + if (fake_module) + { + 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) { strarray_add(spec_args, "-E"); @@ -850,6 +862,7 @@ static void build(struct options* opts)
spawn(opts->prefix, spec_args, 0); strarray_free (spec_args); + if (fake_module) return; /* nothing else to do */
/* link everything together now */ strarray_addall(link_args, get_translator(opts));