Added a -municode flag to winegcc for applications that have a wmain()

entry point.
This commit is contained in:
Alexandre Julliard 2005-08-25 19:26:59 +00:00
parent 5cb0fcf1e1
commit 3ccbb018a0
4 changed files with 17 additions and 4 deletions

View file

@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = uninstaller.exe MODULE = uninstaller.exe
APPMODE = -mconsole -Wb,-e,wmain APPMODE = -mconsole -municode
IMPORTS = shlwapi user32 gdi32 advapi32 kernel32 IMPORTS = shlwapi user32 gdi32 advapi32 kernel32
C_SRCS = \ C_SRCS = \

View file

@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = winepath.exe MODULE = winepath.exe
APPMODE = -mconsole -Wb,-e,wmain APPMODE = -mconsole -municode
IMPORTS = kernel32 IMPORTS = kernel32
C_SRCS = winepath.c C_SRCS = winepath.c

View file

@ -153,6 +153,7 @@ struct options
int nodefaultlibs; int nodefaultlibs;
int noshortwchar; int noshortwchar;
int gui_app; int gui_app;
int unicode_app;
int compile_only; int compile_only;
int wine_mode; int wine_mode;
const char* output_name; const char* output_name;
@ -559,6 +560,11 @@ static void build(struct options* opts)
strarray_add(spec_args, output_name); strarray_add(spec_args, output_name);
strarray_add(spec_args, "--subsystem"); strarray_add(spec_args, "--subsystem");
strarray_add(spec_args, opts->gui_app ? "windows" : "console"); strarray_add(spec_args, opts->gui_app ? "windows" : "console");
if (opts->unicode_app)
{
strarray_add(spec_args, "--entry");
strarray_add(spec_args, "wmain");
}
} }
for ( j = 0; j < lib_dirs->size; j++ ) for ( j = 0; j < lib_dirs->size; j++ )
@ -730,13 +736,13 @@ static int is_directory_arg(const char* arg)
/* /*
* MinGW Options * MinGW Options
* -mno-cygwin -mwindows -mconsole -mthreads * -mno-cygwin -mwindows -mconsole -mthreads -municode
*/ */
static int is_mingw_arg(const char* arg) static int is_mingw_arg(const char* arg)
{ {
static const char* mingw_switches[] = static const char* mingw_switches[] =
{ {
"-mno-cygwin", "-mwindows", "-mconsole", "-mthreads" "-mno-cygwin", "-mwindows", "-mconsole", "-mthreads", "-municode"
}; };
int j; int j;
@ -889,6 +895,8 @@ int main(int argc, char **argv)
opts.gui_app = 1; opts.gui_app = 1;
else if (strcmp("-mconsole", argv[i]) == 0) else if (strcmp("-mconsole", argv[i]) == 0)
opts.gui_app = 0; opts.gui_app = 0;
else if (strcmp("-municode", argv[i]) == 0)
opts.unicode_app = 1;
break; break;
case 'n': case 'n':
if (strcmp("-nostdinc", argv[i]) == 0) if (strcmp("-nostdinc", argv[i]) == 0)

View file

@ -49,6 +49,9 @@ of MSVCRT. This switch is also used by the MinGW compiler to link
against MSVCRT on Windows, instead of linking against Cygwin's against MSVCRT on Windows, instead of linking against Cygwin's
libc. Sharing the syntax with MinGW makes it very easy to write libc. Sharing the syntax with MinGW makes it very easy to write
Makefiles that work under Wine, MinGW+MSYS, or MinGW+Cygwin. Makefiles that work under Wine, MinGW+MSYS, or MinGW+Cygwin.
.IP \fB-municode\fR
Set the default entry point of the application to be the Unicode
\fBwmain()\fR instead of the standard \fBmain()\fR.
.IP \fB-mwindows\fR .IP \fB-mwindows\fR
This option adds -lgdi32, -lcomdlg32, and -lshell32 to the list of This option adds -lgdi32, -lcomdlg32, and -lshell32 to the list of
default libraries, and passes '--subsystem windows' to winebuild default libraries, and passes '--subsystem windows' to winebuild
@ -58,6 +61,8 @@ Do not use the standard system libraries when linking. These
include at a minimum -lkernel32, -luser32, -ladvapi32, and include at a minimum -lkernel32, -luser32, -ladvapi32, and
any default libraries used by the backend compiler. The -mwindows any default libraries used by the backend compiler. The -mwindows
option augments the list of default libraries as described above. option augments the list of default libraries as described above.
.IP \fB-nostartfiles\fR
Do not add the winecrt0 library when linking.
.IP \fB-Wb,option\fR .IP \fB-Wb,option\fR
Pass option as an option to winebuild. If option contains Pass option as an option to winebuild. If option contains
commas, it is split into multiple options at the commas. commas, it is split into multiple options at the commas.