diff options
author | Orestis Floros <orestisflo@gmail.com> | 2020-05-05 17:39:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-05 17:39:49 +0200 |
commit | 4bd07355abb1ad6b5463db7e7c763ea0075ebbc8 (patch) | |
tree | 9976f92f58a5593018c38fb82e4878ac3f1a83ca | |
parent | ae49ec4bcbb2474392851cea34d2d31a3d16eb4a (diff) |
configure: Add switch to disable manual pages (#413)
Code copied from i3
Fixes #377
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | configure.ac | 20 |
2 files changed, 18 insertions, 6 deletions
diff --git a/Makefile.am b/Makefile.am index 15b8ffb..b6e40f3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,6 +5,7 @@ echo-version: bin_PROGRAMS = i3status +if BUILD_MANS dist_man1_MANS = \ $(asciidoc_MANS) @@ -17,6 +18,9 @@ $(asciidoc_MANS): man/%.1: man/%.xml man/$(dirstamp) man/%.xml: man/%.man man/asciidoc.conf man/$(dirstamp) $(AM_V_GEN) @PATH_ASCIIDOC@ -d manpage -b docbook -f $(top_builddir)/man/asciidoc.conf -o $@ $< +else +asciidoc_MANS = +endif AM_CPPFLAGS = \ -DSYSCONFDIR="\"$(sysconfdir)\"" \ diff --git a/configure.ac b/configure.ac index 11caa33..3468cb1 100644 --- a/configure.ac +++ b/configure.ac @@ -114,12 +114,20 @@ AC_PROG_MAKE_SET AC_PROG_RANLIB AC_PROG_LN_S -AC_PATH_PROG([PATH_ASCIIDOC], [asciidoc], [no]) -AS_IF([test x"$PATH_ASCIIDOC" = x"no"], - [AC_MSG_ERROR([asciidoc is required for generating man pages])]) -AC_PATH_PROG([PATH_XMLTO], [xmlto], [no]) -AS_IF([test x"$PATH_XMLTO" = x"no"], - [AC_MSG_ERROR([xmlto is required for generating man pages])]) +AC_ARG_ENABLE(mans, + AS_HELP_STRING( + [--disable-mans], + [disable building manual pages]), + [ax_mans=$enableval], + [ax_mans=yes]) +AS_IF([test x$ax_mans = xyes], [ + AC_PATH_PROG([PATH_ASCIIDOC], [asciidoc]) +]) +AS_IF([test x$ax_mans = xyes], [ + AC_PATH_PROG([PATH_XMLTO], [xmlto]) + AC_PATH_PROG([PATH_POD2MAN], [pod2man]) +]) +AM_CONDITIONAL([BUILD_MANS], [test x$ax_mans = xyes && test x$PATH_ASCIIDOC != x && test x$PATH_XMLTO != x && test x$PATH_POD2MAN != x]) AM_PROG_AR |