Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | From 936d8068ae19d95260d3058f41dd6cf718101cd6 Mon Sep 17 00:00:00 2001 |
| 2 | From: Christian Krause <kizkizzbangbang@googlemail.com> |
| 3 | Date: Sat, 26 Dec 2015 14:36:17 +0100 |
| 4 | Subject: [PATCH] option to not build man page |
| 5 | |
| 6 | fixes #56 |
| 7 | --- |
| 8 | configure.ac | 23 +++++++++++++++++++---- |
| 9 | src/Makefile.am | 2 ++ |
| 10 | 2 files changed, 21 insertions(+), 4 deletions(-) |
| 11 | |
| 12 | Upstream-Status: Backport |
| 13 | RP 2016/01/22 |
| 14 | |
| 15 | diff --git a/configure.ac b/configure.ac |
| 16 | index b437e56..4cb56bc 100644 |
| 17 | --- a/configure.ac |
| 18 | +++ b/configure.ac |
| 19 | @@ -20,13 +20,28 @@ AC_CHECK_FILE( |
| 20 | [src/pixz.1], |
| 21 | [], |
| 22 | [ |
| 23 | - AC_CHECK_PROG(A2X, a2x, a2x, []) |
| 24 | - if test "x$A2X" = x ; then |
| 25 | - AC_MSG_ERROR([AsciiDoc not found, not able to generate the man page.]) |
| 26 | - fi |
| 27 | + AC_ARG_WITH( |
| 28 | + [manpage], |
| 29 | + [ --without-manpage don't build man page], |
| 30 | + [case ${withval} in |
| 31 | + yes) manpage=true ;; |
| 32 | + no) manpage=false ;; |
| 33 | + *) AC_MSG_ERROR([bad value ${withval} for --with-manpage]) ;; |
| 34 | + esac], |
| 35 | + [manpage=true] |
| 36 | + ) |
| 37 | ] |
| 38 | ) |
| 39 | |
| 40 | +AM_CONDITIONAL([MANPAGE], [test x$manpage = xtrue]) |
| 41 | + |
| 42 | +if test x$manpage = xtrue ; then |
| 43 | + AC_CHECK_PROG(A2X, a2x, a2x, []) |
| 44 | + if test "x$A2X" = x ; then |
| 45 | + AC_MSG_ERROR([AsciiDoc not found, not able to generate the man page.]) |
| 46 | + fi |
| 47 | +fi |
| 48 | + |
| 49 | # Checks for libraries. |
| 50 | AC_CHECK_LIB([m], [ceil]) |
| 51 | AX_PTHREAD |
| 52 | diff --git a/src/Makefile.am b/src/Makefile.am |
| 53 | index 600ec90..b98f450 100644 |
| 54 | --- a/src/Makefile.am |
| 55 | +++ b/src/Makefile.am |
| 56 | @@ -15,6 +15,7 @@ pixz_SOURCES = \ |
| 57 | read.c \ |
| 58 | write.c |
| 59 | |
| 60 | +if MANPAGE |
| 61 | # TODO remove when possible: This is a hack because a2x is not able to output the man pages to a |
| 62 | # specific directory, only to where the source is. |
| 63 | pixz.1: pixz.1.asciidoc |
| 64 | @@ -26,3 +27,4 @@ man_MANS = pixz.1 |
| 65 | CLEANFILES = pixz.1 |
| 66 | |
| 67 | EXTRA_DIST = $(man_MANS) pixz.1.asciidoc |
| 68 | +endif |