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,25 +1,59 @@
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
vers=`$FREETYPE_CONFIG --version 2>/dev/null | $SED -e 's/libfreetype //' | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
# 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="`$FREETYPE_CONFIG --libs`"
LIBFREETYPE_LIBS="`$PKGCONFIG freetype2 --libs`"
LIBFREETYPE_RPATH=
for args in $LIBFREETYPE_LIBS; do
case $args in
-L*)
LIBFREETYPE_RPATH="$LIBFREETYPE_RPATH $args"
;;
case $args in
-L*)
LIBFREETYPE_RPATH="$LIBFREETYPE_RPATH $args"
;;
esac
done
LIBFREETYPE_RPATH=`echo $LIBFREETYPE_RPATH | $SED -e "s/-L/-R/g"`
LIBFREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
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_WARN([You need at least libfreetype 5.0])
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
LIBFREETYPE_LIBS="`$FREETYPE_CONFIG --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="`$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
@ -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,26 +113,34 @@ 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
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
LIBFONTCONFIG_LIBS="`$FONTCONFIG_CONFIG --libs`"
LIBFONTCONFIG_RPATH=
for args in $LIBFONTCONFIG_LIBS; do
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
LIBFONTCONFIG_LIBS="`$FONTCONFIG_CONFIG --libs`"
LIBFONTCONFIG_RPATH=
for args in $LIBFONTCONFIG_LIBS; do
case $args in
-L*)
LIBFONTCONFIG_RPATH="$LIBFONTCONFIG_RPATH $args"
;;
esac
done
LIBFONTCONFIG_RPATH=`echo $LIBFONTCONFIG_RPATH | $SED -e "s/-L/-R/g"`
LIBFONTCONFIG_CFLAGS="`$FONTCONFIG_CONFIG --cflags`"
done
LIBFONTCONFIG_RPATH=`echo $LIBFONTCONFIG_RPATH | $SED -e "s/-L/-R/g"`
LIBFONTCONFIG_CFLAGS="`$FONTCONFIG_CONFIG --cflags`"
AC_DEFINE_UNQUOTED(HAVE_FONTCONFIG, 1, [Defines if your system has the libfontconfig library])
AC_DEFINE_UNQUOTED(HAVE_FONTCONFIG, 1, [Defines if your system has the libfontconfig library])
fi
fi
fi

Loading…
Cancel
Save