dnl Check for Xft extension support and proper library files.
XFT=""
XFT2=""
-dnl XFT_UTF8=""
AC_MSG_CHECKING([whether to build support for the Xft extension])
AC_ARG_ENABLE(
xft, [ --enable-xft enable support of the Xft extension @<:@default=yes@:>@])
if pkg-config xft; then
XFT2="yes"
AC_MSG_RESULT([version 2])
- CXXFLAGS="`pkg-config --cflags xft` ${CXXFLAGS}"
- LIBS="${LIBS} `pkg-config --libs xft`"
+ S_CXXFLAGS=${CXXFLAGS}
+ S_LIBS=${LIBS}
+ XFT_CFLAGS="`pkg-config --cflags xft`"
+ XFT_LIBS="`pkg-config --libs xft`"
+ CXXFLAGS="${XFT_CFLAGS} ${CXXFLAGS}"
+ LIBS="${LIBS} ${XFT_LIBS}"
+ AC_CHECK_LIB(Xft, XftFontOpenXlfd,
+ AC_MSG_CHECKING([for X11/Xft/Xft.h for Xft2])
+ AC_TRY_LINK(
+ [
+ #include <X11/Xlib.h>
+ #include <X11/Xft/Xft.h>
+ ],
+ [
+ int i = XFT_MAJOR;
+ XftFont foo;
+ ],
+ [
+ AC_MSG_RESULT([yes])
+ XFT="yes"
+ ],
+ [
+ AC_MSG_RESULT([no])
+ XFT2=""
+ AC_MSG_RESULT()
+ AC_MSG_RESULT([** WARNING: Xft support is disabled! **])
+ AC_MSG_RESULT()
+ ]
+ )
+ )
else
AC_MSG_RESULT([version 1])
- fi
-
- AC_CHECK_LIB(Xft, XftFontOpenXlfd,
- AC_MSG_CHECKING([for X11/Xft/Xft.h])
- AC_TRY_LINK(
-#include <X11/Xlib.h>
-#include <X11/Xft/Xft.h>
-, XftFont foo,
- AC_MSG_RESULT([yes])
- XFT="yes"
- test "$XFT2" = "yes" || LIBS="$LIBS -lXft"
-
- dnl Check for utf8 support in the Xft library
- dnl AC_CHECK_LIB(Xft, XftDrawStringUtf8,
- dnl XFT_UTF8="yes",
- dnl),
- ,
-
- AC_MSG_RESULT([no])
+ AC_CHECK_LIB(Xft, XftFontOpenXlfd,
+ AC_MSG_CHECKING([for X11/Xft/Xft.h for Xft1])
+ AC_TRY_LINK(
+ [
+ #include <X11/Xlib.h>
+ #include <X11/Xft/Xft.h>
+ ],
+ [
+ XftFont foo;
+ ],
+ [
+ AC_MSG_RESULT([yes])
+ XFT="yes"
+ XFT_LIBS="$LIBS -lXft"
+
+ dnl Check for utf8 support in the Xft library
+ dnl AC_CHECK_LIB(Xft, XftDrawStringUtf8,
+ dnl XFT_UTF8="yes",
+ dnl),
+ ],
+ [
+ AC_MSG_RESULT([no])
+ AC_MSG_RESULT()
+ AC_MSG_RESULT([** WARNING: Xft support is disabled! **])
+ AC_MSG_RESULT()
+ ]
+ )
)
- )
-
+ fi
else
AC_MSG_RESULT([no])
fi
if test "$XFT" = "yes"; then
+ AC_SUBST([XFT_CFLAGS])
+ AC_SUBST([XFT_LIBS])
AC_DEFINE(XFT,1,[Enable support of the Xft extension])
dnl if test "$XFT_UTF8" = "yes"; then
dnl AC_DEFINE(XFT_UTF8,1,[Support for Utf8 text in the Xft extension])