[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shell quote bug in ax_boost_base

From: Jaap Eldering
Subject: Re: shell quote bug in ax_boost_base
Date: Wed, 11 Aug 2010 16:10:49 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Tue, Aug 10, 2010 at 03:31:20PM +0200, Jaap Eldering wrote:
> On Tue, Aug 10, 2010 at 03:17:53PM +0200, Peter Simons wrote:
> > Hi Jaap,
> > 
> >  > I also noticed that this script fails to automatically find the
> >  > default boost installation under the Debian amd64 architecture,
> >  > because the libraries are in /usr/lib and not in /usr/lib64.
> > 
> > Can you, by any chance, come up with a fix for this problem, too?
> I'll have a look, but I'm not proficient in M4sh so someone certainly
> will have to review it for correctness and cleanliness.

The script is mostly POSIX shell code, so it didn't take too much
time. Attached are two patches.

The first adresses the error reporting I got when the autoconf code
couldn't find the libraries: $ax_lib is looped over all possible
versions of a boost library, but if it's looking in the wrong dir,
then this list is empty, hence $ax_lib unset afterwards, which gives a
very unclear error "Could not link against  !"

The second patch addresses the lib/lib64 problem. I've tried to make
minimal changes while making the code non-platform-specific. Instead
of choosing a fixed $libsubdir of either 'lib' or 'lib64' depending on
'uname -m', it is tried from a list $libsubdirs and for each element,
if any file .../$libsubdir/libboost_* is found, it is assumed that
$libsubdir is correct. When none is found, $libsubdir will still have
the value of the last element of the $libsubdirs list. Therefore, for
x86_64 the list is: 'lib64 lib lib64'; first try lib64 (as lib might
contain less preferred 32bit library versions), then lib, then default
to lib64 if nothing found.

I've assumed that 'ls' returns exitcode != 0 when the shell pattern
does not expand (i.e. no matching files), which seems specified by POSIX:

I have succesfully tested this with boost_regex on:
- Debian Lenny with x86_86 (amd64) kernel+userland
- Debian Lenny with amd64 kernel and i386 userland
- Scientific Linux (Redhat EL) release 5.5 on x86_64 kernel+userland

Furthermore, as a minor cosmetic thing, I noticed inconsistent
tab/space use for indentation in these files, messing up display.


Attachment: 0001-Add-check-to-see-if-any-library-is-found.patch
Description: Text Data

Attachment: 0002-On-x86_64-architecture-search-both-lib64-and-lib-dir.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]