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:18 +0200
commitac01157eba538011b44cf68558fb852192b14c57 (patch)
tree544ee7745197f4eecbb9274c7f932e929818971a
parent246f9df57cb6599200e96753d85da21f32d6c663 (diff)
downloadlibksquirrel-r14.0.11.tar.gz
libksquirrel-r14.0.11.zip
Add freetype detection using pkg-config.r14.0.11
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit db04ee8cf4076ebd9433f038c8125a0f1d6ad305)
-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"