From ac1bd4d15c536163f20227f88c95cce0ce99544c Mon Sep 17 00:00:00 2001 From: "Dimitrie O. Paun" Date: Tue, 9 Mar 2004 04:20:58 +0000 Subject: [PATCH] Add a wine specific mode. If is activated if the -B prefix ends with /tools/winebuild. If you happen to have such a prefix, but you don't want this behaviour, simply add a trailing '/'. In this special mode, no default Win32 DLLs are linked in, we don't force the short wchar_t, and the standard dirs are not searched. --- tools/winegcc/winegcc.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index b99871b878a..01234170222 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -160,6 +160,7 @@ struct options int noshortwchar; int gui_app; int compile_only; + int wine_mode; const char* prefix; const char* output_name; strarray* lib_dirs; @@ -241,7 +242,7 @@ static void compile(struct options* opts) if (opts->processor != proc_cpp) { #ifdef CC_FLAG_SHORT_WCHAR - if (!opts->noshortwchar) + if (!opts->wine_mode && !opts->noshortwchar) { strarray_add(comp_args, CC_FLAG_SHORT_WCHAR); strarray_add(comp_args, "-DWINE_UNICODE_NATIVE"); @@ -249,7 +250,7 @@ static void compile(struct options* opts) #endif strarray_addall(comp_args, strarray_fromstring(DLLFLAGS, " ")); } - if (!opts->nostdinc) + if (!opts->wine_mode && !opts->nostdinc) { if (opts->use_msvcrt) { @@ -383,8 +384,11 @@ static void build(struct options* opts) /* prepare the linking path */ lib_dirs = strarray_dup(opts->lib_dirs); - for ( j = 0; j < sizeof(stdlibpath)/sizeof(stdlibpath[0]);j++ ) - strarray_add(lib_dirs, stdlibpath[j]); + if (!opts->wine_mode) + { + for ( j = 0; j < sizeof(stdlibpath)/sizeof(stdlibpath[0]);j++ ) + strarray_add(lib_dirs, stdlibpath[j]); + } /* mark the files with their appropriate type */ files = strarray_alloc(); @@ -441,7 +445,7 @@ static void build(struct options* opts) if (opts->use_msvcrt) strarray_add(files, "-dmsvcrt"); } - if (!opts->nodefaultlibs) + if (!opts->wine_mode && !opts->nodefaultlibs) { if (opts->gui_app) { @@ -735,6 +739,7 @@ int main(int argc, char **argv) { case 'B': str = strdup(option_arg); + if (strendswith(str, "/tools/winebuild")) opts.wine_mode = 1; if (strendswith(str, "/")) str[strlen(str) - 1] = 0; opts.prefix = str; break; -- 2.11.4.GIT