diff options
-rw-r--r-- | varnishapi.m4 | 16 |
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],[ m4_if([$1],,,[if test $VARNISHAPI_MAJOR -lt $1; then varnishapi_version_diff=older elif test $VARNISHAPI_MAJOR -gt $1; then varnishapi_version_diff=newer m4_if([$2],,,[elif test $VARNISHAPI_MINOR -lt $2; then varnishapi_version_diff=older - elif test $VARNISHAPI_MINOR -gt $2; then + ])elif test $VARNISHAPI_MINOR -gt m4_if([$2],,0,[$2]); then varnishapi_version_diff=newer - ])m4_if([$3],,,[elif test $VARNISHAPI_PATCH -lt $3; then + m4_if([$3],,,[elif test $VARNISHAPI_PATCH -lt $3; then varnishapi_version_diff=older - elif test $VARNISHAPI_PATCH -gt $3; then + ])elif test $VARNISHAPI_PATCH -gt m4_if([$3],,0,[$3]); then varnishapi_version_diff=newer - ])else + else varnishapi_version_diff=same fi - if test $varnishapi_version_diff = older; then - AC_MSG_ERROR([unsupported varnishapi version $VARNISHAPI_MAJOR.$VARNISHAPI_MINOR.$VARNISHAPI_PATCH]) - fi ])]) ## AM_VARNISHAPI([MIN-VERSION],[MAX-VERSION]) ## Tests if the programs and libraries needed for compiling a varnish ## 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, @@ -102,12 +99,15 @@ AC_DEFUN([AM_VARNISHAPI], varnishapi_version $v IFS=$save_IFS 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]),\.))) + if test $varnishapi_version_diff = older; then + AC_MSG_ERROR([varnishapi version too old: $VARNISHAPI_MAJOR.$VARNISHAPI_MINOR.$VARNISHAPI_PATCH; required at least $1]) + fi 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]) @@ -159,13 +159,13 @@ delim="------------------------------------------------------------------------- echo "" echo $delim echo "Building for Varnish version $version" if test "$varnishapi_version_diff" = newer; then fmt <<EOT WARNING: This version is newer than the latest version for which -$PACKAGE_STRING was tested. If it doesn't compile, please send a mail to +$PACKAGE_STRING was tested ($2). If it doesn't compile, please report it to <$PACKAGE_BUGREPORT>. EOT fi echo $delim echo "" ], |