freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Small Mac patch for gcc support


From: Dan Williams
Subject: [Devel] Small Mac patch for gcc support
Date: Wed, 7 May 2003 12:43:54 -0500

Hi,

This patch more easily allows compilation on OS X. The credit for this one goes to Torrey Lyons of the XDarwin/XFree86 project, he's just lazy and hasn't submitted it yet :) It should also help out those who don't want to compile with resource-based font support on OS X, since they can pass -DDARWIN_NO_CARBON on the compile line and they won't get resource-based support when using gcc.

On a side note, there will need to be more tweaks. For example, the libtool that's included doesn't recognize some flags that _might_ be needed on Mac OS X if there are multiple versions of Freetype laying around.

 -compatibility_version 6.2.0 -current_version 6.3.3

This needs to get passed to the linker. We'll need to handle this in the configuration script probably, and we'll need some good way of finding out whether the system we are compiling on (with gcc, not CodeWarrior) is an OS X system or a pure Darwin system. For the OpenOffice.org project, we've been using the existence of /usr/bin/osascript as a check for OS X, but this is a bad approach. Unfortunately, we haven't found a better one. The problem is that if you run a uname -a you get the _same_ thing for Darwin and OS X, so this is out. We could check for /System/Library/CoreServices/SystemVersion.plist (I think that's it) but this is the same type of thing: depending on a file that is not in a Darwin distribution. Suggestions? I'm going to go about hacking configure scripts and whatnot to see if I can get things working. I had done some bad hacks to the generated .mk files, but of course this won't fly for a real fix :)

Dan

Index: include/freetype/config/ftconfig.h
===================================================================
RCS file: /cvs/freetype/freetype2/include/freetype/config/ftconfig.h,v
retrieving revision 1.38
diff -u -r1.38 ftconfig.h
--- ftconfig.h  2002/04/30 14:26:48     1.38
+++ ftconfig.h  2003/05/07 17:34:05
@@ -108,7 +108,8 @@
/* This is the only necessary change, so it is defined here instead */ /* providing a new configuration file. */ /* */ -#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
+#if ( defined( __APPLE__ ) && !defined ( DARWIN_NO_CARBON ) ) || \
+    ( defined( __MWERKS__ ) && defined( macintosh ) )
 #define FT_MACINTOSH 1
 #endif

Index: src/base/ftmac.c
===================================================================
RCS file: /cvs/freetype/freetype2/src/base/ftmac.c,v
retrieving revision 1.25
diff -u -r1.25 ftmac.c
--- ftmac.c     2003/04/23 18:10:19     1.25
+++ ftmac.c     2003/05/07 17:34:06
@@ -65,12 +65,15 @@
 #include "truetype/ttobjs.h"
 #include "type1/t1objs.h"

+#ifdef __GNUC__
+#include <Carbon/Carbon.h>
+#else
 #include <Resources.h>
 #include <Fonts.h>
 #include <Errors.h>
 #include <Files.h>
 #include <TextUtils.h>
-
+#endif

 #include FT_MAC_H

Attachment: freetype2.mac.20030507.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]