summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2019-01-06 02:24:33 +0100
committerSlávek Banko <[email protected]>2019-01-06 02:24:55 +0100
commit606cd7963156875b015df21277defdd8bb17655d (patch)
treee8eec4d8725b47f976586fe804c0fad0eeb0b711
parent0a06531e11d692bf7438eff6b37b7e4930592e2a (diff)
downloadkoffice-606cd7963156875b015df21277defdd8bb17655d.tar.gz
koffice-606cd7963156875b015df21277defdd8bb17655d.zip
Add freetype detection using pkg-config.
Signed-off-by: Slávek Banko <[email protected]> (cherry picked from commit 197848a4a1c6deea1b2c80536a6ae8d0afb121f2)
-rw-r--r--karbon/configure.in.in96
1 files changed, 67 insertions, 29 deletions
diff --git a/karbon/configure.in.in b/karbon/configure.in.in
index 03258f0b..f73ca836 100644
--- a/karbon/configure.in.in
+++ b/karbon/configure.in.in
@@ -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