Add freetype detection using pkg-config.

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

@ -1,9 +1,41 @@
KDE_FIND_PATH(freetype-config, FREETYPE_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [
AC_MSG_WARN([Could not find libfreetype anywhere, check http://www.freetype.org/])
])
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 "$FREETYPE_CONFIG"; then
# Check for freetype
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
LIBFREETYPE_LIBS="`$PKGCONFIG freetype2 --libs`"
LIBFREETYPE_RPATH=
for args in $LIBFREETYPE_LIBS; do
case $args in
-L*)
LIBFREETYPE_RPATH="$LIBFREETYPE_RPATH $args"
;;
esac
done
LIBFREETYPE_RPATH=`echo $LIBFREETYPE_RPATH | $SED -e "s/-L/-R/g"`
LIBFREETYPE_CFLAGS="`$PKGCONFIG freetype2 --cflags`"
AC_DEFINE_UNQUOTED(HAVE_FREETYPE, 1, [Defines if your system has the libfreetype library])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT([no - we have to try freetype-config])
fi
fi
if test -z "$LIBFREETYPE_LIBS"; then
KDE_FIND_PATH(freetype-config, FREETYPE_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [
AC_MSG_WARN([Could not find libfreetype anywhere, check http://www.freetype.org/])
])
if test -n "$FREETYPE_CONFIG"; then
vers=`$FREETYPE_CONFIG --version 2>/dev/null | $SED -e 's/libfreetype //' | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
if test -n "$vers" && test "$vers" -ge 5000000
then
@ -18,9 +50,11 @@ if test -n "$FREETYPE_CONFIG"; then
done
LIBFREETYPE_RPATH=`echo $LIBFREETYPE_RPATH | $SED -e "s/-L/-R/g"`
LIBFREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
AC_DEFINE_UNQUOTED(HAVE_FREETYPE, 1, [Defines if your system has the libfreetype library])
else
AC_MSG_WARN([You need at least libfreetype 5.0])
fi
fi
fi
AC_SUBST(LIBFREETYPE_LIBS)
@ -28,6 +62,7 @@ AC_SUBST(LIBFREETYPE_CFLAGS)
AC_SUBST(LIBFREETYPE_RPATH)
# Check for libart2
KDE_FIND_PATH(libart2-config, LIBART_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [
AC_MSG_WARN([Could not find libart anywhere, check http://www.levien.com/libart/])
])
@ -60,13 +95,8 @@ AC_SUBST(LIBART_RPATH)
# Check for fontconfig
KDE_FIND_PATH(fontconfig-config, FONTCONFIG_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/bin /usr/local/bin /opt/local/bin], [
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 neither pkg-config nor fontconfig-config, check http://www.fontconfig.org/ ])
])
])
if test -n "$PKGCONFIG"; then
AC_MSG_CHECKING([for fontconfig >= 1.0])
vers=`$PKGCONFIG fontconfig --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 1000001
then
@ -83,10 +113,17 @@ if test -n "$PKGCONFIG"; then
LIBFONTCONFIG_CFLAGS="`$PKGCONFIG fontconfig --cflags`"
AC_DEFINE_UNQUOTED(HAVE_FONTCONFIG, 1, [Defines if your system has the libfontconfig library])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT([no - we have to try fontconfig-config])
fi
fi
if test -n "$FONTCONFIG_CONFIG"; then
if test -z "$LIBFONTCONFIG_LIBS"; then
KDE_FIND_PATH(fontconfig-config, FONTCONFIG_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/bin /usr/local/bin /opt/local/bin], [
AC_MSG_WARN([Could not find fontconfig-config ])
])
if test -n "$FONTCONFIG_CONFIG"; then
vers=`$FONTCONFIG_CONFIG --version 2>/dev/null | $SED -e 's/libfontconfig //' | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
if test -n "$vers" && test "$vers" -ge 1000001
then
@ -104,6 +141,7 @@ if test -n "$FONTCONFIG_CONFIG"; then
AC_DEFINE_UNQUOTED(HAVE_FONTCONFIG, 1, [Defines if your system has the libfontconfig library])
fi
fi
fi
AC_SUBST(LIBFONTCONFIG_LIBS)

Loading…
Cancel
Save