Mac OS X Support : recognize Mac OS X/Darwin in configure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
Here is a first patch for configure.ac to allow Mac OS X to be recognized as a build platform. Also enable __PPC__ and __powerpc__ flags if necessary.


More are following

Thanks!

Pierre.

ChangeLog:
Mac OS X is recognized as a build platform. Also enable __PPC__ and __powerpc__ flags if necessary.


Index: configure.ac
===================================================================
RCS file: /home/wine/wine/configure.ac,v
retrieving revision 1.154
diff -u -r1.154 configure.ac
--- configure.ac	1 May 2003 03:16:21 -0000	1.154
+++ configure.ac	3 May 2003 18:38:41 -0000
@@ -772,13 +772,28 @@
 
 dnl **** Check for working dll ****
 
+dnl extension to use when building dlls
 AC_SUBST(DLLEXT,"")
+dnl flags to use when building dlls
 AC_SUBST(DLLFLAGS,"-D_REENTRANT")
+dnl flag to append in order to use the Dynamic Library (dlopen)
 AC_SUBST(DLLIBS,"")
+dnl flags to use when building dlls
 AC_SUBST(LDDLLFLAGS,"")
+dnl linker used when building *.so
 AC_SUBST(LDSHARED,"")
+dnl linker used when building *.dylib
+AC_SUBST(LDDYLIB,"")
+dnl special added flags when building *.c files of libraries (in libs/)
+AC_SUBST(LIBCFLAGS,"")
+dnl type of file to use when building libraries (in libs/)
 AC_SUBST(LIBEXT,"so")
+dnl extension to append onto FIXME : onto what?
 AC_SUBST(IMPLIBEXT,"def")
+dnl if we need to build something like an other lib for ntdll
+AC_SUBST(NTDLLEXTRADEP,"")
+dnl flag to use with strip
+AC_SUBST(STRIPFLAG,"--strip-unneeded")
 
 case $host_os in
   cygwin*|mingw32*)
@@ -792,6 +807,59 @@
     fi
     IMPLIBEXT="a"
     ;;
+  darwin*|macosx*)
+    AC_CHECK_HEADERS(dlfcn.h,
+        [AC_CHECK_FUNCS(dlopen,,
+          [AC_CHECK_LIB(dl,dlopen,
+             [AC_DEFINE(HAVE_DLOPEN,1,[Define if you have dlopen])
+              DLLIBS="-ldl"],
+          [have_dlcompat="no"])])],
+        [have_dlcompat="no"])
+    if test "$have_dlcompat" = "no"
+    then
+      AC_MSG_ERROR(
+      [No dlcompat found,
+      install it in order to build wine on Mac OS X/Darwin
+      ])
+    fi
+    
+    AC_CHECK_LIB(poll,poll,
+       [AC_DEFINE(HAVE_DLPOLL,1,[Define if you have lpoll])
+        LIBS="$LIBS -lpoll"],
+       [have_lpoll="no"])
+    
+    if test "$have_lpoll" = "no"
+    then
+      AC_MSG_ERROR(
+      [No lpoll library found.
+      install it in order to build wine on Mac OS X/Darwin
+      ])
+    fi
+
+    AC_CHECK_HEADERS(mach-o/loader.h,
+       [AC_DEFINE(HAVE_MACHO_LOADER_H,1,[Define if you have mach-o/loader.h])],
+       [have_macho_loader_h="no"])
+
+    if test "$have_lpoll" = "no"
+    then
+      AC_MSG_ERROR(
+      [No Macho header found,
+      mach-o/loader.h should be installed with the developer tools
+      install them in order to build wine on Mac OS X/Darwin
+      ])
+    fi
+    AC_DEFINE(USE_MACHO,1,[Define if you use mach-o])
+    
+    LIBCFLAGS="-fno-common"
+    CFLAGS="$CFLAGS -no-cpp-precomp"
+    LDSHARED="\$(CC) -bundle -flat_namespace -undefined suppress"
+    LDDLLFLAGS=""
+    LIBEXT=dylib
+    AC_SUBST(LDDYLIB,"\$(CC) -dynamiclib")
+    DLLEXT=".so"
+    NTDLLEXTRADEP="\$(MODULE).dylib"
+    STRIPFLAG="-u -r"
+  ;;
   *)
     AC_CHECK_HEADERS(dlfcn.h,
         [AC_CHECK_FUNCS(dlopen,,
@@ -868,6 +936,8 @@
 case $build_os in
   cygwin*|mingw32*)
     AC_SUBST(LDPATH,"PATH=\"\$(TOOLSDIR)/libs/unicode:\$\$PATH\"") ;;
+  darwin*|macosx*)
+    AC_SUBST(LDPATH,"DYLD_LIBRARY_PATH=\"\$(TOOLSDIR)/libs/unicode:\$\$LD_LIBRARY_PATH\"") ;;
   *)
     AC_SUBST(LDPATH,"LD_LIBRARY_PATH=\"\$(TOOLSDIR)/libs/unicode:\$\$LD_LIBRARY_PATH\"") ;;
 esac
@@ -1295,10 +1365,17 @@
   *i[[3456789]]86*) WINE_CHECK_DEFINE([__i386__]) ;;
   *alpha*)          WINE_CHECK_DEFINE([__ALPHA__]) ;;
   *sparc*)          WINE_CHECK_DEFINE([__sparc__]) ;;
+dnl for the powerpc it seems to be two flags, FIXME : they should be unified
+  *powerpc*)        WINE_CHECK_DEFINE([__powerpc__])
+                    WINE_CHECK_DEFINE([__PPC__]) ;;
 esac
 
 case $host_vendor in
   *sun*) WINE_CHECK_DEFINE([__sun__]) ;;
+esac
+
+case $host_os in
+  *darwin*|macosx*) WINE_CHECK_DEFINE([__darwin__]) ;;
 esac
 
 dnl **** Generate output files ****

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux