summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-09-14 11:56:19 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-09-14 11:56:19 -0700
commite3141fcf8456dc1ec7455e34437ac09f0c812ac9 (patch)
treec011d75d4f8db85fb3091c739d9f3bdc8f14f611 /configure.ac
parent2f294edf3a601c612e0a4c208539e842d790a894 (diff)
downloademacs-e3141fcf8456dc1ec7455e34437ac09f0c812ac9.tar.gz
* configure.ac: Port to hosts lacking gtk.
(PKG_CHECK_MODULES): Capture pkg-config diagnostics better, in particular, problems in invoking pkg-config itself. This is useful on hosts that don't have pkg-config. (GTK_MODULES): Do not exit 'configure' simply because gtk3 and gtk2 are both missing. Problem found on Solaris 8.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 8 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index ce65f07522d..accbb68e7b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1189,9 +1189,10 @@ AC_DEFUN([PKG_CHECK_MODULES], [
$1_CFLAGS=""
$1_LIBS=""
## If we have a custom action on failure, don't print errors, but
- ## do set a variable so people can do so.
- $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
- ifelse([$4], ,echo $$1_PKG_ERRORS,)
+ ## do set a variable so people can do so. Do it in a subshell
+ ## to capture any diagnostics in invoking pkg-config.
+ $1_PKG_ERRORS=`($PKG_CONFIG --print-errors "$2") 2>&1`
+ ifelse([$4], ,echo "$$1_PKG_ERRORS",)
fi
AC_SUBST($1_CFLAGS)
@@ -1934,10 +1935,10 @@ if test "${with_gtk2}" = "yes" || test "$check_gtk2" = "yes"; then
dnl Checks for libraries.
PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
- if test "$pkg_check_gtk" = "no"; then
- if test "$USE_X_TOOLKIT" = "maybe" || test "$with_gtk" = "yes" || test "$with_gtk2" = "yes"; then
- AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS)
- fi
+ if test "$pkg_check_gtk" = "no" &&
+ { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; }
+ then
+ AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS)
fi
fi