Skip to content

Commit

Permalink
Add a 5th argument to the APR_FIND_APR and the APR_FIND_APU macros which
Browse files Browse the repository at this point in the history
accepts a macro to perform a detailed check on each installed copy of
apr/apr-util.


git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@356957 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
colmmacc committed Dec 15, 2005
1 parent 0783452 commit 7d3fb85
Showing 1 changed file with 40 additions and 5 deletions.
45 changes: 40 additions & 5 deletions build/find_apr.m4
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ dnl library. It provides a standardized mechanism for using APR. It supports
dnl embedding APR into the application source, or locating an installed
dnl copy of APR.
dnl
dnl APR_FIND_APR(srcdir, builddir, implicit-install-check, acceptable-majors)
dnl APR_FIND_APR(srcdir, builddir, implicit-install-check, acceptable-majors,
dnl detailed-check)
dnl
dnl where srcdir is the location of the bundled APR source directory, or
dnl empty if source is not bundled.
Expand All @@ -38,6 +39,14 @@ dnl If multiple versions are specified, and --with-apr=PREFIX or the
dnl implicit installed search are used, then the first (leftmost) version
dnl in the list that is found will be used. Currently defaults to [0 1].
dnl
dnl where detailed-check is an M4 macro which sets the apr_acceptable to
dnl either "yes" or "no". The macro will be invoked for each installed
dnl copy of APR found, with the apr_config variable set appropriately.
dnl Only installed copies of APR which are considered acceptable by
dnl this macro will be considered found. If no installed copies are
dnl considered acceptable by this macro, apr_found will be set to either
dnl either "no" or "reconfig".
dnl
dnl Sets the following variables on exit:
dnl
dnl apr_found : "yes", "no", "reconfig"
Expand Down Expand Up @@ -100,16 +109,28 @@ AC_DEFUN([APR_FIND_APR], [
for lookdir in "$withval/bin" "$withval"
do
if $TEST_X "$lookdir/$apr_temp_apr_config_file"; then
apr_found="yes"
apr_config="$lookdir/$apr_temp_apr_config_file"
ifelse([$5], [], [], [
apr_acceptable="yes"
$5
if test "$apr_acceptable" != "yes"; then
AC_MSG_WARN([Found APR in $apr_config, but we think it is considered unacceptable)
continue
fi])
apr_found="yes"
break 2
fi
done
done
if test "$apr_found" != "yes" && $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then
apr_found="yes"
apr_config="$withval"
ifelse([$5], [], [apr_found="yes"], [
apr_acceptable="yes"
$5
if test "$apr_acceptable" = "yes"; then
apr_found="yes"
fi])
fi
dnl if --with-apr is used, it is a fatal error for its argument
Expand All @@ -123,15 +144,29 @@ AC_DEFUN([APR_FIND_APR], [
for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config
do
if $apr_temp_apr_config_file --help > /dev/null 2>&1 ; then
apr_found="yes"
apr_config="$apr_temp_apr_config_file"
ifelse([$5], [], [], [
apr_acceptable="yes"
$5
if test "$apr_acceptable" != "yes"; then
AC_MSG_WARN([Found APR in $apr_config, but we think it's bad])
continue
fi])
apr_found="yes"
break
else
dnl look in some standard places
for lookdir in /usr /usr/local /usr/local/apr /opt/apr; do
if $TEST_X "$lookdir/bin/$apr_temp_apr_config_file"; then
apr_found="yes"
apr_config="$lookdir/bin/$apr_temp_apr_config_file"
ifelse([$5], [], [], [
apr_acceptable="yes"
$5
if test "$apr_acceptable" != "yes"; then
AC_MSG_WARN([Found APR in $apr_config, but we think it's bad])
continue
fi])
apr_found="yes"
break 2
fi
done
Expand Down

0 comments on commit 7d3fb85

Please sign in to comment.