Add a configure setting to skip "doc/"

This should fix all remaining build issues with documentation
generation. Finally.

The new "--disable-docs" option should be used to skip documentation
completely, whereas "--without-asciidoc" can be used if both manual and
man page should not be rebuilt. As a consequence, "--without-asciidoc"
can only be combined with "--enable-docs" if ready-made documentation
already exists in "doc/". This is true for release tarballs (where we
include prebuilt documentation for the sake of portability and
simplicity), as well as for Git checkouts where the documentation has
already been built earlier.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2011-09-03 02:19:32 +02:00
parent b59070a49e
commit ac50b5a111
3 changed files with 24 additions and 9 deletions

View File

@ -2,7 +2,11 @@ AUTOMAKE_OPTIONS= foreign
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
SUBDIRS = doc po src SUBDIRS = po src
if ENABLE_DOCS
SUBDIRS += doc
endif
EXTRA_DIST = \ EXTRA_DIST = \
INSTALL \ INSTALL \

View File

@ -70,23 +70,34 @@ AC_CHECK_HEADERS([math.h], [
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Check whether to build documentation # Check whether to build documentation
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
AC_ARG_ENABLE(docs,
AS_HELP_STRING([--disable-docs], [skip documentation]),
[enabledocs=$enableval], [enabledocs=yes])
if test x"$enabledocs" != x"yes"; then
enabledocs=no
AC_MSG_WARN([Skipping documentation!])
fi
AC_MSG_CHECKING([whether to include documentation])
AC_MSG_RESULT($enabledocs)
AM_CONDITIONAL(ENABLE_DOCS, test x"$enabledocs" = x"yes")
AC_ARG_WITH(asciidoc, AC_ARG_WITH(asciidoc,
AS_HELP_STRING([--with-asciidoc], AS_HELP_STRING([--with-asciidoc],
[Use asciidoc to regenerate documentation.]), [use AsciiDoc to regenerate documentation]),
[use_asciidoc=$withval], [use_asciidoc=$withval],
[use_asciidoc="auto"]) [use_asciidoc="auto"])
if test x"$use_asciidoc" = x"auto"; then if test x"$use_asciidoc" = x"auto"; then
AC_PATH_PROG([ASCIIDOC], [asciidoc]) AC_PATH_PROG([ASCIIDOC], [asciidoc])
if test -z "$ASCIIDOC"; then if test -z "$ASCIIDOC"; then
have_asciidoc=no have_asciidoc=no
AC_MSG_WARN([AsciiDoc not found - documentation will be skipped!]) AC_MSG_WARN([AsciiDoc not found - cannot rebuild documentation!])
else else
have_asciidoc=yes have_asciidoc=yes
fi fi
AC_PATH_PROG([A2X], [a2x]) AC_PATH_PROG([A2X], [a2x])
if test -z "$A2X"; then if test -z "$A2X"; then
have_a2x=no have_a2x=no
AC_MSG_WARN([a2x not found - man pages will be skipped!]) AC_MSG_WARN([a2x not found - cannot rebuild man pages!])
else else
have_a2x=yes have_a2x=yes
fi fi
@ -101,7 +112,7 @@ elif test x"$use_asciidoc" = x"yes"; then
fi fi
have_asciidoc=yes have_asciidoc=yes
elif test x"$use_asciidoc" = x"no"; then elif test x"$use_asciidoc" = x"no"; then
AC_MSG_WARN(["--without-asciidoc" specified - documentation will be skipped!]) AC_MSG_WARN([Will not rebuild documentation!])
have_asciidoc=no have_asciidoc=no
have_a2x=no have_a2x=no
fi fi

View File

@ -5,19 +5,19 @@ ASCIIDOC_ARGS = \
-n \ -n \
-a toc \ -a toc \
-a icons -a icons
dist_doc_DATA = \
manual.html
endif endif
if HAVE_A2X if HAVE_A2X
A2X_ARGS = \ A2X_ARGS = \
-d manpage \ -d manpage \
-f manpage -f manpage
endif
dist_doc_DATA = \
manual.html
dist_man_MANS = \ dist_man_MANS = \
calcurse.1 calcurse.1
endif
EXTRA_DIST = \ EXTRA_DIST = \
manual.txt \ manual.txt \