diff options
author | rofl0r <rofl0r@users.noreply.github.com> | 2020-08-12 00:15:45 +0100 |
---|---|---|
committer | rofl0r <rofl0r@users.noreply.github.com> | 2020-08-12 00:15:45 +0100 |
commit | 5ba958829f73ecc02658a46f5b1bba5ffed2281d (patch) | |
tree | 68bacaf4eaec17e53b884fdde86bffde1ba301f7 /configure.ac | |
parent | e1d36d3f74f02b74429d92dd9af6fcab05038dad (diff) |
add configure option to disable manpage generation
using --disable-manpage-support it's finally possibly to disable
the formerly obligatory use of a2x to generate the manpage
documentation.
this is the final solution to the decade old problem that users need
to install the enormous asciidoc package to compile TINYproxy from
source, or otherwise get a build error, even though the vast majority
is only interested in the program itself.
solution was inspired by PR #179.
closes #179
closes #111
note that since 1.10.0 release the generated release tarball includes
the generated manpages too; in which case neither the use of a2x
nor --disable-manpage-support is required.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 9623754..e645dc1 100644 --- a/configure.ac +++ b/configure.ac @@ -96,6 +96,15 @@ if test x"$transparent_enabled" = x"yes"; then AC_DEFINE(TRANSPARENT_PROXY) fi +dnl Let user decide whether he wants support for manpages +dnl Which require either a2x/asciidoctor or a tarball release +AH_TEMPLATE([MANPAGE_SUPPORT], + [Build manpages with a2x/asciidoctor if they are missing from the distribution.]) +TP_ARG_ENABLE(manpage_support, + [Enable support for building manpages (default is YES)], + yes) +AM_CONDITIONAL(HAVE_MANPAGE_INTEREST, test x"$manpage_support_enabled" = x"yes") + # This is required to build test programs below AC_PROG_CC @@ -173,15 +182,14 @@ AC_SUBST(CPPFLAGS) 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) -AM_CONDITIONAL(HAVE_A2X, test "x$A2X" != "xno") - +if test "x$A2X" = "xno" ; then # Check for asciidoctor AC_PATH_PROG(ASCIIDOCTOR, asciidoctor, no) -AM_CONDITIONAL(HAVE_ASCIIDOCTOR, test "x$ASCIIDOCTOR" != "xno") - -# checking xmllint +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... ") @@ -194,7 +202,20 @@ if test "x$XMLLINT" != "xno"; then fi rm -f conftest.txt conftest.xml fi -AM_CONDITIONAL(HAVE_XMLLINT, test "x$XMLLINT" != "xno") +fi #a2x installed + +if test "x$A2X" = "xno" -a "x$ASCIIDOCTOR" = "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 + 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") AC_CONFIG_FILES([ Makefile |