bug-cfengine
[Top][All Lists]
Advanced

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

RE: 2.0.1 configure fails on FreeBSD, patch included


From: Tim Auckland
Subject: RE: 2.0.1 configure fails on FreeBSD, patch included
Date: Mon, 22 Apr 2002 12:37:30 -0700

Three or four, or twenty library locations shouldn't slow configure down
too much.

Something like this could be used, though someone who knows the actual
requirements will have to fill in the "is_good_enough" test.
 
# As many likely places as we can think of
PossibleHeaders="/usr/include/db.h /usr/include/*/db.h \
    /usr/local/include/db.h /usr/local/BerkleyDB*/include/*.h \
    /tools/pkgs/db/*/include/db.h"

PossibleLibs="/usr/lib/libdb* /usr/local/lib/libdb* \
    /usr/local/BerkleyDB*/lib/libdb* /tools/pkgs/db/*/lib/libdb*"

# Strip out false leads and crudely sort by version
KnownHeaders=`egrep 2>/dev/null DB_VERSION_STRING $PossibleHeaders \
    | sort -r +8 | awk -F: '{print $1'}`

# Strip out missing libs
KnownLibs=`ls 2>/dev/null $PossibleLibs`

for h in $KnownHeaders
do
    v=`sed -n '/DB_VERSION_STRING/{s/[^"]*"//;s/"//p;}' $h`
    for l in $KnownLibs
    do
        if grep "$v" $l >/dev/null
        then # lib matches header 
            #
            # Test Lib/Header combination for functionality
            #
            if is_good_enough $h $l
            then
                LibLoc=`dirname $l`
                LibName=`basename $l | sed 's/^lib//;s/\.\(a\|so\)$//'`
                break 2
            fi
        else
            echo "no"
        fi
    done
done

echo "-L $LibLoc -l $LibName"


Tim

> -----Original Message-----
> From: address@hidden [mailto:address@hidden 
> Sent: Monday, April 22, 2002 11:33 AM
> To: Tim Auckland
> Cc: address@hidden
> Subject: Re: 2.0.1 configure fails on FreeBSD, patch included
> 
> 
> 
> But first you need to know where to look for it!! So far
> I have seen three or four conventions for placing headers and 
> libraries.
> 
> M
> 
> On 22 Apr, Tim Auckland wrote:
> > This may be a bit crude, but you could match header with library by 
> > grep-ing for the version string, eg:
> > 
> > $ egrep -i DB_VERSION_STRING /usr/include/db3/db.h   
> > #define DB_VERSION_STRING       "Sleepycat Software: 
> Berkeley DB 3.2.9:
> > (January 24, 2001)"
> > 
> > $ grep 'Sleepycat Software: Berkeley DB 3.2.9: (January 24, 2001)' 
> > /usr/lib/libdb-3.2.so Binary file /usr/lib/libdb-3.2.so matches
> > 
> > Tim
> > 
> >> -----Original Message-----
> >> From: address@hidden [mailto:address@hidden
> >> Sent: Monday, April 22, 2002 9:27 AM
> >> To: Tim Auckland
> >> Cc: address@hidden
> >> Subject: Re: 2.0.1 configure fails on FreeBSD, patch included
> >> 
> >> 
> >> 
> >> The problem is not so much testing for the features as
> >> finding the libs which contain them and matching header file 
> >> with library,
> >> 
> >> Mark
> >> 
> >> 
> >> On 22 Apr, Tim Auckland wrote:
> >> >> >> Anyone volunteering? I've enough other stuff to do...
> >> >> >
> >> >> > High on my TODO list for this week (No. 2 after
> >> something a little
> >> >> > more pressing).
> >> >> >
> >> >> > Mike.
> >> >> 
> >> >> Wonderful, that makes 3 people, I think. But note
> >> carefully, that not
> >> >> all of the distributed db libraries work, because
> >> sleepycat changed
> >> >> the API in version 3.x something. That is what makes this all so
> >> >> difficult.
> >> > 
> >> > Autoconf can test for most API features directly.  If 
> you know what
> >> > features you depend on, you should just be able to scan all the 
> >> > plausible library install locations and pick the first one 
> >> that works,
> >> > and not worry about picking the *best* one.
> >> > 
> >> > Tim
> >> > 
> >> > _______________________________________________
> >> > Bug-cfengine mailing list
> >> > address@hidden
> >> http://mail.gnu.org/mailman/listinfo/bug-> cfengine
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >> Work: +47 22453272            Email:  address@hidden
> >> Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
> >> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >> ~
> >> 
> >> 
> >> 
> > 
> > _______________________________________________
> > Bug-cfengine mailing list
> > address@hidden 
> http://mail.gnu.org/mailman/listinfo/bug-> cfengine
> 
> 
> 
> 
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Work: +47 22453272            Email:  address@hidden
> Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> 



reply via email to

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