winegcc: fix compilation

Dimitrie O. Paun dimi at intelliware.ca
Thu Mar 11 14:37:13 CST 2004


ChangeLog
    Dimitrie O. Paun <dpaun at rogers.com>
    Build all file consistently, without shortcuts.
    Force DLLFLAGS on all compilations.
    Do not pass winebuild escaped options to the compiler.


Index: tools/winegcc/winegcc.c
===================================================================
RCS file: /var/cvs/wine/tools/winegcc/winegcc.c,v
retrieving revision 1.19
diff -u -r1.19 winegcc.c
--- tools/winegcc/winegcc.c	9 Mar 2004 04:49:42 -0000	1.19
+++ tools/winegcc/winegcc.c	11 Mar 2004 20:31:34 -0000
@@ -312,6 +312,9 @@
     for ( j = 0 ; j < opts->compiler_args->size ; j++ ) 
         strarray_add(comp_args, opts->compiler_args->base[j]);
 
+    /* we have to build a shared lib at the end */
+    strarray_addall(comp_args, strarray_fromstring(DLLFLAGS, " "));
+
     /* last, but not least, the files */
     for ( j = 0; j < opts->files->size; j++ )
 	strarray_add(comp_args, opts->files->base[j]);
@@ -345,7 +348,8 @@
     static const char *stdlibpath[] = { DLLDIR, LIBDIR, "/usr/lib", "/usr/local/lib", "/lib" };
     strarray *lib_dirs, *files;
     strarray *spec_args, *comp_args, *link_args;
-    char *spec_c_name, *spec_o_name, *base_file, *base_name;
+    char *base_file, *base_name;
+    const char *spec_c_name, *spec_o_name;
     const char* output_name;
     const char* winebuild = getenv("WINEBUILD");
     int generate_app_loader = 1;
@@ -498,15 +502,7 @@
 
     /* compile the .spec.c file into a .spec.o file */
     comp_args = strarray_alloc();
-    spec_o_name = get_temp_file(base_name, ".spec.o");
-    strarray_add(comp_args, CC);
-    strarray_addall(comp_args, strarray_fromstring(DLLFLAGS, " "));
-    strarray_add(comp_args, "-o");
-    strarray_add(comp_args, spec_o_name);
-    strarray_add(comp_args, "-c");
-    strarray_add(comp_args, spec_c_name);
-
-    spawn(opts->prefix, comp_args);
+    spec_o_name = compile_to_object(opts, spec_c_name);
     
     /* link everything together now */
     link_args = strarray_alloc();
@@ -797,6 +793,8 @@
 			strarray* Wb = strarray_fromstring(argv[i] + 4, ",");
 			strarray_addall(opts.winebuild_args, Wb);
 			strarray_free(Wb);
+                        /* don't pass it to the compiler, it generates errors */
+                        raw_compiler_arg = raw_linker_arg = 0;
 		    }
                     break;
                 case '-':

-- 
Dimi.




More information about the wine-patches mailing list