Colm and I made the following change to allow a program to define an
'acceptability' check when we're searching for APR.  For httpd, this is
useful to skip APR 1.1 installs when we really just want 1.2 installs;
rather than doing that sub-version check after we found an acceptable
version.

Anyone see any improvements we can make to this?

Otherwise, I'll commit this and its related apr-util changes in the next
day or so.

Thanks.  -- justin
Index: build/find_apr.m4
===================================================================
--- build/find_apr.m4   (revision 355778)
+++ build/find_apr.m4   (working copy)
@@ -100,16 +100,28 @@
       for lookdir in "$withval/bin" "$withval"
       do
         if $TEST_X "$lookdir/$apr_temp_apr_config_file"; then
+          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's bad])
+            continue
+          fi])
           apr_found="yes"
-          apr_config="$lookdir/$apr_temp_apr_config_file"
           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 +135,29 @@
       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_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"
-          apr_config="$apr_temp_apr_config_file"
           break
         else
           dnl look in some standard places
           for lookdir in /usr /usr/local /usr/local/apr /opt/apr 
/usr/local/apache2; do
             if $TEST_X "$lookdir/bin/$apr_temp_apr_config_file"; then
+              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"
-              apr_config="$lookdir/bin/$apr_temp_apr_config_file"
               break 2
             fi
           done
Index: configure.in
===================================================================
--- configure.in        (revision 355778)
+++ configure.in        (working copy)
@@ -61,7 +61,8 @@
 
 echo $ac_n "${nl}Configuring Apache Portable Runtime library ...${nl}"
 
-APR_FIND_APR("$srcdir/srclib/apr", "./srclib/apr", 1, 1)
+APR_FIND_APR("$srcdir/srclib/apr", "./srclib/apr", 1, 1,
+            [APACHE_CHECK_APxVER([apr], 1, 2, [], [apr_acceptable="no"])])
 
 if test "$apr_found" = "no"; then
   AC_MSG_ERROR([APR not found.  Please read the documentation.])
@@ -315,18 +316,6 @@
 AC_ISC_POSIX
 AC_MINIX
 
-# Ensure that satisfactory versions of apr and apr-util are 
-# found if external copies are configured.
-if test "${apr_found}" = "yes"; then
-  # Require APR 1.2.x otherwise fail
-  APACHE_CHECK_APxVER([apr], 1, 2)
-fi
-
-if test "${apu_found}" = "yes"; then
-  # Require APR-util 1.2.x otherwise fail
-  APACHE_CHECK_APxVER([apu], 1, 2)
-fi
-
 dnl Check for what we can generate dependency files with
 APR_CHECK_DEPEND
 

Reply via email to