summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac25
1 files changed, 23 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 43fd881..71f4657 100644
--- a/configure.ac
+++ b/configure.ac
@@ -480,12 +480,33 @@ _ldflags=$LDFLAGS
# TTF
if test $sq_codec_ttf = yes; then
-AC_PATH_PROG(FREETYPE_CONFIG, freetype-config)
+if test -z "$PKGCONFIG"; then
+ KDE_FIND_PATH(pkg-config, PKGCONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/bin /usr/local/bin /opt/local/bin], [
+ AC_MSG_WARN([Could not find pkg-config ])
+ ])
+fi
+
+if test -n "$PKGCONFIG"; then
+ AC_MSG_CHECKING([for freetype >= 5.0])
+ vers=`$PKGCONFIG freetype2 --modversion 2>/dev/null | $SED -e 's/libfontconfig //' | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
+ if test -n "$vers" && test "$vers" -ge 5000000; then
+ freetype_libs="`$PKGCONFIG freetype2 --libs`"
+ freetype_cflags="`$PKGCONFIG freetype2 --cflags`"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+fi
-if [ test -n "$FREETYPE_CONFIG" ]; then
+if test -z "$freetype_libs"; then
+ AC_PATH_PROG(FREETYPE_CONFIG, freetype-config)
+ if test -n "$FREETYPE_CONFIG"; then
freetype_cflags=`$FREETYPE_CONFIG --cflags`
freetype_libs=`$FREETYPE_CONFIG --libs`
+ fi
+fi
+if test -n "$freetype_libs"; then
CPPFLAGS="$freetype_cflags $CPPFLAGS"
LDFLAGS="$LDFLAGS $freetype_libs"