]> granicus.if.org Git - libass/commitdiff
configure: make fontconfig optional
authorwm4 <wm4@nowhere>
Mon, 7 Sep 2015 12:54:33 +0000 (14:54 +0200)
committerwm4 <wm4@nowhere>
Mon, 7 Sep 2015 13:17:33 +0000 (15:17 +0200)
configure.ac

index ba0f5e019ac520b1aa29c52b06a678c592155594..6ebaacf903e351e2c258f392b157203cd50e788b 100644 (file)
@@ -39,6 +39,8 @@ AC_ARG_ENABLE([directwrite], AS_HELP_STRING([--disable-directwrite],
     [disable DirectWrite support (win32 only) @<:@default=check@:>@]))
 AC_ARG_ENABLE([coretext], AS_HELP_STRING([--disable-coretext],
     [disable CoreText support (OSX only) @<:@default=check@:>@]))
+AC_ARG_ENABLE([require-system-font-provider], AS_HELP_STRING([--disable-require-system-font-provider],
+    [allow compilation even if no system font provider was found @<:@default=enabled:>@]))
 AC_ARG_ENABLE([harfbuzz], AS_HELP_STRING([--disable-harfbuzz],
     [disable HarfBuzz support @<:@default=check@:>@]))
 AC_ARG_ENABLE([asm], AS_HELP_STRING([--disable-asm],
@@ -145,7 +147,7 @@ PKG_CHECK_MODULES([FONTCONFIG], fontconfig >= 2.4.2, [
     LIBS="$LIBS $FONTCONFIG_LIBS"
     AC_DEFINE(CONFIG_FONTCONFIG, 1, [found fontconfig via pkg-config])
        fontconfig=true
-    ])
+    ], [fontconfig=false])
 fi
 
 if test x$enable_coretext != xno; then
@@ -238,6 +240,17 @@ if test x$directwrite = xtrue; then
     pkg_libs="${pkg_libs} -ldwrite"
 fi
 
+if test x$enable_require_system_font_provider != xno &&
+   test x$fontconfig != xtrue &&
+   test x$directwrite != xtrue &&
+   test x$coretext != xtrue
+then
+    AC_MSG_ERROR([\
+Either DirectWrite (on Windows), CoreText (on OSX), or Fontconfig\
+(Linux, other) is required. If you really want to compile without\
+a system font provider, add --disable-require-system-font-provider])
+fi
+
 AC_SUBST([PKG_LIBS_DEFAULT], [$(test x$enable_shared = xno && echo ${pkg_libs})])
 AC_SUBST([PKG_REQUIRES_DEFAULT], [$(test x$enable_shared = xno && echo ${pkg_requires})])
 AC_SUBST([PKG_LIBS_PRIVATE], [$(test x$enable_shared = xno || echo ${pkg_libs})])