* configure.ac: Replace ad hoc test for fontconfig with one using PKG_CHECK_MODULES --- configure.ac | 39 +++++++-------------------------------- 1 file changed, 7 insertions(+), 32 deletions(-)
diff --git a/configure.ac b/configure.ac index fe7f6b9..d66f06a 100644 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,9 @@ AC_INIT([gnu-ghostscript], [9.06.0], [gnu-ghostscript-...@gnu.org]) AC_CONFIG_SRCDIR(psi/gs.c) AM_INIT_AUTOMAKE([-Wall]) +PKG_PROG_PKG_CONFIG +m4_pattern_forbid([PKG_CHECK_MODULES]) + dnl Inherit compiler flags from the environment... CFLAGS="${CFLAGS:=}" CPPFLAGS="${CPPFLAGS:=}" @@ -493,39 +496,11 @@ if test x$with_libpaper != xno; then CFLAGS="$CFLAGS -DUSE_LIBPAPER" fi -dnl Fontconfig support -HAVE_FONTCONFIG="" -FONTCONFIG_CFLAGS="" -FONTCONFIG_LIBS="" -AC_ARG_ENABLE([fontconfig], AC_HELP_STRING([--disable-fontconfig], - [Do not use fontconfig to list system fonts])) -if test "$enable_fontconfig" != "no"; then - # We MUST NOT use PKG_CHECK_MODULES since it is a) not a standard - # autoconf macro and b) requires pkg-config on the system, which is - # NOT standard on ANY OS, including Linux! - if test "x$PKGCONFIG" != x; then - AC_MSG_CHECKING(for fontconfig with pkg-config) - if $PKGCONFIG --exists fontconfig; then - AC_MSG_RESULT(yes) - FONTCONFIG_CFLAGS="$CFLAGS `$PKGCONFIG --cflags fontconfig`" - FONTCONFIG_LIBS="`$PKGCONFIG --libs fontconfig`" - HAVE_FONTCONFIG=-DHAVE_FONTCONFIG - else - AC_MSG_RESULT(no) - fi - fi - if test -z "$HAVE_FONTCONFIG"; then - AC_CHECK_LIB([fontconfig], [FcInitLoadConfigAndFonts], [ - AC_CHECK_HEADER([fontconfig/fontconfig.h], [ - FONTCONFIG_LIBS="-lfontconfig" - HAVE_FONTCONFIG="-DHAVE_FONTCONFIG" - ]) - ]) - fi -fi +PKG_CHECK_MODULES([FONTCONFIG], [fontconfig], + [HAVE_FONTCONFIG="-DHAVE_FONTCONFIG"], + [AC_MSG_ERROR([fontconfig must be installed])]) + AC_SUBST(HAVE_FONTCONFIG) -AC_SUBST(FONTCONFIG_CFLAGS) -AC_SUBST(FONTCONFIG_LIBS) dnl DBus support HAVE_DBUS="" -- 1.7.10.4