From b96af03c20e46105982b3608b608614403540661 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Thu, 20 Mar 2014 16:01:30 +0200 Subject: [PATCH] Fix build with --coretext on iOS On iOS CoreText and CoreGraphics are stand-alone frameworks --- configure.ac | 23 +++++++++++++++++++---- src/hb-coretext.h | 8 +++++++- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 800a69830..0d4bec4d5 100644 --- a/configure.ac +++ b/configure.ac @@ -342,15 +342,30 @@ AC_ARG_WITH(coretext, have_coretext=false if test "x$with_coretext" = "xyes" -o "x$with_coretext" = "xauto"; then AC_CHECK_TYPE(CTFontRef, have_coretext=true,, [#include ]) + + if $have_coretext; then + CORETEXT_CFLAGS= + CORETEXT_LIBS="-framework ApplicationServices" + AC_SUBST(CORETEXT_CFLAGS) + AC_SUBST(CORETEXT_LIBS) + else + # On iOS CoreText and CoreGraphics are stand-alone frameworks + if test "x$have_coretext" != "xtrue"; then + AC_CHECK_TYPE(CTFontRef, have_coretext=true,, [#include ]) + fi + + if $have_coretext; then + CORETEXT_CFLAGS= + CORETEXT_LIBS="-framework CoreText -framework CoreGraphics" + AC_SUBST(CORETEXT_CFLAGS) + AC_SUBST(CORETEXT_LIBS) + fi + fi fi if test "x$with_coretext" = "xyes" -a "x$have_coretext" != "xtrue"; then AC_MSG_ERROR([CoreText support requested but libcoretext not found]) fi if $have_coretext; then - CORETEXT_CFLAGS= - CORETEXT_LIBS="-framework ApplicationServices" - AC_SUBST(CORETEXT_CFLAGS) - AC_SUBST(CORETEXT_LIBS) AC_DEFINE(HAVE_CORETEXT, 1, [Have Core Text backend]) fi AM_CONDITIONAL(HAVE_CORETEXT, $have_coretext) diff --git a/src/hb-coretext.h b/src/hb-coretext.h index 607bbbc1e..837308f31 100644 --- a/src/hb-coretext.h +++ b/src/hb-coretext.h @@ -29,7 +29,13 @@ #include "hb.h" -#include +#include +#if defined(TARGET_OS_IPHONE) +# include +# include +#else +# include +#endif HB_BEGIN_DECLS