On Thu, Jul 15, 2004 at 08:09:37AM -0700, Justin Erenkrantz wrote:
> --On Thursday, July 15, 2004 5:34 AM -0700 Noah Misch
> <[EMAIL PROTECTED]> 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
...