Index: configure.ac =================================================================== --- configure.ac (revision 46977) +++ configure.ac (working copy) @@ -145,9 +145,31 @@ AC_PROG_EGREP AC_PROG_FGREP +AC_ARG_ENABLE([documentation], AS_HELP_STRING([--disable-documentation], + [Disble building of the documentation]), + [case "${enableval}" in + yes) cond_doc=true ;; + no) cond_doc=false ;; + *) AC_MSG_ERROR(bad value ${enableval} + for --enable-documentation) ;; + esac], [cond_doc=unset]) +if test ! -d doc ; then + if test "$cond_doc" = 'true' ; then + AC_MSG_ERROR([--enable-documentation specified, but doc dir does not exist]) + fi +else + if test "$cond_doc" = 'unset' ; then + cond_doc='yes' + fi +fi +AM_CONDITIONAL([DOC], [test "$cond_doc" = 'true']) + +if test "$cond_doc" = 'true' ; then + AC_CONFIG_FILES([doc/Makefile]) +fi + AC_CONFIG_FILES([ Makefile - doc/Makefile lib/Automake/Makefile lib/Automake/tests/Makefile lib/Makefile Index: Makefile.am =================================================================== --- Makefile.am (revision 46977) +++ Makefile.am (working copy) @@ -20,9 +20,13 @@ ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ## 02110-1301, USA. +if DOC + MAYBE_DOC = doc +endif + ## We need `.' in SUBDIRS because we want `check' to build `.' before ## tests. -SUBDIRS = . doc m4 lib tests +SUBDIRS = . m4 lib tests $(MAYBE_DOC) bin_SCRIPTS = automake aclocal