On dimanche, juil 13, 2003, at 17:36 Europe/Paris, Pierre d'Herbemont wrote:
Hi!
This patch add support for Mac OS X's Mach-o in configure.ac and in the library. Mach-O differentiate dynamic library that you can link to but can't lad dynamically and bundle (shared object) that you can't link to, but can load dynamically.
Please tell me if you don't like the way it is done.
Sorry, I forgot to add a modification of libs/Makefile.in.
Thanks,
Pierre
ChangeLog: -Add Support for Mach-O file format (Mac OS X) when building libraries.
Index: configure.ac =================================================================== RCS file: /home/wine/wine/configure.ac,v retrieving revision 1.165 diff -u -r1.165 configure.ac --- configure.ac 1 Jul 2003 01:11:13 -0000 1.165 +++ configure.ac 13 Jul 2003 15:52:10 -0000 @@ -142,6 +142,8 @@ AC_CHECK_LIB(xpg4,_xpg4_setrunelocale) dnl Check for -lmmap for OS/2 AC_CHECK_LIB(mmap,mmap) +dnl Check for -lpoll for Mac OS X/Darwin +AC_CHECK_LIB(poll,poll) JPEGLIB="" AC_SUBST(JPEGLIB) @@ -796,6 +798,7 @@ AC_SUBST(DLLIBS,"") AC_SUBST(LDDLLFLAGS,"") AC_SUBST(LDSHARED,"") +AC_SUBST(LDDYLIB,"") AC_SUBST(LIBEXT,"so") AC_SUBST(IMPLIBEXT,"def") @@ -859,6 +862,19 @@ then LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)" LDDLLFLAGS="-Wl,-B,symbolic" + else + AC_CACHE_CHECK(whether we can build a Mach-O (Mac OS X/Darwin) dll, ac_cv_c_dll_macho, + [WINE_TRY_CFLAGS([-bundle], + ac_cv_c_dll_macho="yes", ac_cv_c_dll_macho="no")]) + + if test "$ac_cv_c_dll_macho" = "yes" + then + LIBEXT="dylib" + LDSHARED="\$(CC) -bundle -flat_namespace -undefined suppress" + LDDLLFLAGS="" + CFLAGS="$CFLAGS -fno-common -no-cpp-precomp -Dsocklen_t=u_int32_t" + LDDYLIB="\$(CC) -dynamiclib" + fi fi fi fi @@ -1000,6 +1016,7 @@ linux/serial.h \ linux/ucdrom.h \ machine/cpu.h \ + mach-o/loader.h \ netdb.h \ netinet/in.h \ netinet/in_systm.h \ @@ -1314,6 +1331,8 @@ *i[[3456789]]86*) WINE_CHECK_DEFINE([__i386__]) ;; *alpha*) WINE_CHECK_DEFINE([__ALPHA__]) ;; *sparc*) WINE_CHECK_DEFINE([__sparc__]) ;; + *powerpc*) WINE_CHECK_DEFINE([__powerpc__]) + WINE_CHECK_DEFINE([__PPC__]) ;; esac case $host_vendor in Index: Make.rules.in =================================================================== RCS file: /home/wine/wine/Make.rules.in,v retrieving revision 1.158 diff -u -r1.158 Make.rules.in --- Make.rules.in 13 Jun 2003 23:26:02 -0000 1.158 +++ Make.rules.in 13 Jul 2003 15:52:10 -0000 @@ -37,6 +37,7 @@ LDSHARED = @LDSHARED@ DLLTOOL = @DLLTOOL@ DLLWRAP = @DLLWRAP@ +LDDYLIB = @LDDYLIB@ AR = @AR@ rc RANLIB = @RANLIB@ STRIP = @STRIP@ Index: libs/Makelib.rules.in =================================================================== RCS file: /home/wine/wine/libs/Makelib.rules.in,v retrieving revision 1.2 diff -u -r1.2 Makelib.rules.in --- libs/Makelib.rules.in 13 Jun 2003 23:26:02 -0000 1.2 +++ libs/Makelib.rules.in 13 Jul 2003 15:52:10 -0000 @@ -30,7 +30,13 @@ $(LIBNAME).dll: $(OBJS) $(DEFNAME) Makefile.in $(DLLWRAP) --def $(SRCDIR)/$(DEFNAME) -o $@ $(OBJS) $(EXTRALIBS) -.PHONY: install-lib-so install-lib-dll install-dev-so install-dev-dll +$(LIBNAME).$(SOVERSION).dylib: $(OBJS) Makefile.in + $(LDDYLIB) $(OBJS) $(EXTRALIBS) $(LDFLAGS) $(LIBS) -o $@ + +$(LIBNAME).dylib: $(LIBNAME).$(SOVERSION).dylib + $(RM) $@ && $(LN_S) $(LIBNAME).so.$(SOVERSION) $@ + +.PHONY: install-lib-so install-lib-dll install-lib-dylib install-dev-so install-dev-dll install-dev-dylib install-lib-so: $(LIBNAME).so.$(SOVERSION) dummy $(MKINSTALLDIRS) $(libdir) @@ -40,6 +46,10 @@ $(MKINSTALLDIRS) $(libdir) $(INSTALL_DATA) $(LIBNAME).dll $(libdir)/$(LIBNAME).dll +install-lib-dylib: $(LIBNAME).$(SOVERSION).dylib dummy + $(MKINSTALLDIRS) $(libdir) + $(INSTALL_PROGRAM) $(LIBNAME).$(SOVERSION).dylib $(libdir)/$(LIBNAME).$(SOVERSION).dylib + install-dev-so: dummy $(MKINSTALLDIRS) $(libdir) cd $(libdir) && $(RM) $(LIBNAME).so && $(LN_S) $(LIBNAME).so.$(SOVERSION) $(LIBNAME).so @@ -48,11 +58,15 @@ $(MKINSTALLDIRS) $(libdir) $(INSTALL_DATA) $(LIBNAME).a $(libdir)/$(LIBNAME).a +install-dev-dylib: dummy + $(MKINSTALLDIRS) $(libdir) + cd $(libdir) && $(RM) $(LIBNAME).dylib && $(LN_S) $(LIBNAME).$(SOVERSION).dylib $(LIBNAME).dylib + install install-lib:: $(LIBEXT:%=install-lib-%) install install-dev:: $(LIBEXT:%=install-dev-%) uninstall:: - $(RM) $(libdir)/$(LIBNAME).a $(libdir)/$(LIBNAME).dll $(libdir)/$(LIBNAME).so $(libdir)/$(LIBNAME).so.$(SOVERSION) + $(RM) $(libdir)/$(LIBNAME).a $(libdir)/$(LIBNAME).dll $(libdir)/$(LIBNAME).so $(libdir)/$(LIBNAME).so.$(SOVERSION) $(libdir)/$(LIBNAME).dylib $(libdir)/$(LIBNAME).$(SOVERSION).dylib clean:: - $(RM) $(LIBNAME).so.$(SOVERSION) $(LIBNAME).dll + $(RM) $(LIBNAME).so.$(SOVERSION) $(LIBNAME).dll $(LIBNAME).$(SOVERSION).dylib Index: libs/Makefile.in =================================================================== RCS file: /home/wine/wine/libs/Makefile.in,v retrieving revision 1.5 diff -u -r1.5 Makefile.in --- libs/Makefile.in 1 May 2003 03:16:21 -0000 1.5 +++ libs/Makefile.in 13 Jul 2003 15:52:11 -0000 @@ -37,10 +37,10 @@ # Symlinks -libwine.so libwine.so.1 libwine.dll libwine.a: wine/libwine.$(LIBEXT) +libwine.so libwine.so.1 libwine.dll libwine.dylib libwine.1.dylib libwine.a: wine/libwine.$(LIBEXT) $(RM) $@ && $(LN_S) wine/$@ $@ -libwine_unicode.so libwine_unicode.so.1 libwine_unicode.dll libwine_unicode.a: unicode/libwine_unicode.$(LIBEXT) +libwine_unicode.so libwine_unicode.so.1 libwine_unicode.dll libwine_unicode.dylib libwine_unicode.1.dylib libwine_unicode.a: unicode/libwine_unicode.$(LIBEXT) $(RM) $@ && $(LN_S) unicode/$@ $@ libwine_port.a: port/libwine_port.a