Add freetype detection using pkg-config.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/3/head
Slávek Banko 3 years ago
parent f808f70c93
commit db04ee8cf4
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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"

Loading…
Cancel
Save