Commit 3ccbb018 authored by Alexandre Julliard's avatar Alexandre Julliard

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

entry point.
parent 5cb0fcf1
......@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = uninstaller.exe
APPMODE = -mconsole -Wb,-e,wmain
APPMODE = -mconsole -municode
IMPORTS = shlwapi user32 gdi32 advapi32 kernel32
C_SRCS = \
......
......@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = winepath.exe
APPMODE = -mconsole -Wb,-e,wmain
APPMODE = -mconsole -municode
IMPORTS = kernel32
C_SRCS = winepath.c
......
......@@ -153,6 +153,7 @@ struct options
int nodefaultlibs;
int noshortwchar;
int gui_app;
int unicode_app;
int compile_only;
int wine_mode;
const char* output_name;
......@@ -559,6 +560,11 @@ static void build(struct options* opts)
strarray_add(spec_args, output_name);
strarray_add(spec_args, "--subsystem");
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++ )
......@@ -730,13 +736,13 @@ static int is_directory_arg(const char* arg)
/*
* MinGW Options
* -mno-cygwin -mwindows -mconsole -mthreads
* -mno-cygwin -mwindows -mconsole -mthreads -municode
*/
static int is_mingw_arg(const char* arg)
{
static const char* mingw_switches[] =
{
"-mno-cygwin", "-mwindows", "-mconsole", "-mthreads"
"-mno-cygwin", "-mwindows", "-mconsole", "-mthreads", "-municode"
};
int j;
......@@ -889,6 +895,8 @@ int main(int argc, char **argv)
opts.gui_app = 1;
else if (strcmp("-mconsole", argv[i]) == 0)
opts.gui_app = 0;
else if (strcmp("-municode", argv[i]) == 0)
opts.unicode_app = 1;
break;
case 'n':
if (strcmp("-nostdinc", argv[i]) == 0)
......
......@@ -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
libc. Sharing the syntax with MinGW makes it very easy to write
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
This option adds -lgdi32, -lcomdlg32, and -lshell32 to the list of
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
any default libraries used by the backend compiler. The -mwindows
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
Pass option as an option to winebuild. If option contains
commas, it is split into multiple options at the commas.
......
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