summaryrefslogtreecommitdiffhomepage
path: root/configure.ac
diff options
context:
space:
mode:
authorrofl0r <rofl0r@users.noreply.github.com>2020-08-19 22:33:59 +0100
committerrofl0r <rofl0r@users.noreply.github.com>2020-08-19 22:45:37 +0100
commita547a298c77c331061511a6befffc346c1a44a05 (patch)
tree76141bddc458708cc4916e983e165cf6420267eb /configure.ac
parent3fa53f866019aa5794a3a67e2e476c26918ac4df (diff)
generate manpages with pod2man instead of a2x/asciidoc(tor)
it turned out that the upstream section in tinyproxy.conf.5 wasn't rendered properly, because in asciidoc items following a list item are always explicitly appended to the last list item. after several hours of finding a workaround, it was decided to change the manpage generator to pod2man instead. as pod2man ships together with any perl base install, it should be available on almost every UNIX system, unlike asciidoc which requires installation of a huge set of dependencies (more than 1.3 GB on Ubuntu 16.04), and the replacement asciidoctor requires a ruby installation plus a "gem" (which is by far better than asciidoc, but still more effort than using the already available pod2man). tinyproxy's hard requirement of a2x (asciidoctor) for building from source caused rivers of tears (and dozens of support emails/issues) in the past, but finally we get rid of it. a tool such as a2x with its XML based bloat- technology isn't really suited to go along with a supposedly lightweight C program. if it ever turns out that even pod2man is too heavy a dependency, we could still write our own replacement in less than 50 lines of awk, as the pod syntax is very low level and easy to parse.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac37
1 files changed, 8 insertions, 29 deletions
diff --git a/configure.ac b/configure.ac
index e645dc1..900af95 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,9 +97,9 @@ if test x"$transparent_enabled" = x"yes"; then
fi
dnl Let user decide whether he wants support for manpages
-dnl Which require either a2x/asciidoctor or a tarball release
+dnl Which require either pod2man or a tarball release
AH_TEMPLATE([MANPAGE_SUPPORT],
- [Build manpages with a2x/asciidoctor if they are missing from the distribution.])
+ [Build manpages with pod2man if they are missing from the distribution.])
TP_ARG_ENABLE(manpage_support,
[Enable support for building manpages (default is YES)],
yes)
@@ -183,39 +183,18 @@ AC_SUBST(LIBS)
AC_SUBST(ADDITIONAL_OBJECTS)
if test x"$manpage_support_enabled" = x"yes"; then
-# Check for asciidoc
-AC_PATH_PROG(A2X, a2x, no)
-if test "x$A2X" = "xno" ; then
-# Check for asciidoctor
-AC_PATH_PROG(ASCIIDOCTOR, asciidoctor, no)
-else
-# checking xmllint, which is only used together with a2x
-AC_PATH_PROG(XMLLINT, xmllint, no)
-if test "x$XMLLINT" != "xno"; then
- AS_ECHO_N("testing xmllint... ")
- echo "TEST" > conftest.txt
- if $A2X -f docbook conftest.txt 2>/dev/null; then
- AS_ECHO("ok")
- else
- AS_ECHO("failed")
- XMLLINT="no"
- fi
- rm -f conftest.txt conftest.xml
-fi
-fi #a2x installed
+AC_PATH_PROG(POD2MAN, pod2man, no)
-if test "x$A2X" = "xno" -a "x$ASCIIDOCTOR" = "xno" && \
+if test "x$POD2MAN" = "xno" && \
! test -e docs/man5/tinyproxy.conf.5 -a -e docs/man8/tinyproxy.8 ; then
AC_MSG_ERROR([
- manpage generation requested, but neither a2x, asciidoctor
+ manpage generation requested, but neither pod2man
nor pre-generated manpages found.
Use --disable-manpage-support if you want to compile anyway.])
fi
fi #manpage_support_enabled
-AM_CONDITIONAL(HAVE_A2X, test "x$A2X" != "x" -a "x$A2X" != "xno")
-AM_CONDITIONAL(HAVE_XMLLINT, test "x$XMLLINT" != "x" -a "x$XMLLINT" != "xno")
-AM_CONDITIONAL(HAVE_ASCIIDOCTOR, test "x$ASCIIDOCTOR" != "x" -a "x$ASCIIDOCTOR" != "xno")
+AM_CONDITIONAL(HAVE_POD2MAN, test "x$POD2MAN" != "x" -a "x$POD2MAN" != "xno")
AC_CONFIG_FILES([
Makefile
@@ -237,12 +216,12 @@ scripts/Makefile
AC_OUTPUT
# the manpages are shipped in the release tarball and we don't want them to
-# get regenerated if a2x is not available. the intermediate files from
+# get regenerated if pod2man is not available. the intermediate files from
# AC_CONFIG_FILES are created with config.status, which is created at configure
# runtime, so we need to touch them after config.status terminated to prevent
# make from rebuild them.
-if test "x$A2X" = "xno" -a "x$ASCIIDOCTOR" = "xno" ; then
+if test "x$POD2MAN" = "xno" ; then
touch docs/man5/tinyproxy.conf.txt
touch docs/man8/tinyproxy.txt
if test -e docs/man5/tinyproxy.conf.5 ; then