From fcdcf0d60ea52a4cfd636046e049c11cdc4497a9 Mon Sep 17 00:00:00 2001
From: Russ Allbery <rra@debian.org>
Date: Thu, 22 Sep 2016 23:44:02 +0200
Subject: [PATCH] Make PKG_CHECK_MODULES report the module name instead of the
 variable prefix
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In Autoconf output from PKG_CHECK_MODULES in pkg.m4, the "checking for"
message refers to the first argument of PKG_CHECK_MODULES, the variable
prefix, instead of the second argument, the module being checked for.

This results in strange output (like ALL CAPS module names) in various
packages. And when probing for modules, one can't always use a variable
prefix that matches the module name (since ‘-’ and other characters
aren't allowed in variable names), so the Autoconf output is going to
refer to something odd.

The status output should reference the module name being probed for,
both because it looks nicer and because, when debugging problems, this
references the actual thing being probed for on the system, rather than
an internal implementation detail.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
---
 pkg.m4.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg.m4.in b/pkg.m4.in
index eb44361..2b341dd 100644
--- a/pkg.m4.in
+++ b/pkg.m4.in
@@ -142,7 +142,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
 
 pkg_failed=no
-AC_MSG_CHECKING([for $1])
+AC_MSG_CHECKING([for $2])
 
 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
-- 
2.9.3

