winegcc: add wine-specific mode

Dimitrie O. Paun dimi at intelliware.ca
Mon Mar 8 13:16:48 CST 2004


ChangeLog
    Dimitrie O. Paun <dpaun at rogers.com>
    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.2	2004-03-08 13:58:12.000000000 -0500
+++ tools/winegcc/winegcc.c	2004-03-08 14:05:23.000000000 -0500
@@ -160,6 +160,7 @@
     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 @@
     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 @@
 #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 @@
 
     /* 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 @@
         if (opts->use_msvcrt) strarray_add(files, "-dmsvcrt");
     }
 
-    if (!opts->nodefaultlibs) 
+    if (!opts->wine_mode && !opts->nodefaultlibs) 
     {
         if (opts->gui_app) 
 	{
@@ -734,6 +738,7 @@
 	    {
 		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;

-- 
Dimi.




More information about the wine-patches mailing list