winegcc: better MinGW compatibility

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Better MinGW compatibility.

ChangeLog
    Link in shell32 only in gui mode.
    Add all the standard defines that MinGW provides
    (with the exception of __MINGW__, that's MinGW prerogative).
    Do not pass along linker options when only compiling.

Index: tools/winegcc.c
===================================================================
RCS file: /var/cvs/wine/tools/winegcc.c,v
retrieving revision 1.10
diff -u -r1.10 winegcc.c
--- tools/winegcc.c	18 Feb 2003 23:23:10 -0000	1.10
+++ tools/winegcc.c	19 Feb 2003 07:07:23 -0000
@@ -266,8 +266,8 @@
 	}
 	if (use_stdlib && use_msvcrt) gcc_argv[i++] = "-lmsvcrt";
 	if (gui_app) gcc_argv[i++] = "-lcomdlg32";
-	if (gui_app) gcc_argv[i++] = "-lshell32";
 	gcc_argv[i++] = "-ladvapi32";
+	gcc_argv[i++] = "-lshell32";
     }
     else
     {
@@ -277,11 +277,30 @@
 	gcc_argv[i++] = "-fPIC";
 	if (use_stdinc)
 	{
-	    if (use_msvcrt) gcc_argv[i++] = "-I" INCLUDEDIR "/msvcrt";
+	    if (use_msvcrt)
+	    {
+		gcc_argv[i++] = "-I" INCLUDEDIR "/msvcrt";
+	    	gcc_argv[i++] = "-D__MSVCRT__";
+	    }
 	    gcc_argv[i++] = "-I" INCLUDEDIR "/windows";
 	}
-	gcc_argv[i++] = "-D__WINE__";
+	gcc_argv[i++] = "-DWIN32";
+	gcc_argv[i++] = "-D_WIN32";
+	gcc_argv[i++] = "-D__WIN32";
 	gcc_argv[i++] = "-D__WIN32__";
+	gcc_argv[i++] = "-D__WINNT";
+	gcc_argv[i++] = "-D__WINNT__";
+
+	gcc_argv[i++] = "-D__stdcall=__attribute__((__stdcall__))";
+	gcc_argv[i++] = "-D__cdecl=__attribute__((__cdecl__))";
+	gcc_argv[i++] = "-D__fastcall=__attribute__((__fastcall__))";
+	gcc_argv[i++] = "-D_stdcall=__attribute__((__stdcall__))";
+	gcc_argv[i++] = "-D_cdecl=__attribute__((__cdecl__))";
+	gcc_argv[i++] = "-D_fastcall=__attribute__((__fastcall__))";
+	gcc_argv[i++] = "-D__declspec(x)=__attribute__((x))";
+    
+	/* Wine specific defines */
+	gcc_argv[i++] = "-D__WINE__";
 	gcc_argv[i++] = "-DWINE_UNICODE_NATIVE";
 	gcc_argv[i++] = "-D__int8=char";
 	gcc_argv[i++] = "-D__int16=short";
@@ -294,6 +313,8 @@
 	    	; /* ignore this option */
 	    else if (strcmp("-mwindows", argv[j]) == 0)
 	    	; /* ignore this option */
+	    else if (strncmp("-Wl,", argv[j], 4) == 0)
+		; /* do not pass linking options to compiler */
 	    else if (strcmp("-s", argv[j]) == 0)
 	    	; /* ignore this option */
             else


-- 
Dimi.



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux