* configure.ac: Use PKG_CHECK_MODULE instead of ad hoc code
---
configure.ac | 70 ++++------------------------------------------------------
1 file changed, 4 insertions(+), 66 deletions(-)
diff --git a/configure.ac b/configure.ac
index e22b86a..2c1435a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -537,76 +537,14 @@ AC_SUBST(UFST_ROOT)
AC_SUBST(UFST_CFLAGS)
AC_SUBST(UFST_LIB_EXT)
-
+AFS=1
+FT_BRIDGE=0
AC_ARG_ENABLE([freetype], AC_HELP_STRING([--disable-freetype],
[Disable freetype for font rasterization]))
-FT_BRIDGE=0
-SHARE_FT=0
-FTSRCDIR=
-FT_CFLAGS=
-FT_LIBS=
if test x"$enable_freetype" != xno; then
- AC_MSG_CHECKING([for local freetype library source])
- dnl We prefer freetype2 over freetype, so it is easy to override
- dnl the included freetype source with a checkout from upstream.
-
- for dir in freetype2 freetype; do
- if test -f $dir/src/base/ftbbox.c; then
- AC_MSG_RESULT(yes)
- SHARE_FT=0
- FTSRCDIR="$dir"
- FT_CFLAGS="-I$dir/include"
- FT_BRIDGE=1
- break;
- fi
- done
- if test -z $FTSRCDIR; then
- AC_MSG_RESULT([no])
- if test "x$PKGCONFIG" != x; then
- AC_MSG_CHECKING(for system freetype2 >= 2.4.2 with pkg-config)
- # pkg-config needs the libtool version, which != the freetype2
version <sigh!>
- # There is a table of corresponding ft2<->libtool numbers in
freetype/docs/VERSION.DLL
- if $PKGCONFIG --atleast-version=12.0.6 freetype2; then
- AC_MSG_RESULT(yes)
- FT_CFLAGS="$CFLAGS `$PKGCONFIG --cflags freetype2`"
- FT_LIBS="`$PKGCONFIG --libs freetype2`"
- FT_BRIDGE=1
- SHARE_FT=1
- else
- AC_MSG_RESULT(no)
- AC_MSG_WARN([freetype library source not found...using native
rasterizer])
- AFS=1
- fi
- else
- AC_CHECK_HEADER([ft2build.h], [FT_BRIDGE=1], [AFS=1])
-
- if test "x$FT_BRIDGE" = x1; then
- AC_CHECK_LIB(freetype, FT_Init_FreeType,
- [FT_BRIDGE=1], [FT_BRIDGE=0; AFS=1])
-
- if test "x$FT_BRIDGE" = x1; then
- AC_MSG_CHECKING(for system freetype2 library >= 2.4.2)
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([#include "ft2build.h"
- #include FT_FREETYPE_H], [
- #if FREETYPE_MAJOR < 2
- FAIL
- #endif
- #if FREETYPE_MINOR < 4
- FAIL
- #endif
- #if FREETYPE_PATCH < 2
- FAIL
- #endif
- return(0);
- ])],
- [FT_BRIDGE=1;AC_MSG_RESULT(yes)], [FT_BRIDGE=0;
AFS=1;AC_MSG_RESULT(no)])
- fi
- fi
-
- fi
- fi
+ PKG_CHECK_MODULES([FT], [freetype2 >= 2.4.2],
+ [FT_BRIDGE=1; SHARE_FT=1; AFS=0], [true])
fi
AC_SUBST(FT_BRIDGE)
AC_SUBST(SHARE_FT)
--
1.7.10.4