aboutsummaryrefslogtreecommitdiff
path: root/varnishapi.m4
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2017-08-10 14:28:49 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2017-08-10 14:28:49 +0300
commitc8c62ae17d8bec6ee69ce63204d38112d6924e0c (patch)
tree39c5557c7d9a051c464add1de2670d40e2b843cd /varnishapi.m4
parent43ef3ce139aa5ddb9aa0437c356a86290536900e (diff)
downloadacvmod-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.
Diffstat (limited to 'varnishapi.m4')
-rw-r--r--varnishapi.m433
1 files changed, 22 insertions, 11 deletions
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

Return to:

Send suggestions and report system problems to the System administrator.