diff options
Diffstat (limited to 'varnishapi.m4')
-rw-r--r-- | varnishapi.m4 | 33 |
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],[ | |||
47 | fi | 47 | fi |
48 | ])]) | 48 | ])]) |
49 | 49 | ||
50 | ## AM_VARNISHAPI([VERSION]) | 50 | ## AM_VARNISHAPI([MIN-VERSION],[MAX-VERSION]) |
51 | ## Tests if the programs and libraries needed for compiling a varnish | 51 | ## Tests if the programs and libraries needed for compiling a varnish |
52 | ## module are present. If VERSION argument is supplied, checks if varnish API | 52 | ## module are present. If MIN-VERSION argument is supplied, checks if |
53 | ## version is the same or newer than that. Otherwise, if package version | 53 | ## varnish API version is the same or newer than that. If it is older, |
54 | ## string ends in -N.N.N, where N stands for a decimal digit, checks if varnish | 54 | ## emits error message and aborts. Otherwise, if MAX-VERSION is specified |
55 | ## API version is at least N.N.N. If API is older, emits error message and | 55 | ## checks varnish API version against that. If the version is newer than |
56 | ## aborts. If it is newer, emits a warning message at the end of configure. | 56 | ## both MAX-VERSION, a warning message to that effect will be emitted at |
57 | ## the end of configure. | ||
58 | ## | ||
59 | ## If no arguments are given, and the package version string ends in -N.N.N, | ||
60 | ## (where N stands for a decimal digit), the macro behaves as if it were | ||
61 | ## called as AM_VARNISHAPI([N.N.N]). | ||
57 | ## | 62 | ## |
58 | ## Sets the following configuration variables: | 63 | ## Sets the following configuration variables: |
59 | ## | 64 | ## |
@@ -96,11 +101,17 @@ AC_DEFUN([AM_VARNISHAPI], | |||
96 | IFS='.' | 101 | IFS='.' |
97 | varnishapi_version $v | 102 | varnishapi_version $v |
98 | IFS=$save_IFS | 103 | IFS=$save_IFS |
99 | VAPI_CHECK_VER(m4_if([$1],, | 104 | |
100 | [m4_pushdef([ver],[m4_bpatsubst(AC_PACKAGE_VERSION,[.*-\([0-9]\)\.\([0-9]\)\.\([0-9]\)$],[m4_quote(\1,\2,\3)])])dnl | 105 | m4_pushdef([ver],[m4_bpatsubst(AC_PACKAGE_VERSION,[.*-\([0-9]\.[0-9]\.[0-9]\)$],[\1])]) |
101 | m4_if(ver,AC_PACKAGE_VERSION,,[m4_unquote(ver)])dnl | 106 | |
102 | m4_popdef([ver])], | 107 | VAPI_CHECK_VER(m4_unquote(m4_split(m4_if([ver],AC_PACKAGE_VERSION,[$1],[$1],,[ver],[$1]),\.))) |
103 | [m4_unquote(m4_split([$1],\.))])) | 108 | |
109 | m4_if([$2],,[m4_if(ver,[AC_PACKAGE_VERSION],[# Suppress the warning message | ||
110 | varnishapi_version_diff=same])],dnl | ||
111 | [if test "$varnishapi_version_diff" = newer; then | ||
112 | VAPI_CHECK_VER(m4_unquote(m4_split([$2],\.))) | ||
113 | fi]) | ||
114 | m4_popdef([ver]) | ||
104 | else | 115 | else |
105 | AC_MSG_ERROR([unknown varnishapi version]) | 116 | AC_MSG_ERROR([unknown varnishapi version]) |
106 | fi | 117 | fi |