diff options
author | Bryce Harrington <bryce@osg.samsung.com> | 2018-04-03 18:01:09 -0700 |
---|---|---|
committer | Bryce Harrington <bryce@osg.samsung.com> | 2018-04-11 13:27:53 -0700 |
commit | caf6f71d692de5b2afd97bf4870de8c56b454408 (patch) | |
tree | 8578cff4d2387bf26ad466eacda2cc7ee7bfa7cf | |
parent | 38806bc3c09fbfbca0cccb4d0cc557257682db62 (diff) |
configure: Conditionalize color font feature for older freetype2
FT_HAS_COLOR() macro is unavailable in older freetype2 without the color
font feature.
Compile and link a source including FT_HAS_COLOR(); if it fails (which
can happen on older FreeType2) then define FT_HAS_COLOR(x) as (0).
Patch from suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
-rw-r--r-- | configure.ac | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index d78b2ed41..59d87eb7f 100644 --- a/configure.ac +++ b/configure.ac @@ -580,6 +580,17 @@ if test "x$use_ft" = "xyes"; then AC_CHECK_FUNCS(FT_Get_X11_Font_Format FT_GlyphSlot_Embolden FT_GlyphSlot_Oblique FT_Load_Sfnt_Table FT_Library_SetLcdFilter FT_Get_Var_Design_Coordinates FT_Done_MM_Var) + AC_MSG_CHECKING(for FT_HAS_COLOR) + AC_LINK_IFELSE([AC_LANG_PROGRAM([ +#include <ft2build.h> +#include FT_FREETYPE_H +],[ +FT_Long has_color = FT_HAS_COLOR( ((FT_Face)NULL) ); +])],[AC_MSG_RESULT([yes])],[ + AC_DEFINE([FT_HAS_COLOR(x)], [(0)], [Define to (0) if freetype2 does not support color fonts]) + AC_MSG_RESULT([no, disable color font (freetype2 >= 2.5.1 is required)]) +]) + LIBS="$_save_libs" CFLAGS="$_save_cflags" fi |