[winegcc] Include .so files when calling winebuild

Peter Berg Larsen pebl at math.ku.dk
Wed Jan 5 06:58:45 CST 2005


Changelog:
	Currently when compiling a program, winegcc calls winebuild
	to solve .def references. But winegcc drops .so files,
        so any new .def symbols in a .so causes a unresolved symbol at
	link time. This patch adds .so files to the files to winebuild.



diff -ru wine-20041201-org/tools/winegcc/utils.c wine-20041201/tools/winegcc/utils.c
--- wine-20041201-org/tools/winegcc/utils.c	2004-03-23 01:14:54.000000000 +0100
+++ wine-20041201/tools/winegcc/utils.c	2005-01-05 13:24:30.000000000 +0100
@@ -118,6 +118,19 @@
     arr->base[arr->size++] = str;
 }

+void strarray_set(strarray* arr, int index, const char* str)
+{
+    if (index >= arr->maximum)
+    {
+	arr->maximum = index+10;
+	arr->base = xrealloc(arr->base, sizeof(*(arr->base)) * arr->maximum);
+	memset(&(arr->base[arr->size]),0,sizeof(*(arr->base)) * (arr->maximum - arr->size));
+    }
+    arr->base[index] = str;
+    if (arr->size <= index)
+      arr->size = index+1;
+}
+
 void strarray_del(strarray* arr, int i)
 {
     if (i < 0 || i >= arr->size) error("Invalid index i=%d", i);
diff -ru wine-20041201-org/tools/winegcc/utils.h wine-20041201/tools/winegcc/utils.h
--- wine-20041201-org/tools/winegcc/utils.h	2004-03-23 01:14:54.000000000 +0100
+++ wine-20041201/tools/winegcc/utils.h	2005-01-05 05:03:26.000000000 +0100
@@ -48,6 +48,7 @@
 strarray* strarray_dup(const strarray* arr);
 void strarray_free(strarray* arr);
 void strarray_add(strarray* arr, const char* str);
+void strarray_set(strarray* arr, int index, const char* str);
 void strarray_del(strarray* arr, int i);
 void strarray_addall(strarray* arr, const strarray* from);
 strarray* strarray_fromstring(const char* str, const char* delim);
diff -ru wine-20041201-org/tools/winegcc/winegcc.c wine-20041201/tools/winegcc/winegcc.c
--- wine-20041201-org/tools/winegcc/winegcc.c	2004-11-22 20:48:10.000000000 +0100
+++ wine-20041201/tools/winegcc/winegcc.c	2005-01-05 05:30:10.000000000 +0100
@@ -338,7 +338,7 @@
 static void build(struct options* opts)
 {
     static const char *stdlibpath[] = { DLLDIR, LIBDIR, "/usr/lib", "/usr/local/lib", "/lib" };
-    strarray *lib_dirs, *files;
+    strarray *lib_dirs, *files, *fullnames;
     strarray *spec_args, *link_args;
     char *output_file;
     const char *spec_c_name, *spec_o_name;
@@ -401,6 +401,7 @@
     /* mark the files with their appropriate type */
     spec_file = lang = 0;
     files = strarray_alloc();
+    fullnames = strarray_alloc();
     for ( j = 0; j < opts->files->size; j++ )
     {
 	const char* file = opts->files->base[j];
@@ -460,7 +461,10 @@
                     strarray_add(files, file);
                     break;
 	    }
-	    free(fullname);
+	    if (fullname) {
+	        strarray_set(fullnames,files->size-1,strdup(fullname));
+	        free(fullname);
+            }
 	}
 	else if (file[1] == 'x')
 	    lang = file;
@@ -530,6 +535,9 @@
 	    case 'o':
 		strarray_add(spec_args, name);
 		break;
+	    case 's':
+		strarray_add(spec_args, fullnames->base[j]);
+	        break;
 	}
     }






More information about the wine-patches mailing list