You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2008/11/18 21:05:32 UTC

svn commit: r718698 - in /activemq/activemq-cpp/trunk/m4: apr_tools.m4 find_apr.m4 find_apu.m4

Author: tabish
Date: Tue Nov 18 12:05:32 2008
New Revision: 718698

URL: http://svn.apache.org/viewvc?rev=718698&view=rev
Log:
Updated for the 2.2.2 release, checking for the supported versions of APR and APR-Util

Modified:
    activemq/activemq-cpp/trunk/m4/apr_tools.m4
    activemq/activemq-cpp/trunk/m4/find_apr.m4
    activemq/activemq-cpp/trunk/m4/find_apu.m4

Modified: activemq/activemq-cpp/trunk/m4/apr_tools.m4
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/m4/apr_tools.m4?rev=718698&r1=718697&r2=718698&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/m4/apr_tools.m4 (original)
+++ activemq/activemq-cpp/trunk/m4/apr_tools.m4 Tue Nov 18 12:05:32 2008
@@ -40,6 +40,53 @@
     DECAF_DOWNLOAD_APU
   fi
 
+  APR_VER_REGEXES=["1\.3\.[0-9] 1\.3\.1[0-9] "]
+  APU_VER_REGEXES=["1\.2\.[0-9] 1\.2\.1[0-9] 1\.3\.[0-9]"]
+
+  dnl check APR version number against regex
+
+  AC_MSG_CHECKING([APR version])
+  apr_version="`$apr_config --version`"
+  if test $? -ne 0; then
+    AC_MSG_ERROR([apr-config --version failed])
+  fi
+  AC_MSG_RESULT([$apr_version])
+
+  APR_WANTED_REGEX_MATCH=0
+  for apr_wanted_regex in $APR_VER_REGEXES; do
+    if test `expr $apr_version : $apr_wanted_regex` -ne 0; then
+      APR_WANTED_REGEX_MATCH=1
+      break
+    fi
+  done
+
+  if test $APR_WANTED_REGEX_MATCH -eq 0; then
+    echo "wanted regexes are $APR_VER_REGEXES"
+    AC_MSG_ERROR([invalid apr version found, check the README for supported versions.])
+  fi
+
+  dnl check APU version number against regex
+
+  AC_MSG_CHECKING([APU version])
+  apu_version="`$apu_config --version`"
+  if test $? -ne 0; then
+    AC_MSG_ERROR([apu-config --version failed])
+  fi
+  AC_MSG_RESULT([$apu_version])
+
+  APU_WANTED_REGEX_MATCH=0
+  for apu_wanted_regex in $APU_VER_REGEXES; do
+    if test `expr $apr_version : $apu_wanted_regex` -ne 0; then
+      APU_WANTED_REGEX_MATCH=1
+      break
+    fi
+  done
+
+  if test $APU_WANTED_REGEX_MATCH -eq 0; then
+    echo "wanted regexes are $APU_VER_REGEXES"
+    AC_MSG_ERROR([invalid apr-util version found, check the README for supported versions.])
+  fi
+
   dnl Get build information from APR
 
   APR_CPPFLAGS="`$apr_config --cppflags`"

Modified: activemq/activemq-cpp/trunk/m4/find_apr.m4
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/m4/find_apr.m4?rev=718698&r1=718697&r2=718698&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/m4/find_apr.m4 (original)
+++ activemq/activemq-cpp/trunk/m4/find_apr.m4 Tue Nov 18 12:05:32 2008
@@ -22,7 +22,8 @@
 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.
@@ -39,6 +40,14 @@
 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"
