summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-01-30 17:58:22 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-01-30 17:58:22 +0100
commit669f159665b04a3bf9c2dbbe9db71b59a45e46c2 (patch)
tree72a3eacf898201f74dccc6c2be3a3f8875170ab0 /configure.ac
parent899eaf8a69a5668860649991e016e97ec41de6f1 (diff)
Fix for STR#3473 (and its duplicate STR#3507)
Recent Linux distribution have replaced the freetype-config command by pkg-config. The fix tries the new procedure with pkg-config and falls back to freetype-config if the new procedure fails.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac36
1 files changed, 26 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index dd1a1ef36..ff8fcd8b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1032,21 +1032,37 @@ case $host_os_gui in
xft_found=no
if test x$enable_xft != xno; then
- AC_PATH_PROG(FTCONFIG, freetype-config)
-
- if test "x$FTCONFIG" != x; then
- CPPFLAGS="`$FTCONFIG --cflags` $CPPFLAGS"
- CFLAGS="`$FTCONFIG --cflags` $CFLAGS"
- CXXFLAGS="`$FTCONFIG --cflags` $CXXFLAGS"
-
- AC_CHECK_LIB(fontconfig, FcPatternCreate)
- AC_CHECK_HEADER(X11/Xft/Xft.h,
+ # Try pkg-config first (freetype2 deprecated freetype-config from some version on)
+ AC_PATH_PROG(PKGCONFIG, pkg-config)
+ FT_FLAGS=""
+ if test "x$PKGCONFIG" != x; then
+ FT_FLAGS="`$PKGCONFIG --cflags xft`"
+ if test "x$FT_FLAGS" = x; then
+ FT_FLAGS="`$PKGCONFIG --cflags freetype2`"
+ fi
+ fi
+ # if that failed, try freetype-config
+ if test "x$FT_FLAGS" = x; then
+ AC_PATH_PROG(FTCONFIG, freetype-config)
+ if test "x$FTCONFIG" != x; then
+ FT_FLAGS="`$FTCONFIG --cflags`"
+ else
+ # abort if both methods failed
+ AC_MSG_NOTICE([please install pkg-config or use 'configure --disable-xft'.])
+ AC_MSG_ERROR([Aborting.])
+ fi
+ fi
+ CPPFLAGS="$FT_FLAGS $CPPFLAGS"
+ CXXFLAGS="$FT_FLAGS $CXXFLAGS"
+ CFLAGS="$FT_FLAGS $CFLAGS"
+
+ AC_CHECK_LIB(fontconfig, FcPatternCreate)
+ AC_CHECK_HEADER(X11/Xft/Xft.h,
AC_CHECK_LIB(Xft, XftDrawCreate,
[AC_DEFINE(USE_XFT)
LIBS="-lXft $LIBS"
BUILD="XFT"
xft_found=yes]))
- fi
fi
dnl Issue a warning message if Xft was not found, abort configure