From ab871dc4d8e4ae0aa897142305800803a6623b16 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 10 Sep 2019 12:14:30 +0200 Subject: [PATCH] winegcc: Support the --target option like winebuild does. Signed-off-by: Alexandre Julliard --- tools/winegcc/winegcc.c | 7 +++++++ tools/winegcc/winegcc.man.in | 3 +++ 2 files changed, 10 insertions(+) diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index db46cf6d5d1..9d5828e6123 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -1429,6 +1429,7 @@ int main(int argc, char **argv) case '-': next_is_arg = (strcmp("--param", argv[i]) == 0 || strcmp("--sysroot", argv[i]) == 0 || + strcmp("--target", argv[i]) == 0 || strcmp("--lib-suffix", argv[i]) == 0); break; } @@ -1656,6 +1657,12 @@ int main(int argc, char **argv) else opts.sysroot = argv[i + 1]; if (opts.wine_objdir) raw_compiler_arg = raw_linker_arg = 0; } + else if (!strncmp("--target", argv[i], 8)) + { + if (argv[i][8] == '=') parse_target_option( &opts, argv[i] + 9 ); + else parse_target_option( &opts, argv[i + 1] ); + raw_compiler_arg = raw_linker_arg = 0; + } else if (!strncmp("--lib-suffix", argv[i], 12) && opts.wine_objdir) { if (argv[i][12] == '=') opts.lib_suffix = argv[i] + 13; diff --git a/tools/winegcc/winegcc.man.in b/tools/winegcc/winegcc.man.in index 5bbb2fd58f7..3fcd6f95f31 100644 --- a/tools/winegcc/winegcc.man.in +++ b/tools/winegcc/winegcc.man.in @@ -35,6 +35,9 @@ enters a special mode for building Wine itself. Developers should avoid prefixes ending with the magic suffix, or if that is not possible, simply express it differently, such as '/tools/winebuild/', to avoid the special behaviour. +.IP "\fB-b,--target \fItarget\fR" +Specify the target architecture triplet for cross-compiling. winegcc +will then invoke \fItarget\fR-gcc instead of gcc. .IP \fB-fno-short-wchar\fR Override the underlying type for wchar_t to be the default for the target, instead of using short unsigned int, which is the default