summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2021-10-10 18:55:02 +0200
committerSlávek Banko <slavek.banko@axis.cz>2021-10-10 18:55:02 +0200
commitdb04ee8cf4076ebd9433f038c8125a0f1d6ad305 (patch)
tree062f965a7634a832e3d66dd01fc79cecc9a5d348
parentf808f70c938a5d764e474014b73fdb625c80eaff (diff)
downloadlibksquirrel-db04ee8c.tar.gz
libksquirrel-db04ee8c.zip
Add freetype detection using pkg-config.HEADmaster
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-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"