[Libguestfs] [hivex] OS X: Augment pkg-config search path

Alex Nelson ajnelson at cs.ucsc.edu
Fri Jun 8 22:20:28 UTC 2012


Hello all,

I found OS X still has one remaining issue in the autotools.  OS X does not include pkg-config by default, and whatever mechanism installs it places pkg.m4 in some location among:

/opt/local/share/aclocal/pkg.m4
/usr/local/share/aclocal/pkg.m4

PKG_CHECK_MODULES isn't defined if pkg.m4 isn't in /usr/share/aclocal, so ./configure dies without augmenting aclocal's search path.

My question:  What is the proper way to augment this path?  I see two options available, one at the top of hivex/Makefile.am:
ACLOCAL_AMFLAGS = -I m4 -I /opt/local/share/aclocal

And one at the bottom of hivex/bootstrap:
AUTOPOINT=true LIBTOOLIZE=true autoreconf --verbose -I /opt/local/share/aclocal --install

I just hard-coded one path into those example lines, as I'm simply not sure what the PATH variable I should use is.  aclocal dies if a non-existent path component is passed with -I.  If I understand correctly, PKG_CONFIG_PATH doesn't appear to be used for finding the base pkg-config macros.

I can somewhat find the path in bootstrap with this clunky line:
pkgm4dir=$(test -f /opt/local/share/aclocal/pkg.m4 && dirname /opt/local/share/aclocal/pkg.m4)||$(test -f /usr/local/share/aclocal/pkg.m4 && dirname /usr/local/share/aclocal/pkg.m4)||$(test -f /usr/share/aclocal/pkg.m4 && dirname /usr/share/aclocal/pkg.m4)

But I suspect there's a better way.  Can someone help with what this would be?

--Alex




More information about the Libguestfs mailing list