2 # Copyright (c) 2002 Henrik Kinnunen (fluxgen at linuxmail.org)
4 # Permission is hereby granted, free of charge, to any person obtaining a
5 # copy of this software and associated documentation files (the "Software"),
6 # to deal in the Software without restriction, including without limitation
7 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 # and/or sell copies of the Software, and to permit persons to whom the
9 # Software is furnished to do so, subject to the following conditions:
11 # The above copyright notice and this permission notice shall be included in
12 # all copies or substantial portions of the Software.
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 # DEALINGS IN THE SOFTWARE.
22 # AM_PATH_XFT1([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
23 AC_DEFUN([AM_PATH_XFT1],
25 AC_CHECK_LIB(Xft, XftFontOpen,
32 # AM_PATH_XFT2([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
33 AC_DEFUN([AM_PATH_XFT2],
35 if test x$pkg_exec_prefix != x ; then
36 xft_args="$xft_args --exec-prefix=$pkg_exec_prefix"
37 if test x${PKG_CONFIG+set} != xset ; then
38 PKG_CONFIG=$pkg_exec_prefix/bin/pkg-config
42 if test x$xft_prefix != x ; then
43 xft_args="$xft_args --prefix=$xft_prefix"
44 if test x${PKG_CONFIG+set} != xset ; then
45 PKG_CONFIG=$xft_prefix/bin/pkg-config
49 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
50 if test "x$PKG_CONFIG" = "xno" ; then
51 ifelse([$2], , :, [$2])
53 XFT_CFLAGS=`$PKG_CONFIG $xftconf_args --cflags xft`
54 XFT_LIBS=`$PKG_CONFIG $xftconf_args --libs xft`
55 ifelse([$1], , :, [$1])
60 # AM_PATH_XFT(default-value, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
61 # Test for Xft, and define XFT_CFLAGS and XFT_LIBS
62 AC_DEFUN([AM_PATH_XFT],
64 AC_ARG_WITH(xft-prefix,[ --with-xft-prefix=path Prefix where Xft is installed (optional)],
65 xft_prefix="$withval", xft_prefix="")
66 AC_ARG_WITH(pkg-exec-prefix,[ --with-pkg-exec-prefix=path Exec prefix where pkg-config is installed (optional)],
67 pkg_exec_prefix="$withval", pkg_exec_prefix="")
68 AC_ARG_ENABLE(xft, [ --enable-xft Xft (antialias) support (default=$1)],
69 if test "x$enableval" = "xyes"; then
78 if test "x$TRY_XFT" = "xyes"; then
82 # xft2 failed: try xft1
86 AC_MSG_RESULT([Cant find Xft libraries! Disabling Xft]))
93 CFLAGS="$CFLAGS $XFT_CFLAGS"
94 CXXFLAGS="$CXXFLAGS $XFT_CFLAGS"
95 LIBS="$LIBS $XFT_LIBS"