summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn <sabetts@juicebox>2008-05-25 01:00:11 -0700
committerShawn <sabetts@juicebox>2008-05-25 01:00:11 -0700
commit76c0bd55bd31b70bc0cbfd198613c09be4acd9b5 (patch)
treed2b169a16e3af4ade23569796757802fdafe4d5f
parentbf8dc854fbb0c258c67735153c18903aeb467c60 (diff)
downloadratpoison-76c0bd55bd31b70bc0cbfd198613c09be4acd9b5.zip
use PKG_CHECK_MODULES to detect xft
-rw-r--r--configure.in30
1 files changed, 17 insertions, 13 deletions
diff --git a/configure.in b/configure.in
index c850575..927fe7c 100644
--- a/configure.in
+++ b/configure.in
@@ -42,19 +42,23 @@ AC_ARG_WITH(xterm, [ --with-xterm=PROG set the x terminal emulator used b
term_prog=$withval, term_prog="xterm")
AC_DEFINE_UNQUOTED(TERM_PROG, "$term_prog", X terminal emulator to use)
-dnl Use the Xft library if desired.
-AC_MSG_CHECKING(whether to use Xft)
-AC_ARG_WITH(xft,
- AC_HELP_STRING([--with-xft], [use the Xft library for fonts]),
- [if test "x$withval" != "xno"; then
- AC_DEFINE_UNQUOTED(USE_XFT_FONT, 1, [Define this to use Xft])
- CFLAGS="$CFLAGS `pkg-config --cflags xft`"
- LDFLAGS="$LDFLAGS `pkg-config --libs xft`"
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- fi],
- [AC_MSG_RESULT(no)])
+dnl Configure Xft. If it's found then use it unless explicitely disabled
+PKG_CHECK_MODULES([XFT], [xft],,[noop=noop])
+
+if test -z "$XFT_PKG_ERRORS"; then
+ AC_MSG_CHECKING(whether to use Xft)
+ AC_ARG_WITH(xft, AC_HELP_STRING([--without-xft], [Don't use the Xft library even if available]),
+ xft=$withval, xft=yes)
+
+ if test "x$xft" != "xno"; then
+ AC_DEFINE_UNQUOTED(USE_XFT_FONT, 1, [Define this to use Xft])
+ CFLAGS="$CFLAGS $XFT_CFLAGS"
+ LDFLAGS="$LDFLAGS $XFT_LIBS"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+fi
dnl Checks for programs.
AC_CHECK_TOOL(CC, gcc)