2003-04-28 Havoc Pennington <hp@redhat.com>
authorHavoc Pennington <hp@redhat.com>
Mon, 28 Apr 2003 23:40:17 +0000 (23:40 +0000)
committerHavoc Pennington <hp@redhat.com>
Mon, 28 Apr 2003 23:40:17 +0000 (23:40 +0000)
        * configure.in: add --enable-docs which by default is auto yes if
        doxygen and db2html found, no otherwise; but can be forced on/off

        * doc/Makefile.am: conditionalize whether to build docs on
        --enable-docs

ChangeLog
configure.in
doc/Makefile.am

index 9cefee0..386c1ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2003-04-28  Havoc Pennington  <hp@redhat.com>
 
+       * configure.in: add --enable-docs which by default is auto yes if
+       doxygen and db2html found, no otherwise; but can be forced on/off
+
+       * doc/Makefile.am: conditionalize whether to build docs on
+       --enable-docs
+
+2003-04-28  Havoc Pennington  <hp@redhat.com>
+
        * configure.in: 0.10
 
        * NEWS: update
index 6c4982f..abb309c 100644 (file)
@@ -30,6 +30,7 @@ AC_ARG_ENABLE(ansi,    [  --enable-ansi    enable -ansi -pedantic gcc flags],ena
 AC_ARG_ENABLE(verbose-mode, [  --enable-verbose-mode support verbose debug mode],enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
 AC_ARG_ENABLE(asserts, [  --enable-asserts include assertion checks],enable_asserts=$enableval,enable_asserts=$USE_MAINTAINER_MODE)
 AC_ARG_ENABLE(checks,  [  --enable-checks  include sanity checks on public API],enable_checks=$enableval,enable_checks=yes)
+AC_ARG_ENABLE(docs,    [  --enable-docs    build documentation (requires Doxygen and jade)],enable_docs=$enableval,enable_docs=auto)
 AC_ARG_ENABLE(gcov,    [  --enable-gcov compile with coverage profiling instrumentation (gcc only)],enable_gcov=$enableval,enable_gcov=no)
 
 AC_ARG_WITH(xml,                [  --with-xml=[libxml/expat] XML library to use])
@@ -431,6 +432,36 @@ dnl Qt flags
 AC_SUBST(DBUS_QT_CXXFLAGS)
 AC_SUBST(DBUS_QT_LIBS)
 
+### Documentation
+
+AC_PATH_PROG(DOXYGEN, doxygen, no)
+AC_PATH_PROG(DB2HTML, db2html, no)
+
+AC_MSG_CHECKING([whether to build documentation])
+
+if test x$DOXYGEN = xno -o x$DB2HTML = xno ; then
+    have_docs_tools=no
+else
+    have_docs_tools=yes
+fi
+
+if test x$enable_docs = xauto ; then
+    if test x$have_docs_tools = xno ; then
+        enable_docs=no
+    else
+        enable_docs=yes
+    fi
+fi
+
+if test x$enable_docs = xyes; then
+    if test x$have_docs_tools = xno; then
+       AC_MSG_ERROR([Building docs explicitly required, but Doxygen or db2html not found])
+    fi
+fi
+
+AM_CONDITIONAL(DBUS_DOCS_ENABLED, test x$enable_docs = xyes)
+AC_MSG_RESULT(yes)
+
 #### find the actual value for $prefix that we'll end up with
 ##   (I know this is broken and should be done in the Makefile, but
 ##    that's a major pain and almost nobody actually seems to care)
@@ -576,6 +607,8 @@ echo "
        source code location:     ${srcdir}
        compiler:                 ${CC}
        cflags:                   ${CFLAGS}
+        Doxygen:                  ${DOXYGEN}
+        db2html:                  ${DB2HTML}
 
         Maintainer mode:          ${USE_MAINTAINER_MODE}
         gcc coverage profiling:   ${enable_gcov}
@@ -585,6 +618,7 @@ echo "
         Building checks:          ${enable_checks}
         Building Qt bindings:     ${have_qt}
         Building GLib bindings:   ${have_glib}
+        Building documentation:   ${enable_docs}
         Using XML parser:         ${with_xml}
         Init scripts style:       ${with_init_scripts}
         System bus socket:        ${DBUS_SYSTEM_SOCKET}
index 5a3a0a2..5c2b645 100644 (file)
@@ -7,17 +7,17 @@ EXTRA_DIST=                                   \
        dcop-howto.txt                          \
        file-boilerplate.c
 
-if MAINTAINER_MODE
+if DBUS_DOCS_ENABLED
 all-local: dbus-specification.html dbus-test-plan.html
 endif
 
 dbus-specification.html: dbus-specification.sgml
-       db2html -o . --nochunks dbus-specification.sgml &&      \
+       $(DB2HTML) -o . --nochunks dbus-specification.sgml &&   \
        rm -r dbus-specification/stylesheet-images &&           \
        (if test -d dbus-specification ; then rmdir dbus-specification ; fi)
 
 dbus-test-plan.html: dbus-test-plan.sgml
-       db2html -o . --nochunks dbus-test-plan.sgml &&          \
+       $(DB2HTML) -o . --nochunks dbus-test-plan.sgml &&               \
        rm -r dbus-test-plan/stylesheet-images &&               \
        (if test -d dbus-test-plan ; then rmdir dbus-test-plan ; fi)