diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-08-10 14:28:49 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-08-10 14:28:49 +0300 |
commit | c8c62ae17d8bec6ee69ce63204d38112d6924e0c (patch) | |
tree | 39c5557c7d9a051c464add1de2670d40e2b843cd | |
parent | 43ef3ce139aa5ddb9aa0437c356a86290536900e (diff) | |
download | acvmod-c8c62ae17d8bec6ee69ce63204d38112d6924e0c.tar.gz acvmod-c8c62ae17d8bec6ee69ce63204d38112d6924e0c.tar.bz2 |
Change syntax of AM_VARNISHAPI macro call.
The macro takes up to two arguments: oldest supported and newest
tested Varnish versions.
-rw-r--r-- | README | 26 | ||||
-rw-r--r-- | varnishapi.m4 | 33 |
2 files changed, 39 insertions, 20 deletions
@@ -162,19 +162,27 @@ The following command was used to create initial set up of the The =AM_VARNISHAPI= macro is used in =configure.ac= to check whether the varnish API components (header files and libraries) are installed -and are of sufficiently modern version. The macro is invoked with one -optional argument - the oldest required version of the API: +and are of sufficiently modern version. The macro is invoked with at +most two arguments, both of which are optional: #+BEGIN_SRC autoconf - AM_VARNISHAPI([VERSION]) + AM_VARNISHAPI([MIN-VERSION],[MAX-VERSION]) #+END_SRC -If =VERSION= argument is supplied, the macro checks if varnish API -version is the same or newer than that version number. Otherwise, if -package version string ends in -N.N.N, where N stands for a decimal -digit, it checks if varnish API version is at least N.N.N. -If API is older, it emits error message and aborts. If the version is -newer, a warning message is emitted at the end of configure. +The =MIN-VERSION= argument specifies the oldest supported version of +Varnish API. If the API is older than that, an error message will +be emitted and configuration will be aborted. + +The =MAX-VERSION= argument specifies the newest version of Varnish API +for which the package was tested. If the API is newer than that, a +warning message will be emitted at the end of the run to inform the +user about the fact. If MAX-VERSION is omitted, no such test is made. + +If the macro is called without arguments, its behavior depends on +the package version (as specified in the AC_INIT macro call). If +the version ends in -N.N.N (where _N_ stands for a decimal +digit), the macro behaves as if it were invoked as +~AM_VARNISHAPI(N.N.N)~. Otherwise, no version checking is performed. The ~AM_VARNISHAPI~ macro sets the following configuration variables: diff --git a/varnishapi.m4 b/varnishapi.m4 index 895b922..bc8e2e4 100644 --- a/varnishapi.m4 +++ b/varnishapi.m4 @@ -47,13 +47,18 @@ m4_define([VAPI_CHECK_VER],[ fi ])]) -## AM_VARNISHAPI([VERSION]) +## AM_VARNISHAPI([MIN-VERSION],[MAX-VERSION]) ## Tests if the programs and libraries needed for compiling a varnish -## module are present. If VERSION argument is supplied, checks if varnish API -## version is the same or newer than that. Otherwise, if package version -## string ends in -N.N.N, where N stands for a decimal digit, checks if varnish -## API version is at least N.N.N. If API is older, emits error message and -## aborts. If it is newer, emits a warning message at the end of configure. +## module are present. If MIN-VERSION argument is supplied, checks if +## varnish API version is the same or newer than that. If it is older, +## emits error message and aborts. Otherwise, if MAX-VERSION is specified +## checks varnish API version against that. If the version is newer than +## both MAX-VERSION, a warning message to that effect will be emitted at +## the end of configure. +## +## If no arguments are given, and the package version string ends in -N.N.N, +## (where N stands for a decimal digit), the macro behaves as if it were +## called as AM_VARNISHAPI([N.N.N]). ## ## Sets the following configuration variables: ## @@ -96,11 +101,17 @@ AC_DEFUN([AM_VARNISHAPI], IFS='.' varnishapi_version $v IFS=$save_IFS - VAPI_CHECK_VER(m4_if([$1],, - [m4_pushdef([ver],[m4_bpatsubst(AC_PACKAGE_VERSION,[.*-\([0-9]\)\.\([0-9]\)\.\([0-9]\)$],[m4_quote(\1,\2,\3)])])dnl -m4_if(ver,AC_PACKAGE_VERSION,,[m4_unquote(ver)])dnl -m4_popdef([ver])], - [m4_unquote(m4_split([$1],\.))])) + + m4_pushdef([ver],[m4_bpatsubst(AC_PACKAGE_VERSION,[.*-\([0-9]\.[0-9]\.[0-9]\)$],[\1])]) + + VAPI_CHECK_VER(m4_unquote(m4_split(m4_if([ver],AC_PACKAGE_VERSION,[$1],[$1],,[ver],[$1]),\.))) + + m4_if([$2],,[m4_if(ver,[AC_PACKAGE_VERSION],[# Suppress the warning message + varnishapi_version_diff=same])],dnl + [if test "$varnishapi_version_diff" = newer; then + VAPI_CHECK_VER(m4_unquote(m4_split([$2],\.))) + fi]) + m4_popdef([ver]) else AC_MSG_ERROR([unknown varnishapi version]) fi |