summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--varnishapi.m416
1 files changed, 8 insertions, 8 deletions
diff --git a/varnishapi.m4 b/varnishapi.m4
index 8a00c8f..147230c 100644
--- a/varnishapi.m4
+++ b/varnishapi.m4
@@ -30,24 +30,21 @@ m4_define([VAPI_CHECK_VER],[
30 m4_if([$1],,,[if test $VARNISHAPI_MAJOR -lt $1; then 30 m4_if([$1],,,[if test $VARNISHAPI_MAJOR -lt $1; then
31 varnishapi_version_diff=older 31 varnishapi_version_diff=older
32 elif test $VARNISHAPI_MAJOR -gt $1; then 32 elif test $VARNISHAPI_MAJOR -gt $1; then
33 varnishapi_version_diff=newer 33 varnishapi_version_diff=newer
34 m4_if([$2],,,[elif test $VARNISHAPI_MINOR -lt $2; then 34 m4_if([$2],,,[elif test $VARNISHAPI_MINOR -lt $2; then
35 varnishapi_version_diff=older 35 varnishapi_version_diff=older
36 elif test $VARNISHAPI_MINOR -gt $2; then 36 ])elif test $VARNISHAPI_MINOR -gt m4_if([$2],,0,[$2]); then
37 varnishapi_version_diff=newer 37 varnishapi_version_diff=newer
38 ])m4_if([$3],,,[elif test $VARNISHAPI_PATCH -lt $3; then 38 m4_if([$3],,,[elif test $VARNISHAPI_PATCH -lt $3; then
39 varnishapi_version_diff=older 39 varnishapi_version_diff=older
40 elif test $VARNISHAPI_PATCH -gt $3; then 40 ])elif test $VARNISHAPI_PATCH -gt m4_if([$3],,0,[$3]); then
41 varnishapi_version_diff=newer 41 varnishapi_version_diff=newer
42 ])else 42 else
43 varnishapi_version_diff=same 43 varnishapi_version_diff=same
44 fi 44 fi
45 if test $varnishapi_version_diff = older; then
46 AC_MSG_ERROR([unsupported varnishapi version $VARNISHAPI_MAJOR.$VARNISHAPI_MINOR.$VARNISHAPI_PATCH])
47 fi
48])]) 45])])
49 46
50## AM_VARNISHAPI([MIN-VERSION],[MAX-VERSION]) 47## AM_VARNISHAPI([MIN-VERSION],[MAX-VERSION])
51## Tests if the programs and libraries needed for compiling a varnish 48## Tests if the programs and libraries needed for compiling a varnish
52## module are present. If MIN-VERSION argument is supplied, checks if 49## module are present. If MIN-VERSION argument is supplied, checks if
53## varnish API version is the same or newer than that. If it is older, 50## varnish API version is the same or newer than that. If it is older,
@@ -102,12 +99,15 @@ AC_DEFUN([AM_VARNISHAPI],
102 varnishapi_version $v 99 varnishapi_version $v
103 IFS=$save_IFS 100 IFS=$save_IFS
104 101
105 m4_pushdef([ver],[m4_bpatsubst(AC_PACKAGE_VERSION,[.*-\([0-9]\.[0-9]\.[0-9]\)$],[\1])]) 102 m4_pushdef([ver],[m4_bpatsubst(AC_PACKAGE_VERSION,[.*-\([0-9]\.[0-9]\.[0-9]\)$],[\1])])
106 103
107 VAPI_CHECK_VER(m4_unquote(m4_split(m4_if([ver],AC_PACKAGE_VERSION,[$1],[$1],,[ver],[$1]),\.))) 104 VAPI_CHECK_VER(m4_unquote(m4_split(m4_if([ver],AC_PACKAGE_VERSION,[$1],[$1],,[ver],[$1]),\.)))
105 if test $varnishapi_version_diff = older; then
106 AC_MSG_ERROR([varnishapi version too old: $VARNISHAPI_MAJOR.$VARNISHAPI_MINOR.$VARNISHAPI_PATCH; required at least $1])
107 fi
108 108
109 m4_if([$2],,[m4_if(ver,AC_PACKAGE_VERSION,[# Suppress the warning message 109 m4_if([$2],,[m4_if(ver,AC_PACKAGE_VERSION,[# Suppress the warning message
110 varnishapi_version_diff=same])],dnl 110 varnishapi_version_diff=same])],dnl
111 [if test "$varnishapi_version_diff" = newer; then 111 [if test "$varnishapi_version_diff" = newer; then
112 VAPI_CHECK_VER(m4_unquote(m4_split([$2],\.))) 112 VAPI_CHECK_VER(m4_unquote(m4_split([$2],\.)))
113 fi]) 113 fi])
@@ -159,13 +159,13 @@ delim="-------------------------------------------------------------------------
159echo "" 159echo ""
160echo $delim 160echo $delim
161echo "Building for Varnish version $version" 161echo "Building for Varnish version $version"
162if test "$varnishapi_version_diff" = newer; then 162if test "$varnishapi_version_diff" = newer; then
163 fmt <<EOT 163 fmt <<EOT
164WARNING: This version is newer than the latest version for which 164WARNING: This version is newer than the latest version for which
165$PACKAGE_STRING was tested. If it doesn't compile, please send a mail to 165$PACKAGE_STRING was tested ($2). If it doesn't compile, please report it to
166<$PACKAGE_BUGREPORT>. 166<$PACKAGE_BUGREPORT>.
167EOT 167EOT
168fi 168fi
169echo $delim 169echo $delim
170echo "" 170echo ""
171], 171],

Return to:

Send suggestions and report system problems to the System administrator.