|
|
8c1778 |
diff --git a/configure.ac b/configure.ac
|
|
|
8c1778 |
index 55289f6..990115b 100644
|
|
|
8c1778 |
--- a/configure.ac
|
|
|
8c1778 |
+++ b/configure.ac
|
|
|
8c1778 |
@@ -41,35 +41,33 @@ AC_ARG_WITH([rst2man],
|
|
|
8c1778 |
AS_HELP_STRING([--with-rst2man=PATH], [Location of rst2man (auto)]),
|
|
|
8c1778 |
[RST2MAN="$withval"],
|
|
|
8c1778 |
AC_CHECK_PROGS(RST2MAN,
|
|
|
8c1778 |
- [rst2man-3.6 rst2man-3 rst2man rst2man.py],
|
|
|
8c1778 |
+ [rst2man rst2man.py rst2man-3.6 rst2man-2.7],
|
|
|
8c1778 |
[no]))
|
|
|
8c1778 |
if test "x$RST2MAN" = "xno"; then
|
|
|
8c1778 |
AC_MSG_ERROR(
|
|
|
8c1778 |
- [rst2man is needed to build Varnish, please install python3-docutils.])
|
|
|
8c1778 |
+ [rst2man is needed to build Varnish, please install python-docutils.])
|
|
|
8c1778 |
fi
|
|
|
8c1778 |
|
|
|
8c1778 |
AC_ARG_WITH([sphinx-build],
|
|
|
8c1778 |
AS_HELP_STRING([--with-sphinx-build=PATH], [Location of sphinx-build (auto)]),
|
|
|
8c1778 |
[SPHINX="$withval"],
|
|
|
8c1778 |
AC_CHECK_PROGS(SPHINX,
|
|
|
8c1778 |
- [sphinx-build-3.6 sphinx-build-3 sphinx-build],
|
|
|
8c1778 |
+ [sphinx-build sphinx-build-3.6 sphinx-build-2.7],
|
|
|
8c1778 |
[no]))
|
|
|
8c1778 |
if test "x$SPHINX" = "xno"; then
|
|
|
8c1778 |
AC_MSG_ERROR(
|
|
|
8c1778 |
- [sphinx-build is needed to build Varnish, please install python3-sphinx.])
|
|
|
8c1778 |
+ [sphinx-build is needed to build Varnish, please install python-sphinx.])
|
|
|
8c1778 |
fi
|
|
|
8c1778 |
|
|
|
8c1778 |
AC_ARG_WITH([rst2html],
|
|
|
8c1778 |
- AS_HELP_STRING([--with-rst2html=PATH], [Location of rst2html (auto)]),
|
|
|
8c1778 |
- [RST2HTML="$withval"],
|
|
|
8c1778 |
- AC_CHECK_PROGS(RST2HTML,
|
|
|
8c1778 |
- [rst2html-3.6 rst2html-3 rst2html rst2html.py],
|
|
|
8c1778 |
- "no"))
|
|
|
8c1778 |
+ AS_HELP_STRING([--with-rst2html=PATH],
|
|
|
8c1778 |
+ [Location of rst2html (auto)]),
|
|
|
8c1778 |
+ [RST2HTML="$withval"],
|
|
|
8c1778 |
+ [AC_CHECK_PROGS(RST2HTML, [rst2html rst2html.py], "no")
|
|
|
8c1778 |
+ if test "x$RST2HTML" = "xno"; then
|
|
|
8c1778 |
+ AC_MSG_WARN([rst2html not found - not building changelog])
|
|
|
8c1778 |
+ fi])
|
|
|
8c1778 |
AM_CONDITIONAL(HAVE_RST2HTML,[test "x$RST2HTML" != "xno"])
|
|
|
8c1778 |
-if test "x$RST2HTML" = "xno"; then
|
|
|
8c1778 |
- AC_MSG_ERROR(
|
|
|
8c1778 |
- [rst2html not found - (Weird, we found rst2man?!)])
|
|
|
8c1778 |
-fi
|
|
|
8c1778 |
|
|
|
8c1778 |
AC_ARG_WITH([dot],
|
|
|
8c1778 |
AS_HELP_STRING([--with-dot=PATH],
|
|
|
8c1778 |
diff --git a/doc/sphinx/vtc-syntax.py b/doc/sphinx/vtc-syntax.py
|
|
|
8c1778 |
index 8b15ca7..6d4946d 100644
|
|
|
8c1778 |
--- a/doc/sphinx/vtc-syntax.py
|
|
|
8c1778 |
+++ b/doc/sphinx/vtc-syntax.py
|
|
|
8c1778 |
@@ -29,6 +29,7 @@
|
|
|
8c1778 |
# Process various varnishtest C files and output reStructuredText to be
|
|
|
8c1778 |
# included in vtc(7).
|
|
|
8c1778 |
|
|
|
8c1778 |
+from __future__ import print_function
|
|
|
8c1778 |
import sys
|
|
|
8c1778 |
import re
|
|
|
8c1778 |
|
|
|
8c1778 |
@@ -38,7 +39,7 @@ def parse_file(fn, cl, tl, sl):
|
|
|
8c1778 |
section = ""
|
|
|
8c1778 |
resec = re.compile("[ /]\* SECTION: ")
|
|
|
8c1778 |
|
|
|
8c1778 |
- f = open(fn, "r", encoding="UTF-8")
|
|
|
8c1778 |
+ f = open(fn, "r")
|
|
|
8c1778 |
|
|
|
8c1778 |
for l in f:
|
|
|
8c1778 |
if "*/" in l:
|
|
|
8c1778 |
diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py
|
|
|
8c1778 |
index be3dd32..0118d79 100755
|
|
|
8c1778 |
--- a/lib/libvcc/generate.py
|
|
|
8c1778 |
+++ b/lib/libvcc/generate.py
|
|
|
8c1778 |
@@ -30,6 +30,8 @@
|
|
|
8c1778 |
# Generate various .c and .h files for the VCL compiler and the interfaces
|
|
|
8c1778 |
# for it.
|
|
|
8c1778 |
|
|
|
8c1778 |
+from __future__ import print_function
|
|
|
8c1778 |
+
|
|
|
8c1778 |
#######################################################################
|
|
|
8c1778 |
# These are our tokens
|
|
|
8c1778 |
|
|
|
8c1778 |
diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py
|
|
|
8c1778 |
index 35c19e9..14f93b1 100755
|
|
|
8c1778 |
--- a/lib/libvcc/vmodtool.py
|
|
|
8c1778 |
+++ b/lib/libvcc/vmodtool.py
|
|
|
8c1778 |
@@ -33,6 +33,9 @@ Read the vmod.vcc file (inputvcc) and produce:
|
|
|
8c1778 |
vmod_${name}.rst -- Extracted documentation
|
|
|
8c1778 |
"""
|
|
|
8c1778 |
|
|
|
8c1778 |
+# This script should work with both Python 2 and Python 3.
|
|
|
8c1778 |
+from __future__ import print_function
|
|
|
8c1778 |
+
|
|
|
8c1778 |
import os
|
|
|
8c1778 |
import sys
|
|
|
8c1778 |
import re
|
|
|
8c1778 |
diff --git a/lib/libvcc/vsctool.py b/lib/libvcc/vsctool.py
|
|
|
8c1778 |
index d95b66e..e65b007 100644
|
|
|
8c1778 |
--- a/lib/libvcc/vsctool.py
|
|
|
8c1778 |
+++ b/lib/libvcc/vsctool.py
|
|
|
8c1778 |
@@ -35,6 +35,8 @@ the same general syntax as a `.rst` file, but for now we process
|
|
|
8c1778 |
it with this program to get a *real* `.rst` file.
|
|
|
8c1778 |
'''
|
|
|
8c1778 |
|
|
|
8c1778 |
+from __future__ import print_function
|
|
|
8c1778 |
+
|
|
|
8c1778 |
import getopt
|
|
|
8c1778 |
import json
|
|
|
8c1778 |
import sys
|
|
|
8c1778 |
diff --git a/varnish-legacy.m4 b/varnish-legacy.m4
|
|
|
8c1778 |
index 9f67359..e5e2821 100644
|
|
|
8c1778 |
--- a/varnish-legacy.m4
|
|
|
8c1778 |
+++ b/varnish-legacy.m4
|
|
|
8c1778 |
@@ -98,10 +98,9 @@ AC_SUBST([VMOD_DIR])
|
|
|
8c1778 |
|
|
|
8c1778 |
AC_DEFUN([VARNISH_VMODTOOL],
|
|
|
8c1778 |
[
|
|
|
8c1778 |
-AC_CHECK_PROGS(PYTHON, [python3.9 python3.8 python3.7 python3.6 python3.5 dnl
|
|
|
8c1778 |
- python3.4 python3 python, "no"])
|
|
|
8c1778 |
+AC_CHECK_PROGS(PYTHON, [python3 python3.1 python3.2 python2.7 python2.6 python2.5 python2 python], "no")
|
|
|
8c1778 |
if test "x$PYTHON" = "xno"; then
|
|
|
8c1778 |
- AC_MSG_ERROR([Python >= 3.4 is needed to build, please install python.])
|
|
|
8c1778 |
+ AC_MSG_ERROR([Python is needed to build, please install python.])
|
|
|
8c1778 |
fi
|
|
|
8c1778 |
VARNISH_PKG_GET_VAR([VMODTOOL], [vmodtool])
|
|
|
8c1778 |
AC_SUBST([VMODTOOL])
|
|
|
8c1778 |
diff --git a/varnish.m4 b/varnish.m4
|
|
|
8c1778 |
index 392c36c..71df96d 100644
|
|
|
8c1778 |
--- a/varnish.m4
|
|
|
8c1778 |
+++ b/varnish.m4
|
|
|
8c1778 |
@@ -130,10 +130,10 @@ AC_DEFUN([_VARNISH_CHECK_DEVEL], [
|
|
|
8c1778 |
# ---------------------
|
|
|
8c1778 |
AC_DEFUN([_VARNISH_CHECK_PYTHON], [
|
|
|
8c1778 |
m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
|
|
|
8c1778 |
- [python3.9 python3.8 python3.7 python3.6 python3.5 dnl
|
|
|
8c1778 |
- python3.4 python3 python])
|
|
|
8c1778 |
- AM_PATH_PYTHON([3.4], [], [
|
|
|
8c1778 |
- AC_MSG_ERROR([Python >= 3.4 is required.])
|
|
|
8c1778 |
+[python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python2.7 dnl
|
|
|
8c1778 |
+python python2 python3])
|
|
|
8c1778 |
+ AM_PATH_PYTHON([2.7], [], [
|
|
|
8c1778 |
+ AC_MSG_ERROR([Python >= 2.7 is required.])
|
|
|
8c1778 |
])
|
|
|
8c1778 |
|
|
|
8c1778 |
])
|