From 5a85ccb1e07cacd4bb6a9e1191c7c41fd2c27b1b Mon Sep 17 00:00:00 2001 From: handa Date: Tue, 12 Oct 2004 00:23:43 +0000 Subject: [PATCH] Use pkg-config (if available) for Xft. --- configure.ac | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 3e30cd4..3507d32 100644 --- a/configure.ac +++ b/configure.ac @@ -160,17 +160,23 @@ if test "x$HAVE_FREETYPE_CONFIG" = "xyes"; then fi AC_SUBST(FREETYPE_LD_FLAGS) +AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes) + dnl Check for Xft2 usability. save_CPPFLAGS="$CPPFLAGS" save_LIBS="$LIBS" +XFT2_LD_FLAGS="-lXft -lfreetype -lfontconfig -lXrender -lX11" AC_CHECK_PROG(HAVE_XFT_CONFIG, xft-config, yes) if test "x$HAVE_XFT_CONFIG" = "xyes"; then CPPFLAGS="$CPPFLAGS `xft-config --cflags`" XFT2_LD_FLAGS="`xft-config --libs`" - LIBS="$LIBS $XFT2_LD_FLAGS" -else - XFT2_LD_FLAGS="-lXft -lfreetype -lfontconfig -lXrender -lX11" +elif test "x$HAVE_PKG_CONFIG" = "xyes" ; then + if pkg-config xft ; then + CPPFLAGS="$CPPFLAGS `pkg-config --cflags xft`" + XFT2_LD_FLAGS="`pkg-config --libs xft`" + fi fi +LIBS="$LIBS $XFT2_LD_FLAGS" AC_CHECK_LIB(Xft, XftDrawCreate, HAVE_XFT2=yes, HAVE_XFT2=no) AC_CHECK_HEADER(X11/Xft/Xft.h,, HAVE_XFT2=no, [#include @@ -192,7 +198,6 @@ dnl Check for fontconfig usability. save_CPPFLAGS="$CPPFLAGS" save_LIBS="$LIBS" FONTCONFIG_LD_FLAGS=-lfontconfig -AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes) if test "x$HAVE_PKG_CONFIG" = "xyes"; then if pkg-config --exists fontconfig; then CPPFLAGS="$CPPFLAGS `pkg-config --cflags fontconfig`" -- 1.7.10.4