From ce75f5d34e56d7e7e4139da1be2f8d8f6c872eeb Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Wed, 8 Feb 2012 20:43:30 +0100 Subject: [PATCH] build system: Check for a2x and xsltproc. If these tools are not found, don't try to build the documentation. --- Makefile.am | 5 ++++- configure.ac | 27 +++++++++++++++++++++++++++ doc/Makefile.am | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 76a1016..3fab3fa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,7 @@ -SUBDIRS = doc src +SUBDIRS = src +if BUILD_DOCUMENTATION +SUBDIRS += doc +endif EXTRA_DIST = autogen.sh version-gen.sh diff --git a/configure.ac b/configure.ac index 715639b..5f0be65 100644 --- a/configure.ac +++ b/configure.ac @@ -193,6 +193,26 @@ AC_SUBST([STRICT_CFLAGS]) AC_CHECK_HEADERS(libgen.h) +dnl Check for dependencies. +build_documentation="yes" + +have_xsltproc="yes" +AC_PATH_PROG([XSLTPROC], [xsltproc]) +if test "x$XSLTPROC" = "x"; then + have_xsltproc="no" + build_documentation="no (missing xsltproc)" +fi + +have_a2x="yes" +AC_PATH_PROG([A2X], [a2x]) +if test "x$A2X" = "x"; then + have_a2x="no" + build_documentation="no (missing a2x)" +fi +AC_SUBST([A2X]) + +AM_CONDITIONAL([BUILD_DOCUMENTATION], test "x$build_documentation" = "xyes") + AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile]) AC_OUTPUT @@ -208,6 +228,13 @@ Configuration summary: package version: $PACKAGE_VERSION build date: `date --utc '+%F %T'` (UTC) + Tools: + AsciiDoc (a2x): . . . . . . $have_a2x + xsltproc: . . . . . . . . . $have_xsltproc + + Features: + documentation: . . . . . . $build_documentation + This package is maintained by $PACKAGE_MAINTAINER. Please report bugs to $PACKAGE_BUGREPORT. diff --git a/doc/Makefile.am b/doc/Makefile.am index aca1d7e..f25dab5 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -6,7 +6,7 @@ man_MANS = fb.1 fb.1: fb.txt ../version .txt.1: - a2x -d manpage -f manpage \ + @A2X@ -d manpage -f manpage \ -apackage_version=$(PACKAGE_VERSION) \ -abuild_date="$$( date --utc '+%F' )" \ $< -- 2.30.2