You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Jani Averbach <ja...@cc.jyu.fi> on 2002/10/22 16:16:53 UTC

[PATCH] for bug #911 (ac-helper/apr.m4)

Hi!

Here is a small patch for #911.

BR, Jani

Log:

Patch for #911. Two notes:
1) The correct place for check is configure, not
   build/buildcheck.sh (IMHO and Greg Hudson was agreed about that on IRC).
2) There is no --version for apr-util (apu-config), and this seems to be a
   bug. When there is apu-config --version, patch for
   ac-helpers/aprutil.m4 will be very much copy paste of that.

* ac-helpers.apr.m4: Check that we have correct version of apr at config
  time. At the moment wanted version is 0.9.1 or 0.9.2.

Index: ac-helpers/apr.m4
===================================================================
--- ac-helpers/apr.m4   (revision 3433)
+++ ac-helpers/apr.m4   (working copy)
@@ -1,3 +1,6 @@
+
+  apr_version="`$apr_config --version`"
+
 dnl
 dnl  SVN_LIB_APR(version)
 dnl
@@ -23,6 +26,30 @@

   dnl Get build information from APR

+  apr_version="`$apr_config --version`"
+
+  apr_ver_major=`echo $apr_version|sed --silent 's/\([[0-9]][[0-9]]*\)\..*/\1/p'`
+  apr_ver_minor=`echo $apr_version|sed --silent 's/[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)\..*/\1/p'`
+  apr_ver_patch=`echo $apr_version|sed --silent 's/[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)/\1/p'`
+
+  apr_ver_status="bad"
+  if test -z "$apr_ver_major"; then
+     :
+  elif test "$apr_ver_major" -eq 0; then
+     if test -z "$apr_ver_minor"; then
+        :
+     elif test "$apr_ver_minor" -eq 9; then
+        if test -z "$apr_ver_patch"; then
+          :
+        elif test "$apr_ver_patch" -gt 0 -a "$apr_ver_patch" -lt 3; then
+           apr_ver_status="good"
+        fi
+     fi
+  fi
+  if test $apr_ver_status != "good"; then
+        AC_MSG_ERROR([Need apr-version 0.9.2 or better, you have $apr_version])
+  fi
+
   CPPFLAGS="$CPPFLAGS `$apr_config --cppflags`"
   if test $? -ne 0; then
     AC_MSG_ERROR([apr-config --cppflags failed])

-- 
Jani Averbach


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] for bug #911 (ac-helper/apr.m4) (2nd version)

Posted by Jani Averbach <ja...@cc.jyu.fi>.

This is second version of the patch. With this version, you can change
wanted apr version range more easier. Also error message will
automatically respect those settings.

There is also one extra unneeded apr_version="`$apr_config --version`" at
the beginning of the first patch.


BR, Jani


Index: ac-helpers/apr.m4
===================================================================
--- ac-helpers/apr.m4   (revision 3433)
+++ ac-helpers/apr.m4   (working copy)
@@ -7,6 +7,9 @@

 AC_DEFUN(SVN_LIB_APR,
 [
+  apr_min_want_ver_patch=1
+  apr_max_want_ver_patch=2
+
   AC_MSG_NOTICE([Apache Portable Runtime (APR) library configuration])

   APR_FIND_APR("$srcdir/apr", "./apr")
@@ -23,6 +26,30 @@

   dnl Get build information from APR

+  apr_version="`$apr_config --version`"
+
+  apr_ver_major=`echo $apr_version|sed --silent 's/\([[0-9]][[0-9]]*\)\..*/\1/p'`
+  apr_ver_minor=`echo $apr_version|sed --silent 's/[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)\..*/\1/p'`
+  apr_ver_patch=`echo $apr_version|sed --silent 's/[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)/\1/p'`
+
+  apr_ver_status="bad"
+  if test -z "$apr_ver_major"; then
+     :
+  elif test "$apr_ver_major" -eq 0; then
+     if test -z "$apr_ver_minor"; then
+        :
+     elif test "$apr_ver_minor" -eq 9; then
+        if test -z "$apr_ver_patch"; then
+          :
+        elif test "$apr_ver_patch" -ge $apr_min_want_ver_patch -a "$apr_ver_patch" -le $apr_max_want_ver_patch; then
+           apr_ver_status="good"
+        fi
+     fi
+  fi
+  if test $apr_ver_status != "good"; then
+        AC_MSG_ERROR([Need apr-version between 0.9.$apr_min_want_ver_patch and 0.9.$apr_max_want_ver_patch, you have $apr_version])
+  fi
+
   CPPFLAGS="$CPPFLAGS `$apr_config --cppflags`"
   if test $? -ne 0; then
     AC_MSG_ERROR([apr-config --cppflags failed])

--
Jani Averbach


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org