From 5cad514d15c61cdf73a7dbd6d88f3e823a0d2d99 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Wed, 6 Oct 2010 16:59:20 -0700 Subject: fontutil.m4: Add XORG_FONT_FC_CONFDIR to find fontconfig's confdir Signed-off-by: Jeremy Huddleston Acked-by: Gaetan Nadon Reviewed-by: Alan Coopersmith --- fontutil.m4.in | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/fontutil.m4.in b/fontutil.m4.in index 6c0d132..b2b9bd8 100644 --- a/fontutil.m4.in +++ b/fontutil.m4.in @@ -266,6 +266,40 @@ AC_DEFUN([XORG_FONT_UCS2ANY],[ +# XORG_FONT_FC_CONFDIR() +# -------------------- +# Minimum version: 1.2.0 +# +# Sets FC_CONFDIR to the fontconfig config directory +# (which should be --with-confdir=... when building fontconfig) +# found from: +# --with-fc-confdir=... +# pkg-config --variable=confdir fontconfig +# ${sysconfdir}/fonts + +AC_DEFUN([XORG_FONT_FC_CONFDIR],[ + dnl Ensure $PKG_CONFIG is set first + AC_REQUIRE([PKG_PROG_PKG_CONFIG]) + + AC_MSG_CHECKING([for fontconfig's configuration directory]) + AC_ARG_WITH(fc-confdir, + AS_HELP_STRING([--with-fc-confdir=DIR], + [Path to fontconfig's configuration directory]), + [FC_CONFDIR="$withval"]) + # if --with-fc-confdir was not specified + if test "x${FC_CONFDIR}" = "x"; then + FC_CONFDIR=`$PKG_CONFIG --variable=confdir fontconfig` + fi + # ...and if pkg-config didn't find confdir in fontconfig.pc... + if test "x${FC_CONFDIR}" = "x"; then + FC_CONFDIR="${sysconfdir}/fonts" + fi + AC_SUBST(FC_CONFDIR) + AC_MSG_RESULT([${FC_CONFDIR}]) +]) + + + # XORG_FONTROOTDIR() # -------------------- # Minimum version: 1.1.0 -- cgit v1.2.3