@@ -89,8 +98,8 @@
 
   AC_MSG_CHECKING(for APR)
   AC_ARG_WITH(apr,
-  [  --with-apr=PATH         prefix for installed APR, path to APR build tree,
-                          or the full path to apr-config],
+  [  --with-apr=PATH         prefix for installed APR or the full path to 
+                             apr-config],
   [
     if test "$withval" = "no" || test "$withval" = "yes"; then
       AC_MSG_ERROR([--with-apr requires a directory or file to be provided])
@@ -101,16 +110,28 @@
       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
@@ -124,15 +145,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_found="yes"
           apr_config="$apr_temp_apr_config_file"
+          ifelse([$5], [], [], [
+          apr_acceptable="yes"
+          $5
+          if test "$apr_acceptable" != "yes"; then
+            AC_MSG_WARN([skipped APR at $apr_config, version not acceptable])
+            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([skipped APR at $apr_config, version not acceptable])
+                continue
+              fi])
+              apr_found="yes"
               break 2
             fi
           done

Modified: activemq/activemq-cpp/trunk/m4/find_apu.m4
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/m4/find_apu.m4?rev=718698&r1=718697&r2=718698&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/m4/find_apu.m4 (original)
+++ activemq/activemq-cpp/trunk/m4/find_apu.m4 Tue Nov 18 12:05:32 2008
@@ -1,10 +1,10 @@
 dnl -------------------------------------------------------- -*- autoconf -*-
-dnl Copyright 2002-2005 The Apache Software Foundation or its licensors, as
-dnl applicable.
-dnl
-dnl Licensed under the Apache License, Version 2.0 (the "License");
-dnl you may not use this file except in compliance with the License.
-dnl You may obtain a copy of the License at
+dnl Licensed to the Apache Software Foundation (ASF) under one or more
+dnl contributor license agreements.  See the NOTICE file distributed with
+dnl this work for additional information regarding copyright ownership.
+dnl The ASF licenses this file to You under the Apache License, Version 2.0
+dnl (the "License"); you may not use this file except in compliance with
+dnl the License.  You may obtain a copy of the License at
 dnl
 dnl     http://www.apache.org/licenses/LICENSE-2.0
 dnl
@@ -22,7 +22,8 @@
 dnl embedding APU into the application source, or locating an installed
 dnl copy of APU.
 dnl
-dnl APR_FIND_APU(srcdir, builddir, implicit-install-check, acceptable-majors)
+dnl APR_FIND_APU(srcdir, builddir, implicit-install-check, acceptable-majors,
+dnl              detailed-check)
 dnl
 dnl   where srcdir is the location of the bundled APU source directory, or
 dnl   empty if source is not bundled.
@@ -39,6 +40,14 @@
 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 apu_acceptable to
+dnl   either "yes" or "no". The macro will be invoked for each installed
+dnl   copy of APU found, with the apu_config variable set appropriately.
+dnl   Only installed copies of APU which are considered acceptable by
+dnl   this macro will be considered found. If no installed copies are
+dnl   considered acceptable by this macro, apu_found will be set to either
+dnl   either "no" or "reconfig".
+dnl
 dnl Sets the following variables on exit:
 dnl
 dnl   apu_found : "yes", "no", "reconfig"
@@ -99,8 +108,8 @@
 
   AC_MSG_CHECKING(for APR-util)
   AC_ARG_WITH(apr-util,
-  [  --with-apr-util=PATH    prefix for installed APU, path to APU build tree,
-                          or the full path to apu-config],
+  [  --with-apr-util=PATH    prefix for installed APU or the full path to 
+                             apu-config],
   [
     if test "$withval" = "no" || test "$withval" = "yes"; then
       AC_MSG_ERROR([--with-apr-util requires a directory or file to be provided])
@@ -111,16 +120,28 @@
       for lookdir in "$withval/bin" "$withval"
       do
         if $TEST_X "$lookdir/$apu_temp_apu_config_file"; then
-          apu_found="yes"
           apu_config="$lookdir/$apu_temp_apu_config_file"
+          ifelse([$5], [], [], [
+          apu_acceptable="yes"
+          $5
+          if test "$apu_acceptable" != "yes"; then
+            AC_MSG_WARN([Found APU in $apu_config, but it is considered unacceptable])
+            continue
+          fi])
+          apu_found="yes"
           break 2
         fi
       done
     done
 
     if test "$apu_found" != "yes" && $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then
-      apu_found="yes"
       apu_config="$withval"
+      ifelse([$5], [], [apu_found="yes"], [
+          apu_acceptable="yes"
+          $5
+          if test "$apu_acceptable" = "yes"; then
+                apu_found="yes"
+          fi])
     fi
 
     dnl if --with-apr-util is used, it is a fatal error for its argument
@@ -133,15 +154,29 @@
       for apu_temp_apu_config_file in $apu_temp_acceptable_apu_config
       do
         if $apu_temp_apu_config_file --help > /dev/null 2>&1 ; then
+          apu_config="$apu_temp_apu_config_file" 
+          ifelse([$5], [], [], [
+          apu_acceptable="yes"
+          $5
+          if test "$apu_acceptable" != "yes"; then
+            AC_MSG_WARN([skipped APR-util at $apu_config, version not acceptable])
+            continue
+          fi])
           apu_found="yes"
-          apu_config="$apu_temp_apu_config_file"
           break
         else
           dnl look in some standard places (apparently not in builtin/default)
-          for lookdir in /usr /usr/local /usr/local/apr /opt/apr /usr/local/apache2 ; do
+          for lookdir in /usr /usr/local /usr/local/apr /opt/apr; do
             if $TEST_X "$lookdir/bin/$apu_temp_apu_config_file"; then
-              apu_found="yes"
               apu_config="$lookdir/bin/$apu_temp_apu_config_file"
+              ifelse([$5], [], [], [
+              apu_acceptable="yes"
+              $5
+              if test "$apu_acceptable" != "yes"; then
+                AC_MSG_WARN([skipped APR-util at $apu_config, version not acceptable])
+                continue
+              fi])
+              apu_found="yes"
               break 2
             fi
           done