summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac33
-rw-r--r--libass/ass_coretext.c5
2 files changed, 26 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index 8280beb..811533a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -159,24 +159,33 @@ fi
AM_CONDITIONAL([FONTCONFIG], [test x$fontconfig = xtrue])
if test x$enable_coretext != xno; then
-OLDLIBS="$LIBS"
-# Linking to CoreText directly only works from Mountain Lion and iOS6. In
-# earlier OS releases CoreText was part of the ApplicationServices umbrella
-# framework.
-LIBS="$LIBS -framework CoreText -framework CoreFoundation"
+# Linking to CoreText directly only works from Mountain Lion and iOS.
+# In earlier OS X releases CoreText was part of the ApplicationServices
+# umbrella framework.
AC_MSG_CHECKING([for CORETEXT])
-AC_LINK_IFELSE([
+AC_COMPILE_IFELSE([
AC_LANG_PROGRAM(
- [[#include <CoreText/CoreText.h>]],
- [[CTFontCreateWithFontDescriptor(NULL, 0.0, NULL);]],)
+ [[#include <ApplicationServices/ApplicationServices.h>]],
+ [[CTFontDescriptorCopyAttribute(NULL, kCTFontURLAttribute);]])
], [
- AC_DEFINE(CONFIG_CORETEXT, 1, [found CoreText in System library])
+ LIBS="$LIBS -framework ApplicationServices -framework CoreFoundation"
+ AC_DEFINE(CONFIG_CORETEXT, 1, [found CoreText in ApplicationServices framework])
coretext=true
AC_MSG_RESULT([yes])
], [
- LIBS="$OLDLIBS"
- coretext=false
- AC_MSG_RESULT([no])
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [[#include <CoreText/CoreText.h>]],
+ [[CTFontDescriptorCopyAttribute(NULL, kCTFontURLAttribute);]])
+ ], [
+ LIBS="$LIBS -framework CoreText -framework CoreFoundation"
+ AC_DEFINE(CONFIG_CORETEXT, 1, [found CoreText framework])
+ coretext=true
+ AC_MSG_RESULT([yes])
+ ], [
+ coretext=false
+ AC_MSG_RESULT([no])
+ ])
])
fi
AM_CONDITIONAL([CORETEXT], [test x$coretext = xtrue])
diff --git a/libass/ass_coretext.c b/libass/ass_coretext.c
index a52ead5..661b95c 100644
--- a/libass/ass_coretext.c
+++ b/libass/ass_coretext.c
@@ -20,7 +20,12 @@
#include "ass_compat.h"
#include <CoreFoundation/CoreFoundation.h>
+#include <TargetConditionals.h>
+#if TARGET_OS_IPHONE
#include <CoreText/CoreText.h>
+#else
+#include <ApplicationServices/ApplicationServices.h>
+#endif
#include "ass_coretext.h"