apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noah Misch <n...@cs.caltech.edu>
Subject Re: [PATCH] update find_ap{ru}.m4 for ap{ru}-1-config was Re: 1.0.0 RC4 (apr-config -> apr-1-config)
Date Thu, 15 Jul 2004 16:07:16 GMT
On Thu, Jul 15, 2004 at 08:09:37AM -0700, Justin Erenkrantz wrote:
> --On Thursday, July 15, 2004 5:34 AM -0700 Noah Misch 
> <noah@cs.caltech.edu> wrote:
> 
> >The minimum version field does need to accept two digits.  A project 
> >could
> >use an API added in APR 1.X, in which case e.g. APR_FIND_APR(,,, 1.4, 3)
> >would be appropriate and necessary.  No?
> 
> If a project wants that level of specificity, they can call $apr_config 
> after calling APR_FIND_APR to reject versions they find unsuitable.  But, 
> you can't have parallel installs of APR with the same major version 
> number.  -- justin

If APR_FIND_APR accepts version constraints, should it not interpret them to at
least the maximum granularity at which APR allows API changes?  I think this is
not difficult:

candidates=
for dir in /usr/local /usr /opt/apache ; do
    for c in $dir/bin/apr-config $dir/bin/apr-[[:digit:]]-config ; do
        if test -x $c; then candidates="$candidates $c"; fi
    done
done

best=
best_ver=-1
for apr_config in $candidates; do
    ver=`apr-config --version`
    if expr $ver \< $max \& $ver \> $min \& $ver \> $best_ver
       best=$apr_config
       best_ver=$ver
    fi
done
apr_config=$best
...

Mime
View raw message