[PATCH font-util] fontutil.m4: Add XORG_FONT_FC_CONFDIR to find fontconfig's confdir

Alan Coopersmith alan.coopersmith at oracle.com
Thu Oct 7 17:17:53 PDT 2010


Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

Jeremy Huddleston wrote:
> Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
> ---
>  fontutil.m4.in |   34 ++++++++++++++++++++++++++++++++++
>  1 files changed, 34 insertions(+), 0 deletions(-)
> 
> diff --git a/fontutil.m4.in b/fontutil.m4.in
> index c867ea6..b9ad59c 100644
> --- a/fontutil.m4.in
> +++ b/fontutil.m4.in
> @@ -256,6 +256,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


-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list