summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2005-08-04 16:15:46 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2005-08-04 16:15:46 +0000
commit4a2f7ae2f3317e53d99daf15ad362230388949d4 (patch)
tree26b9d67b3dc5b8fdb475f561da5e1986809861b0
parent0c52dd6f8816a72d8309f0b059afb0c3393f17cf (diff)
If --with-freetype-config is not specified, try pkgconfig freetype2, then
fall back to freetype-config if pkgconfig fails.
-rw-r--r--configure.ac15
1 files changed, 11 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 504a974..528e52a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,8 +66,13 @@ AC_ARG_ENABLE(freetype, [ --disable-freetype],[XFONT_FREETYPE=$enableval],[XFONT
AM_CONDITIONAL(XFONT_FREETYPE, [test x$XFONT_FREETYPE = xyes])
if test x$XFONT_FREETYPE = xyes; then
AC_DEFINE(XFONT_FREETYPE,1,[Support FreeType rasterizer for nearly all font file formats])
- AC_ARG_WITH(freetype-config, [ --with-freetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=yes)
+ AC_ARG_WITH(freetype-config, [ --with-freetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=auto)
+ if test "$freetype_config" = "auto" ; then
+ PKG_CHECK_MODULES(FREETYPE, freetype2,
+ freetype_config=no, freetype_config=yes)
+ fi
+
if test "$freetype_config" = "yes"; then
AC_PATH_PROG(ft_config,freetype-config,no)
if test "$ft_config" = "no"; then
@@ -76,9 +81,11 @@ if test x$XFONT_FREETYPE = xyes; then
else
ft_config="$freetype_config"
fi
-
- FREETYPE_CFLAGS="`$ft_config --cflags`"
- FREETYPE_LIBS="`$ft_config --libs`"
+
+ if test "$freetype_config" != "no"; then
+ FREETYPE_CFLAGS="`$ft_config --cflags`"
+ FREETYPE_LIBS="`$ft_config --libs`"
+ fi
XFONT_FONTFILE=yes
else
FREETYPE_CFLAGS=""