summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2005-08-04 16:15:48 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2005-08-04 16:15:48 +0000
commitedfb44c93c03c41f13240af318a45f0f04dde6d1 (patch)
treeb7f045b0f8b78b95d087846317453d64dfe2c745
parenta09401affaf007aef2585711cd5eb499f554be9b (diff)
downloadxorg-lib-libXft-edfb44c93c03c41f13240af318a45f0f04dde6d1.tar.gz
If --with-freetype-config is not specified, try pkgconfig freetype2, then
fall back to freetype-config if pkgconfig fails.
-rw-r--r--configure.ac24
1 files changed, 19 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 96e9576..eb9a5cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,12 +79,26 @@ no)
esac
# Check freetype configuration
-AC_CHECK_PROG(ft_config, freetype-config, freetype-config)
-if test "x$ft_config" = "x" ; then
- AC_MSG_ERROR([freetype-config not found. freetype is required. Please make sure you have the freetype development packages installed.])
+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
+ AC_MSG_ERROR([You must have freetype installed; see http://www.freetype.org/])
+ fi
+else
+ ft_config="$freetype_config"
+fi
+
+if test "$freetype_config" != "no"; then
+ FREETYPE_CFLAGS="`$ft_config --cflags`"
+ FREETYPE_LIBS="`$ft_config --libs`"
fi
-FREETYPE_CFLAGS="`$ft_config --cflags`"
-FREETYPE_LIBS="`$ft_config --libs`"
# Check fontconfig configuration
PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.2)