aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--varnishapi.m436
1 files changed, 20 insertions, 16 deletions
diff --git a/varnishapi.m4 b/varnishapi.m4
index 6e47ae7..129d66a 100644
--- a/varnishapi.m4
+++ b/varnishapi.m4
@@ -1,8 +1,8 @@
## Autoconf macros for writing Varnish modules
-## Copyright (C) 2016,2017 Sergey Poznyakoff
+## Copyright (C) 2016-2020 Sergey Poznyakoff
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3, or (at your option)
## any later version.
##
@@ -11,13 +11,13 @@
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
-## serial 2
+## serial 3
## VAPI_CHECK_VER([MAJOR], [MINOR], [PATCH]) - Check version
##
## Arguments are literal numbers. All of them are optional, but at least
## MAJOR must be present, otherwise the macro will produce empty expansion.
## The macro expands to shell code that compares the supplied numbers with
@@ -59,31 +59,33 @@ m4_define([VAPI_CHECK_VER],[
##
## Sets the following configuration variables:
##
## VMODDIR the path of the varnish module directory.
## VARNISH_MAJOR, VARNISH_MINOR, and VARNISH_PATCH
## the corresponding numbers of the varnish API version.
-## VARNISHD full pathname of the varnishd binary
-## VARNISHTEST full pathname of the varnishtest binary
+## VARNISHD full pathname of the varnishd binary.
+## VARNISHTEST full pathname of the varnishtest binary.
## VARNISHAPI_PKGDATADIR
-## varnish API package data directory
+## varnish API package data directory.
## VARNISHAPI_VMODTOOL
-## full pathname of the vmodtool.py script
+## full pathname of the vmodtool.py script.
+## PYTHON full pathname of the python 3 binary.
+## RST2MAN full pathname of the rst2man or rst2man.py script.
##
AC_DEFUN([AM_VARNISHAPI],
[ # Check for pkg-config
PKG_PROG_PKG_CONFIG
# Check for python
AM_PATH_PYTHON([3.5])
- # Varnish source tree (deprecated)
- AC_ARG_WITH([varnish-source],
- [],
- [AC_MSG_ERROR([the --with-varnish-source option has been withdrawn])])
-
+ # Check for rst2man.py or rst2man
+ AC_PATH_PROGS(RST2MAN, [rst2man.py rst2man],
+ [\$(abs_top_srcdir)/build-aux/missing rst2man.py])
+ AC_SUBST([RST2MAN])
+
# pkg-config
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([VARNISHAPI], [varnishapi])
varnishapi_version() {
VARNISHAPI_MAJOR=$[]1
@@ -129,17 +131,19 @@ AC_DEFUN([AM_VARNISHAPI],
* versions 6.1 and 6.2 only to resurge in 6.3, with the additional
* notice that they are going to replace the WS_Reserve function,
* which will be removed after 2020-09-15.
* (see http://varnish-cache.org/docs/trunk/whats-new/upgrading-6.3.html)
* These macros work around this vacillation.
*/
-#if !HAVE_DECL_WS_RESERVEALL
-# define WS_ReserveAll(ws) WS_Reserve(ws,0)
-#endif
-#if !HAVE_DECL_WS_RESERVESIZE
-# define WS_ReserveSize(ws,sz) WS_Reserve(ws,sz)
+#if VARNISHAPI_MAJOR == 6
+# if !HAVE_DECL_WS_RESERVEALL
+# define WS_ReserveAll(ws) WS_Reserve(ws,0)
+# endif
+# if !HAVE_DECL_WS_RESERVESIZE
+# define WS_ReserveSize(ws,sz) WS_Reserve(ws,sz)
+# endif
#endif
])
fi
# vmod installation dir
AC_ARG_VAR([VMODDIR], [vmod installation directory])

Return to:

Send suggestions and report system problems to the System administrator.