summaryrefslogtreecommitdiff
path: root/build/find_apr.m4
diff options
context:
space:
mode:
authorColm MacCarthaigh <colm@apache.org>2005-12-15 00:15:52 +0000
committerColm MacCarthaigh <colm@apache.org>2005-12-15 00:15:52 +0000
commit7d3fb85fda9794a837cdf54128579d54b022fbf1 (patch)
treeede6d3c43148381bb2aaec53c64cdc4c23f7428a /build/find_apr.m4
parent0783452c66812635df49f3c31026e7d0830edb25 (diff)
downloadapr-7d3fb85fda9794a837cdf54128579d54b022fbf1.tar.gz
Add a 5th argument to the APR_FIND_APR and the APR_FIND_APU macros which
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
Diffstat (limited to 'build/find_apr.m4')
-rw-r--r--build/find_apr.m445
1 files changed, 40 insertions, 5 deletions
diff --git a/build/find_apr.m4 b/build/find_apr.m4
index 2f7a95fc8..6962f38b3 100644
--- a/build/find_apr.m4
+++ b/build/find_apr.m4
@@ -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.
@@ -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"
@@ -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
@@ -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