[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Build system autoconf clean-ups

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-01-18 13:56:17 CET

Here is a pair of small patches for our build system experts to consider.

The first is motivated by the ugliness of
   APR_VER_REGEX="0\.9\.[5-9]"
   APR_VER_REGEX_TOO="1\."
where the REs should not contain parentheses because they are tested with the
"expr" command which changes its behaviour when it encounters parentheses.

The patch uses "grep" to check a single arbitrary RE instead. An alternative
would be to use glob patterns instead.

apr-ver-check.patch:
[[[
Simplify the version checking for APR and APR-util: check an arbitrary
regular expression instead of two alternative restricted REs.

* build/ac-macros/apr.m4 (SVN_LIB_APR)
* build/ac-macros/aprutil.m4 (SVN_LIB_APRUTIL)
* configure.in
]]]

The second patch just resolves a simple naming confusion.

build-regex.patch:
[[[
In the build system, rename glob-pattern variables from "*_REGEX" to
"*_PATTERN" to reduce confusion.

* build/ac-macros/neon.m4
* build/buildcheck.sh
* configure.in
   Rename NEON_WANTED_REGEX and NEON_TEST_REGEX to *_PATTERN.
]]]

The last time I touched this stuff (the APR_VER_REGEX) I broke it, so I am not
going to commit these without the say-so of those who are familiar with it.
And these aren't necessary changes, just clean-ups.

- Julian

Simplify the version checking for APR and APR-util: check an arbitrary
regular expression instead of two alternative restricted REs.

* build/ac-macros/apr.m4 (SVN_LIB_APR)
* build/ac-macros/aprutil.m4 (SVN_LIB_APRUTIL)
* configure.in

Index: build/ac-macros/apr.m4
===================================================================
--- build/ac-macros/apr.m4 (revision 12757)
+++ build/ac-macros/apr.m4 (working copy)
@@ -1,7 +1,7 @@
 dnl
-dnl SVN_LIB_APR(wanted_regex, alt_wanted_regex)
+dnl SVN_LIB_APR(wanted_regex)
 dnl
-dnl 'wanted_regex' and 'alt_wanted_regex are regular expressions
+dnl 'wanted_regex' is a regular expression
 dnl that the apr version string must match.
 dnl
 dnl Check configure options and assign variables related to
@@ -11,7 +11,6 @@ dnl
 AC_DEFUN(SVN_LIB_APR,
 [
   APR_WANTED_REGEX="$1"
- APR_WANTED_REGEX_TOO="$2"
 
   AC_MSG_NOTICE([Apache Portable Runtime (APR) library configuration])
 
@@ -36,9 +35,8 @@ AC_DEFUN(SVN_LIB_APR,
   fi
   AC_MSG_RESULT([$apr_version])
 
- if test `expr $apr_version : $APR_WANTED_REGEX` -eq 0 \
- -a `expr $apr_version : $APR_WANTED_REGEX_TOO` -eq 0; then
- echo "wanted regex is $APR_WANTED_REGEX or $APR_WANTED_REGEX_TOO"
+ if ! echo $apr_version | grep "^$APR_WANTED_REGEX" > /dev/null; then
+ echo "wanted regex is $APR_WANTED_REGEX"
     AC_MSG_ERROR([invalid apr version found])
   fi
 
Index: build/ac-macros/aprutil.m4
===================================================================
--- build/ac-macros/aprutil.m4 (revision 12757)
+++ build/ac-macros/aprutil.m4 (working copy)
@@ -1,6 +1,6 @@
-dnl SVN_LIB_APRUTIL(wanted_regex, alt_wanted_regex)
+dnl SVN_LIB_APRUTIL(wanted_regex)
 dnl
-dnl 'wanted_regex' and 'alt_wanted_regex are regular expressions
+dnl 'wanted_regex' is a regular expression
 dnl that the aprutil version string must match.
 dnl
 dnl Check configure options and assign variables related to
@@ -16,7 +16,6 @@ dnl
 AC_DEFUN(SVN_LIB_APRUTIL,
 [
   APRUTIL_WANTED_REGEX="$1"
- APRUTIL_WANTED_REGEX_TOO="$2"
 
   AC_MSG_NOTICE([Apache Portable Runtime Utility (APRUTIL) library configuration])
 
@@ -49,9 +48,8 @@ AC_DEFUN(SVN_LIB_APRUTIL,
   fi
   AC_MSG_RESULT([$apu_version])
 
- if test `expr $apu_version : $APRUTIL_WANTED_REGEX` -eq 0 \
- -a `expr $apu_version : $APRUTIL_WANTED_REGEX_TOO` -eq 0; then
- echo "wanted regex is $APRUTIL_WANTED_REGEX or $APRUTIL_WANTED_REGEX_TOO"
+ if ! echo $apu_version | grep "^$APRUTIL_WANTED_REGEX" > /dev/null; then
+ echo "wanted regex is $APRUTIL_WANTED_REGEX"
     AC_MSG_ERROR([invalid apr-util version found])
   fi
 
Index: configure.in
===================================================================
--- configure.in (revision 12757)
+++ configure.in (working copy)
@@ -110,15 +110,12 @@ dnl Configure APR, and local Berkeley DB
 
 dnl verify apr version and set apr flags
 changequote(<<, >>)
-dnl These regular expressions should not contain "\(" and "\)".
-APR_VER_REGEX="0\.9\.[5-9]"
-APR_VER_REGEX_TOO="1\."
-APU_VER_REGEX="0\.9\.[5-9]"
-APU_VER_REGEX_TOO="1\."
+APR_VER_REGEX="0\.9\.\([5-9]\|[1-9][0-9]\)\|1\."
+APU_VER_REGEX="0\.9\.\([5-9]\|[1-9][0-9]\)\|1\."
 changequote([, ])
 
-SVN_LIB_APR($APR_VER_REGEX, $APR_VER_REGEX_TOO)
-SVN_LIB_APRUTIL($APU_VER_REGEX, $APU_VER_REGEX_TOO)
+SVN_LIB_APR($APR_VER_REGEX)
+SVN_LIB_APRUTIL($APU_VER_REGEX)
 
 if test -d "$abs_srcdir/db" ; then
     AC_MSG_ERROR([Configuring against an in-tree copy of Berkeley DB is no

In the build system, rename glob-pattern variables from "*_REGEX" to
"*_PATTERN" to reduce confusion.

* build/ac-macros/neon.m4
* build/buildcheck.sh
* configure.in
  Rename NEON_WANTED_REGEX and NEON_TEST_REGEX to *_PATTERN.

Index: build/ac-macros/neon.m4
===================================================================
--- build/ac-macros/neon.m4 (revision 12757)
+++ build/ac-macros/neon.m4 (working copy)
@@ -22,7 +22,7 @@
 
 AC_DEFUN(SVN_LIB_NEON,
 [
- NEON_WANTED_REGEX="$1"
+ NEON_WANTED_PATTERN="$1"
   NEON_LATEST_WORKING_VER="$2"
   NEON_URL="$3"
 
@@ -49,7 +49,7 @@
       NEON_VERSION=`$abs_srcdir/build/get-neon-ver.sh $abs_srcdir/neon`
       AC_MSG_RESULT([$NEON_VERSION])
       case "$NEON_VERSION" in
- $NEON_WANTED_REGEX)
+ $NEON_WANTED_PATTERN)
           echo "Using neon found in source directory."
           SVN_NEON_INCLUDES=-'I$(abs_srcdir)/neon/src'
           NEON_LIBS="\$(abs_builddir)/neon/src/libneon.la"
@@ -121,7 +121,7 @@
       AC_MSG_RESULT([$NEON_VERSION])
 
       case "$NEON_VERSION" in
- $NEON_WANTED_REGEX)
+ $NEON_WANTED_PATTERN)
           changequote(<<, >>)dnl
           SVN_NEON_INCLUDES=`$neon_config --cflags | sed -e 's/-D[^ ]*//g'`
           NEON_LIBS=`$neon_config --libs`
Index: build/buildcheck.sh
===================================================================
--- build/buildcheck.sh (revision 12757)
+++ build/buildcheck.sh (working copy)
@@ -124,17 +124,17 @@
 #--------------------------------------------------------------------------
 # check for the correct version of Neon
 #
-NEON_WANTED_REGEX=0.24.7
+NEON_WANTED_PATTERN=0.24.7
 NEON_LATEST_WORKING_VER=0.24.7
 NEON_URL="http://www.webdav.org/neon/neon-${NEON_LATEST_WORKING_VER}.tar.gz"
-NEON_TEST_REGEX="$NEON_WANTED_REGEX"
+NEON_TEST_PATTERN="$NEON_WANTED_PATTERN"
 if test "$NEON_CHECK_CONTROL" = "--disable-neon-version-check"; then
- NEON_TEST_REGEX=*
+ NEON_TEST_PATTERN=*
 fi
 if test -d ./neon; then
   NEON_VERSION="`./build/get-neon-ver.sh neon`"
   case "$NEON_VERSION" in
- $NEON_TEST_REGEX)
+ $NEON_TEST_PATTERN)
       ;;
     *)
       echo "buildcheck: neon version $NEON_VERSION found in ./neon/."
Index: configure.in
===================================================================
--- configure.in (revision 12757)
+++ configure.in (working copy)
@@ -268,20 +268,20 @@
 esac
 AC_SUBST(LT_NO_UNDEFINED)
 
-NEON_WANTED_REGEX="`sed -n '/NEON_WANTED_REGEX=/s/.*=//p' $srcdir/build/buildcheck.sh`"
+NEON_WANTED_PATTERN="`sed -n '/NEON_WANTED_PATTERN=/s/.*=//p' $srcdir/build/buildcheck.sh`"
 dnl You can skip the neon version check only if you know what you are doing
 AC_ARG_ENABLE(neon-version-check,
   AC_HELP_STRING([--disable-neon-version-check],
                  [do not check the Neon version]),
   [
     if test "$enableval" = "no" ; then
- NEON_WANTED_REGEX="*"
+ NEON_WANTED_PATTERN="*"
     fi
   ],
   [])
 NEON_LATEST_WORKING_VER="`sed -n '/NEON_LATEST_WORKING_VER=/s/.*=//p' $srcdir/build/buildcheck.sh`"
 eval "`grep '^ *NEON_URL=' $srcdir/build/buildcheck.sh`"
-SVN_LIB_NEON($NEON_WANTED_REGEX, $NEON_LATEST_WORKING_VER, $NEON_URL)
+SVN_LIB_NEON($NEON_WANTED_PATTERN, $NEON_LATEST_WORKING_VER, $NEON_URL)
 
 dnl find Apache with a recent-enough magic module number.
 SVN_FIND_APACHE(20020903)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jan 18 13:58:15 2005

This is an archived mail posted to the Subversion Dev mailing list.