From: Tollef Fog Heen Date: Sun, 16 Oct 2005 17:51:24 +0000 (+0000) Subject: Use --short-errors if it's available. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=979c89dcb643e6cd14947945b0cba23f8f9a6ab7;p=pkg-config Use --short-errors if it's available. --- diff --git a/ChangeLog b/ChangeLog index ed12518..78518de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2005-10-16 Tollef Fog Heen + * pkg.m4: Use --short-errors if it's available. + * pkg.c (get_package_quiet): Add get_package_quiet which is just the same as get_package except it sets warn to false. diff --git a/pkg.m4 b/pkg.m4 index 3c20213..251a62d 100644 --- a/pkg.m4 +++ b/pkg.m4 @@ -79,6 +79,18 @@ else fi[]dnl ])# _PKG_CONFIG +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # @@ -101,12 +113,20 @@ _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) if test $pkg_failed = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD ifelse([$4], , [AC_MSG_ERROR(dnl -[Package requirements ($2) were not met. +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix.