Make winegcc knows Darwin dylib files

Pierre d'Herbemont stegefin at free.fr
Sat Mar 13 06:44:27 CST 2004


Hi!

Mac OS X/Darwin makes a difference between dynamic libraries from 
shared object. So winegcc has to know about the ".dylib" extension in 
order to be able to link to dynamic libraries such as libwine.

Thanks,

Pierre.

ChangeLog:
Support Darwin ".dylib" in winegcc.

-------------- next part --------------
Index: tools/winegcc/utils.c
===================================================================
RCS file: /home/wine/wine/tools/winegcc/utils.c,v
retrieving revision 1.12
diff -u -r1.12 utils.c
--- tools/winegcc/utils.c	10 Mar 2004 01:53:57 -0000	1.12
+++ tools/winegcc/utils.c	13 Mar 2004 12:39:31 -0000
@@ -220,6 +220,7 @@
     if (strendswith(filename, ".a")) return file_arh;
     if (strendswith(filename, ".res")) return file_res;
     if (strendswith(filename, ".so")) return file_so;
+    if (strendswith(filename, ".dylib")) return file_so;
     if (strendswith(filename, ".def")) return file_dll;
     if (strendswith(filename, ".rc")) return file_rc;
 
@@ -246,6 +247,10 @@
 {
     /* Unix shared object */
     if ((*file = try_lib_path(dir, "lib", library, ".so", file_so)))
+	return file_so;
+	
+    /* Mach-O (Darwin/Mac OS X) Dynamic Library behaves mostly like .so */
+    if ((*file = try_lib_path(dir, "lib", library, ".dylib", file_so)))
 	return file_so;
 
     /* Windows DLL */


More information about the wine-patches mailing list