check for libxft, if successful, then define HAVE_XFT

This commit is contained in:
Holger Vogt 2020-01-01 11:18:48 +01:00
parent 38bb89663d
commit cdbbc22c68
1 changed files with 14 additions and 8 deletions

View File

@ -713,14 +713,20 @@ if test "x$no_x" != xyes ; then
[AC_MSG_ERROR([Couldn't find Xext library])], [$X_LIBS $X_EXTRA_LIBS]) [AC_MSG_ERROR([Couldn't find Xext library])], [$X_LIBS $X_EXTRA_LIBS])
X_LIBS="$X_LIBS -lX11" X_LIBS="$X_LIBS -lX11"
AC_CHECK_LIB([Xft], [main], AC_CHECK_LIB([Xft], [main],
[AC_DEFINE([HAVE_LIBXFT], [], [Have xft routines in libxft]) [AC_DEFINE([HAVE_LIBXFT], [1], [Have xft routines in libxft])]
LIBS="$LIBS -lXft" X_LIBS="$X_LIBS -lXft -lfontconfig -lXrender -lfreetype"
AC_CHECK_LIB([fontconfig], [main], [X_LIBS="$X_LIBS -lfontconfig"], has_xft=yes,
[AC_MSG_ERROR([Couldn't find fontconfig library])], [$X_LIBS $X_EXTRA_LIBS]) [has_xft=no], [$X_LIBS $X_EXTRA_LIBS])
AC_CHECK_LIB([Xrender], [main], [X_LIBS="$X_LIBS -lXrender"],
[AC_MSG_ERROR([Couldn't find Xrender library])], [$X_LIBS $X_EXTRA_LIBS]) if test "x$has_xft" = xyes ; then
AC_CHECK_LIB([freetype], [main], [X_LIBS="$X_LIBS -lfreetype"], AC_CHECK_LIB([fontconfig], [main], [],
[AC_MSG_ERROR([Couldn't find freetype library])], [$X_LIBS $X_EXTRA_LIBS])]) [AC_MSG_ERROR([Couldn't find fontconfig library])], [$X_LIBS $X_EXTRA_LIBS])
# AC_CHECK_LIB([Xrender], [main], [],
# [AC_MSG_ERROR([Couldn't find Xrender library])], [$X_LIBS $X_EXTRA_LIBS])
AC_CHECK_LIB([freetype], [main], [],
[AC_MSG_ERROR([Couldn't find freetype library])], [$X_LIBS $X_EXTRA_LIBS])
fi
has_no_x=false has_no_x=false
else else
AC_DEFINE([X_DISPLAY_MISSING]) AC_DEFINE([X_DISPLAY_MISSING])