Freetype on Mac OS X?

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Fri Oct 25 04:37:12 PDT 2013


Hi there mac porters :-)

When I fiddled with the build system for using freetype in the OpenJDK 
builds, it turned out a couple of inconsistencies regarding freetype on 
macosx.

The current build system actually requires freetype to be present when 
building. When building libfontmanager, we include freetypeScaler.c 
(which I think is the only consumer of freetype) and link with 
-lfreetype, on macosx as well as on linux and solaris.

However, I'm not entirely sure this is correct. Evidence (like the build 
documentation :)) seems to indicate that freetype is not/should not be 
used on macosx, not even for OpenJDK. (It's never used when building the 
closed product.)

I tried out a simple patch which excludes freetypeScaler.c when building 
on macosx, and stops linking with freetype. It compiles without issues, 
but I have no readily access to a "headful" Mac to try this on, nor do I 
really know what tests to run to check of libfontmanager works as expected.

I'd appreciate some input on this.

Here is the patch I used:

diff --git a/makefiles/lib/Awt2dLibraries.gmk 
b/makefiles/lib/Awt2dLibraries.gmk
--- a/makefiles/lib/Awt2dLibraries.gmk
+++ b/makefiles/lib/Awt2dLibraries.gmk
@@ -777,9 +777,13 @@
    BUILD_LIBFONTMANAGER_MAPFILE := 
$(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers
    LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
  else
-  FONT_HEADERS := $(FREETYPE_CFLAGS)
    BUILD_LIBFONTMANAGER_MAPFILE := 
$(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers.openjdk
-  BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE_LIBS)
+  ifneq ($(OPENJDK_TARGET_OS), macosx)
+    FONT_HEADERS := $(FREETYPE_CFLAGS)
+    BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE_LIBS)
+  else
+    LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
+  endif
  endif

  LIBFONTMANAGER_OPTIMIZATION := HIGH

/Magnus



More information about the macosx-port-dev mailing list