# HG changeset patch # User John W. Eaton # Date 1263372045 18000 # Node ID 02453ee2014004e878b3d561dbec90d27a686f1d # Parent a115046d462d4498ff7ec15497ec92b02825b411 allow building of docs to be disabled diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-01-13 John W. Eaton + + * configure.ac: Handle --enable-docs. Print warning in summary + if building documentation is disabled. + * Makefile.am (SUBDIRS): Use @DOCDIR@ instead of doc. + (dist-hook): New target, conditional on AMCOND_BUILD_DOCS. + 2010-01-09 John W. Eaton * configure.ac: Don't check for nlink_t. diff --git a/Makefile.am b/Makefile.am --- a/Makefile.am +++ b/Makefile.am @@ -69,7 +69,13 @@ include m4/module.mk # Subdirectories in which to run `make all'. -SUBDIRS = libgnu libcruft liboctave src scripts doc examples test +SUBDIRS = libgnu libcruft liboctave src scripts @DOCDIR@ examples test + +if AMCOND_BUILD_DOCS +else +dist-hook: + echo "Documentation disabled. Cannot package distribution!" ; exit 1; +endif BUILT_SHELL_FILES = \ mkoctfile$(SCRIPTS_EXE_SUFFIX) \ diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -152,6 +152,19 @@ AC_DEFINE(BOUNDS_CHECKING, 1, [Define to use internal bounds checking.]) fi +### Make it possible to disable running Make in the doc directory. +### Useful for building on systems without TeX, for example. +DOCDIR=doc +AC_ARG_ENABLE(docs, + [AS_HELP_STRING([--enable-docs], [build documentation (default is yes)])], + [if test "$enableval" = no; then + DOCDIR= + warn_docs="building documentation disabled; make dist will fail" + AC_MSG_WARN([$warn_docs]) + fi], []) +AC_SUBST(DOCDIR) +AM_CONDITIONAL([AMCOND_BUILD_DOCS], [test -n "$DOCDIR"]) + ### If possible, use a 64-bit integer type for array dimensions and indexing. USE_64_BIT_IDX_T=false @@ -2281,6 +2294,11 @@ warn_msg_printed=true fi +if test -n "$warn_docs"; then + AC_MSG_WARN([$warn_docs]) + warn_msg_printed=true +fi + if test -n "$warn_64_bit"; then AC_MSG_WARN([$warn_64_bit]) warn_msg_printed=true