Jacek Caban : winegcc: Make mingw a separated platform from msvc.

Alexandre Julliard julliard at winehq.org
Mon May 4 15:49:17 CDT 2020


Module: wine
Branch: master
Commit: 2dee9b98747cbbfe05641e7056d8cf4f908bdad8
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=2dee9b98747cbbfe05641e7056d8cf4f908bdad8

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon May  4 15:20:26 2020 +0200

winegcc: Make mingw a separated platform from msvc.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/winegcc/utils.c   |  2 +-
 tools/winegcc/utils.h   |  1 +
 tools/winegcc/winegcc.c | 24 +++++++++++++-----------
 3 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/tools/winegcc/utils.c b/tools/winegcc/utils.c
index cc5d67977f..0fe9b04b00 100644
--- a/tools/winegcc/utils.c
+++ b/tools/winegcc/utils.c
@@ -273,7 +273,7 @@ static char* try_lib_path(const char* dir, const char* pre,
 static file_type guess_lib_type(enum target_platform platform, const char* dir,
                                 const char* library, const char *suffix, char** file)
 {
-    if (platform != PLATFORM_WINDOWS && platform != PLATFORM_CYGWIN)
+    if (platform != PLATFORM_WINDOWS && platform != PLATFORM_MINGW && platform != PLATFORM_CYGWIN)
     {
         /* Unix shared object */
         if ((*file = try_lib_path(dir, "lib", library, ".so", file_so)))
diff --git a/tools/winegcc/utils.h b/tools/winegcc/utils.h
index cb4778fa09..9c70011a90 100644
--- a/tools/winegcc/utils.h
+++ b/tools/winegcc/utils.h
@@ -49,6 +49,7 @@ enum target_platform
     PLATFORM_ANDROID,
     PLATFORM_SOLARIS,
     PLATFORM_WINDOWS,
+    PLATFORM_MINGW,
     PLATFORM_CYGWIN
 };
 
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index 95797e6b63..2be8b508fb 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -181,14 +181,15 @@ static const struct
     enum target_platform platform;
 } platform_names[] =
 {
-    { "macos",   PLATFORM_APPLE },
-    { "darwin",  PLATFORM_APPLE },
-    { "android", PLATFORM_ANDROID },
-    { "solaris", PLATFORM_SOLARIS },
-    { "cygwin",  PLATFORM_CYGWIN },
-    { "mingw32", PLATFORM_WINDOWS },
-    { "windows", PLATFORM_WINDOWS },
-    { "winnt",   PLATFORM_WINDOWS }
+    { "macos",       PLATFORM_APPLE },
+    { "darwin",      PLATFORM_APPLE },
+    { "android",     PLATFORM_ANDROID },
+    { "solaris",     PLATFORM_SOLARIS },
+    { "cygwin",      PLATFORM_CYGWIN },
+    { "mingw32",     PLATFORM_MINGW },
+    { "windows-gnu", PLATFORM_MINGW },
+    { "windows",     PLATFORM_WINDOWS },
+    { "winnt",       PLATFORM_MINGW }
 };
 
 struct options
@@ -258,7 +259,7 @@ static enum target_platform build_platform = PLATFORM_SOLARIS;
 #elif defined(__CYGWIN__)
 static enum target_platform build_platform = PLATFORM_CYGWIN;
 #elif defined(_WIN32)
-static enum target_platform build_platform = PLATFORM_WINDOWS;
+static enum target_platform build_platform = PLATFORM_MINGW;
 #else
 static enum target_platform build_platform = PLATFORM_UNSPECIFIED;
 #endif
@@ -487,6 +488,7 @@ static strarray *get_link_args( struct options *opts, const char *output_name )
         break;
 
     case PLATFORM_WINDOWS:
+    case PLATFORM_MINGW:
     case PLATFORM_CYGWIN:
         if (opts->shared || opts->win16_app)
         {
@@ -729,7 +731,7 @@ static void compile(struct options* opts, const char* lang)
             break;
     }
 
-    if (opts->target_platform == PLATFORM_WINDOWS || opts->target_platform == PLATFORM_CYGWIN)
+    if (opts->target_platform == PLATFORM_WINDOWS || opts->target_platform == PLATFORM_CYGWIN || opts->target_platform == PLATFORM_MINGW)
         goto no_compat_defines;
 
     if (opts->processor != proc_cpp)
@@ -1043,7 +1045,7 @@ static void build(struct options* opts)
     int generate_app_loader = 1;
     const char *crt_lib = NULL, *entry_point = NULL;
     int fake_module = 0;
-    int is_pe = (opts->target_platform == PLATFORM_WINDOWS || opts->target_platform == PLATFORM_CYGWIN);
+    int is_pe = (opts->target_platform == PLATFORM_WINDOWS || opts->target_platform == PLATFORM_CYGWIN || opts->target_platform == PLATFORM_MINGW);
     unsigned int j;
 
     /* NOTE: for the files array we'll use the following convention:




More information about the wine-cvs mailing list