[Libguestfs] Error building nbdkit on RHEL 7.5 - possibly undefined macro: PKG_CHECK_VAR

Richard W.M. Jones rjones at redhat.com
Sat Jul 28 19:11:52 UTC 2018


On Sat, Jul 28, 2018 at 09:26:06PM +0300, Nir Soffer wrote:
> I'm trying to build upstream source on RHEL 7.5 and get this error:
> 
> # autoreconf -i
> libtoolize: putting auxiliary files in `.'.
> libtoolize: copying file `./ltmain.sh'
> libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
> libtoolize: copying file `m4/libtool.m4'
> libtoolize: copying file `m4/ltoptions.m4'
> libtoolize: copying file `m4/ltsugar.m4'
> libtoolize: copying file `m4/ltversion.m4'
> libtoolize: copying file `m4/lt~obsolete.m4'
> configure.ac:190: error: possibly undefined macro: PKG_CHECK_VAR
>       If this token and others are legitimate, please use m4_pattern_allow.
>       See the Autoconf documentation.
> autoreconf: /usr/bin/autoconf failed with exit status: 1
> 
> How to fix this? I hope I can avoid reading autoconf documentation :-)

Can confirm it also happens for me (on RHEL 7.6 nightly).

The attached patch should fix it.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html
-------------- next part --------------
>From 20caf8f5ef6cb408eff4efa48f911b18560d81d5 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones at redhat.com>
Date: Sat, 28 Jul 2018 20:09:16 +0100
Subject: [PATCH] build: Default bashcompdir when PKG_CHECK_VAR.

On RHEL 7-era autoconf:

configure.ac:190: error: possibly undefined macro: PKG_CHECK_VAR
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

Thanks: Nir Soffer
---
 configure.ac | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index f61ca1d..b87efb9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -187,8 +187,12 @@ dnl Bash completion.
 PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], [
     bash_completion=yes
     AC_MSG_CHECKING([for bash-completions directory])
-    PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir], ,
-        bashcompdir="${sysconfdir}/bash_completion.d")
+    m4_ifdef([PKG_CHECK_VAR],[
+        PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir])
+    ])
+    AS_IF([test -z "$bashcompdir"], [
+        bashcompdir="${sysconfdir}/bash_completion.d"
+    ])
     AC_MSG_RESULT([$bashcompdir])
     AC_SUBST([bashcompdir])
 ],[
-- 
1.8.3.1



More information about the Libguestfs mailing list