[Libguestfs] [hivex][PATCH] OS X, bootstrap: Locate pkg.m4

Alex Nelson ajnelson at cs.ucsc.edu
Mon Jun 11 23:04:09 UTC 2012


On Jun 11, 2012, at 12:41 , Richard W.M. Jones wrote:

> On Mon, Jun 11, 2012 at 11:53:43AM -0700, Alex Nelson wrote:
>> 
>> On Jun 11, 2012, at 11:22 , Richard W.M. Jones wrote:
>> 
>>> On Mon, Jun 11, 2012 at 10:55:46AM -0700, Alex Nelson wrote:
>>>> OS X does not include pkg-config by default.  When installed, pkg.m4 tends
>>>> to end up in some place that is not the autotool-expected /usr/share/aclocal/.
>>>> Add to bootstrap a path check so pkg.m4 can be found, so ./configure does
>>>> not fail invoking PKG_CHECK_MODULES.
>>>> 
>>>> Signed-off-by: Alex Nelson <ajnelson at cs.ucsc.edu>
>>>> ---
>>>> bootstrap |    7 ++++++-
>>>> 1 files changed, 6 insertions(+), 1 deletions(-)
>>>> 
>>>> diff --git a/bootstrap b/bootstrap
>>>> index b2960c1..8e4cb86 100755
>>>> --- a/bootstrap
>>>> +++ b/bootstrap
>>>> @@ -85,5 +85,10 @@ $gnulib_tool			\
>>>>  --tests-base=gnulib/tests	\
>>>>  --import $modules
>>>> 
>>>> +# Locate pkg.m4 (installed in non-default location in OS X)
>>>> +# (Passing non-existent paths with -I causes aclocal, invoked by autoreconf, to die.)
>>>> +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)
>>>> +
>>>> # Disable autopoint and libtoolize, since they were already done above.
>>>> -AUTOPOINT=true LIBTOOLIZE=true autoreconf --verbose --install
>>>> +AUTOPOINT=true LIBTOOLIZE=true autoreconf --verbose -I $pkgm4dir --install
>>> 
>>> No -- the problem here is that aclocal on Mac OS X is broken.  It
>>> hasn't been configured with the correct ac-dir:
>>> 
>>> $ aclocal --print-ac-dir
>>> /usr/share/aclocal
>>> 
>>> Anyway, try setting ACLOCAL_PATH to the /opt/local/share/aclocal
>>> directory, as described in the aclocal documentation.
>> 
>> Ah, thank you, that was the kind of variable I was looking for.  I found a documenting page here:
>> http://www.gnu.org/software/automake/manual/html_node/Macro-Search-Path.html
>> 
>> Updated patch incoming.
> 
> But my point is that aclocal on Mac OS X (or maybe just the Mac
> package manager you're using) is broken.  What does 'aclocal
> --print-ac-dir' print out?  
I'm using MacPorts, which places pkg-config in /opt/local/bin, and pkg.m4 in /opt/local/share/aclocal.

In several OS X environments that use MacPorts, I've run `aclocal --print-ac-dir` and gotten '/opt/local/share/aclocal'.

I tried the v2 patch I sent separately, had it work in Fedora 15, OS X 10.7, and Ubuntu 12.04.

> It sounds as if you need to fix your
> aclocal, or if you can't do that, set ACLOCAL_PATH for your
> environment only.  No one else has /opt/local ...

So, you request ACLOCAL_PATH be set only for the Mac environment? If so, would you recommend it be done in bootstrap, or Makefile.am?

--Alex




More information about the Libguestfs mailing list