clean up docs build a little; have docdir be an overridable install location; separat...
authorThomas Vander Stichele <thomas@apestaart.org>
Sat, 3 Sep 2005 13:49:48 +0000 (13:49 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Sat, 3 Sep 2005 13:49:48 +0000 (13:49 +0000)
Original commit message from CVS:
clean up docs build a little; have docdir be an overridable install location; separate gtk-doc and docbook bits

ChangeLog
gtk-doc-plugins.mak
gtk-doc.mak
m4/gst-doc.m4

index 506e9cf..45df1e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-09-03  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+       * gtk-doc-plugins.mak:
+       * gtk-doc.mak:
+       * m4/gst-doc.m4:
+         separate out gtk-doc and docbook stuff
+         have two separate --enable configure flags
+
 2005-08-26  Thomas Vander Stichele  <thomas at apestaart dot org>
 
        * check.mak:
index c867a72..5cb57a1 100644 (file)
@@ -43,7 +43,7 @@ SCANOBJ_FILES =                               \
 
 CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS)
 
-if HAVE_GTK_DOC
+if ENABLE_GTK_DOC
 all-local: html-build.stamp
 
 #### scan ####
@@ -267,7 +267,7 @@ uninstall-local:
 #
 # Require gtk-doc when making dist
 #
-if HAVE_GTK_DOC
+if ENABLE_GTK_DOC
 dist-check-gtkdoc:
 else
 dist-check-gtkdoc:
index 31dde08..0c28a10 100644 (file)
@@ -42,7 +42,7 @@ SCANOBJ_FILES =                               \
 
 CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS)
 
-if HAVE_GTK_DOC
+if ENABLE_GTK_DOC
 all-local: html-build.stamp
 
 #### scan ####
@@ -61,7 +61,7 @@ scan-build.stamp: $(HFILE_GLOB) $(SCANOBJ_DEPS) $(basefiles)
            GST_PLUGIN_PATH_ONLY=1                                      \
            CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)"                         \
            CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)"          \
-           $(GTK_DOC_SCANOBJ) --type-init-func="gst_init(NULL,NULL)"   \
+           gtkdoc-scangobj --type-init-func="gst_init(NULL,NULL)"      \
                --module=$(DOC_MODULE) ;                                \
        else                                                            \
            cd $(srcdir) ;                                              \
@@ -229,7 +229,7 @@ uninstall-local:
 #
 # Require gtk-doc when making dist
 #
-if HAVE_GTK_DOC
+if ENABLE_GTK_DOC
 dist-check-gtkdoc:
 else
 dist-check-gtkdoc:
index 0569ecb..4ccd937 100644 (file)
-AC_DEFUN([GST_DOC], [
-AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=PATH], [path to installed docs]))
-
-if test "x$with_html_dir" = "x" ; then
-  HTML_DIR='${datadir}/gtk-doc/html'
-else
-  HTML_DIR=$with_html_dir
-fi
-
-AC_SUBST(HTML_DIR)
-
-dnl check for gtk-doc
-AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-scangobj, true, false)
-gtk_doc_min_version=1.0
-if $HAVE_GTK_DOC ; then
-    gtk_doc_version=`gtkdoc-mkdb --version`
-    AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
-    if perl -w <<EOF
-      (\$min_version_major, \$min_version_minor ) = "$gtk_doc_min_version" =~ /^(\d+)\.(\d+)$/;
-      (\$gtk_doc_version_major, \$gtk_doc_version_minor ) = "$gtk_doc_version" =~ /^(\d+)\.(\d+)$/;
-      exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
-            ((\$gtk_doc_version_major > \$min_version_major) ||
-            (\$gtk_doc_version_major == \$min_version_major) &&
-            (\$gtk_doc_version_minor >= \$min_version_minor))  ? 0 : 1);
-EOF
-   then
-      AC_MSG_RESULT(yes)
-   else
-      AC_MSG_RESULT(no)
-      HAVE_GTK_DOC=false
-   fi
-fi
-
-# don't you love undocumented command line options?
-GTK_DOC_SCANOBJ="gtkdoc-scangobj --nogtkinit"
-AC_SUBST(HAVE_GTK_DOC)
-AC_SUBST(GTK_DOC_SCANOBJ)
-
-dnl check for docbook tools
-AC_CHECK_PROG(HAVE_DOCBOOK2PS, docbook2ps, true, false)
-AC_CHECK_PROG(HAVE_DOCBOOK2HTML, docbook2html, true, false)
-AC_CHECK_PROG(HAVE_JADETEX, jadetex, true, false)
-AC_CHECK_PROG(HAVE_PS2PDF, ps2pdf, true, false)
-
-# -V option appeared in 0.6.10
-docbook2html_min_version=0.6.10
-if $HAVE_DOCBOOK2HTML ; then
-    docbook2html_version=`docbook2html --version`
-    AC_MSG_CHECKING([docbook2html version ($docbook2html_version) >= $docbook2html_min_version])
-    if perl -w <<EOF
-      (\$min_version_major, \$min_version_minor, \$min_version_micro ) = "$docbook2html_min_version" =~ /(\d+)\.(\d+)\.(\d+)/;
-      (\$docbook2html_version_major, \$docbook2html_version_minor, \$docbook2html_version_micro ) = "$docbook2html_version" =~ /(\d+)\.(\d+)\.(\d+)/;
-      exit (((\$docbook2html_version_major > \$min_version_major) ||
-            ((\$docbook2html_version_major == \$min_version_major) &&
-             (\$docbook2html_version_minor >= \$min_version_minor)) ||
-            ((\$docbook2html_version_major == \$min_version_major) &&
-             (\$docbook2html_version_minor >= \$min_version_minor) &&
-             (\$docbook2html_version_micro >= \$min_version_micro)))
-            ? 0 : 1);
+AC_DEFUN([GST_DOCBOOK_CHECK],
+[
+  dnl choose a location to install docbook docs in
+  docdir="\$(datadir)/doc/$PACKAGE-$GST_MAJORMINOR"
+
+  dnl enable/disable docbook documentation building
+  AC_ARG_ENABLE(docbook,
+  AC_HELP_STRING([--enable-docbook],
+                 [use docbook to build documentation [default=no]]),,
+                 enable_docbook=no)
+
+  have_docbook=no
+
+  if test x$enable_docbook = xyes; then
+    dnl check if we actually have everything we need
+
+    dnl check for docbook tools
+    AC_CHECK_PROG(HAVE_DOCBOOK2PS, docbook2ps, yes, no)
+    AC_CHECK_PROG(HAVE_DOCBOOK2HTML, docbook2html, yes, no)
+    AC_CHECK_PROG(HAVE_JADETEX, jadetex, yes, no)
+    AC_CHECK_PROG(HAVE_PS2PDF, ps2pdf, yes, no)
+
+    # -V option appeared in 0.6.10
+    docbook2html_min_version=0.6.10
+    if test "x$HAVE_DOCBOOK2HTML" != "xyes"; then
+      docbook2html_version=`docbook2html --version`
+      AC_MSG_CHECKING([docbook2html version ($docbook2html_version) >= $docbook2html_min_version])
+      if perl -w <<EOF
+        (\$min_version_major, \$min_version_minor, \$min_version_micro ) = "$docbook2html_min_version" =~ /(\d+)\.(\d+)\.(\d+)/;
+        (\$docbook2html_version_major, \$docbook2html_version_minor, \$docbook2html_version_micro ) = "$docbook2html_version" =~ /(\d+)\.(\d+)\.(\d+)/;
+        exit (((\$docbook2html_version_major > \$min_version_major) ||
+            ((\$docbook2html_version_major == \$min_version_major) &&
+             (\$docbook2html_version_minor >= \$min_version_minor)) ||
+            ((\$docbook2html_version_major == \$min_version_major) &&
+             (\$docbook2html_version_minor >= \$min_version_minor) &&
+             (\$docbook2html_version_micro >= \$min_version_micro)))
+            ? 0 : 1);
 EOF
-   then
-      AC_MSG_RESULT(yes)
-   else
-      AC_MSG_RESULT(no)
-      HAVE_DOCBOOK2HTML=false
-   fi
-fi
-
-dnl check if we can process docbook stuff
-AS_DOCBOOK(HAVE_DOCBOOK=true, HAVE_DOCBOOK=false)
-
-dnl check for extra tools
-AC_CHECK_PROG(HAVE_DVIPS, dvips, true, false)
-
-dnl check for image conversion tools
-AC_CHECK_PROG(HAVE_FIG2DEV, fig2dev, true, false)
-if test "x$HAVE_FIG2DEV" = "xfalse" ; then
-  AC_MSG_WARN([Did not find fig2dev (from xfig), images will not be generated.])
-fi
-
-dnl The following is a hack: if fig2dev doesn't display an error message
-dnl for the desired type, we assume it supports it.
-HAVE_FIG2DEV_EPS=false
-if test "x$HAVE_FIG2DEV" = "xtrue" ; then
-  fig2dev_quiet=`fig2dev -L eps </dev/null 2>&1 >/dev/null`
-  if test "x$fig2dev_quiet" = "x" ; then
-    HAVE_FIG2DEV_EPS=true
-  fi
-fi
-HAVE_FIG2DEV_PNG=false
-if test "x$HAVE_FIG2DEV" = "xtrue" ; then
-  fig2dev_quiet=`fig2dev -L png </dev/null 2>&1 >/dev/null`
-  if test "x$fig2dev_quiet" = "x" ; then
-    HAVE_FIG2DEV_PNG=true
-  fi
-fi
-HAVE_FIG2DEV_PDF=false
-if test "x$HAVE_FIG2DEV" = "xtrue" ; then
-  fig2dev_quiet=`fig2dev -L pdf </dev/null 2>&1 >/dev/null`
-  if test "x$fig2dev_quiet" = "x" ; then
-    HAVE_FIG2DEV_PDF=true
-  fi
-fi
-
-AC_CHECK_PROG(HAVE_PNGTOPNM, pngtopnm, true, false)
-AC_CHECK_PROG(HAVE_PNMTOPS,  pnmtops,  true, false)
-AC_CHECK_PROG(HAVE_EPSTOPDF, epstopdf, true, false)
-
-dnl check if we can generate HTML
-if test "x$HAVE_DOCBOOK2HTML" = "xtrue" && \
-   test "x$HAVE_DOCBOOK" = "xtrue" && \
-   test "x$HAVE_FIG2DEV_PNG" = "xtrue"; then
-  DOC_HTML=true
-  AC_MSG_NOTICE(Will output HTML documentation)
-else
-  DOC_HTML=false
-  AC_MSG_NOTICE(Will not output HTML documentation)
-fi
-
-dnl check if we can generate PS
-if test "x$HAVE_DOCBOOK2PS" = "xtrue" && \
-   test "x$HAVE_DOCBOOK" = "xtrue" && \
-   test "x$HAVE_JADETEX" = "xtrue" && \
-   test "x$HAVE_FIG2DEV_EPS" = "xtrue" && \
-   test "x$HAVE_DVIPS" = "xtrue" && \
-   test "x$HAVE_PNGTOPNM" = "xtrue" && \
-   test "x$HAVE_PNMTOPS" = "xtrue"; then
-  DOC_PS=true
-  AC_MSG_NOTICE(Will output PS documentation)
-else
-  DOC_PS=false
-  AC_MSG_NOTICE(Will not output PS documentation)
-fi
-
-dnl check if we can generate PDF - using only ps2pdf
-if test "x$DOC_PS" = "xtrue" && \
-   test "x$HAVE_DOCBOOK" = "xtrue" && \
-   test "x$HAVE_PS2PDF" = "xtrue"; then
-  DOC_PDF=true
-  AC_MSG_NOTICE(Will output PDF documentation)
-else
-  DOC_PDF=false
-  AC_MSG_NOTICE(Will not output PDF documentation)
-fi
-
-AS_PATH_PYTHON(2.1)
-AC_SUBST(PYTHON)
-
-AC_ARG_ENABLE(docs-build,
-AC_HELP_STRING([--disable-docs-build],[disable building of documentation]),
-[case "${enableval}" in
-  yes)
-    if test "x$HAVE_GTK_DOC" = "xtrue" && \
-       test "x$HAVE_DOCBOOK" = "xtrue"; then
-      BUILD_DOCS=yes
+      then
+        AC_MSG_RESULT(yes)
+      else
+        AC_MSG_RESULT(no)
+        HAVE_DOCBOOK2HTML=no
+      fi
+    fi
+
+    dnl check if we can process docbook stuff
+    AS_DOCBOOK(have_docbook=yes, have_docbook=no)
+    dnl check for extra tools
+    AC_CHECK_PROG(HAVE_DVIPS, dvips, yes, no)
+    dnl check for image conversion tools
+    AC_CHECK_PROG(HAVE_FIG2DEV, fig2dev, yes, no)
+    if test "x$HAVE_FIG2DEV" = "xno" ; then
+      AC_MSG_WARN([Did not find fig2dev (from xfig), images will not be generated.])
+    fi
+    dnl The following is a hack: if fig2dev doesn't display an error message
+    dnl for the desired type, we assume it supports it.
+    HAVE_FIG2DEV_EPS=no
+    if test "x$HAVE_FIG2DEV" = "xyes" ; then
+      fig2dev_quiet=`fig2dev -L eps </dev/null 2>&1 >/dev/null`
+      if test "x$fig2dev_quiet" = "x" ; then
+        HAVE_FIG2DEV_EPS=yes
+      fi
+    fi
+    HAVE_FIG2DEV_PNG=no
+    if test "x$HAVE_FIG2DEV" = "xyes" ; then
+      fig2dev_quiet=`fig2dev -L png </dev/null 2>&1 >/dev/null`
+      if test "x$fig2dev_quiet" = "x" ; then
+        HAVE_FIG2DEV_PNG=yes
+      fi
+    fi
+    HAVE_FIG2DEV_PDF=no
+    if test "x$HAVE_FIG2DEV" = "xyes" ; then
+      fig2dev_quiet=`fig2dev -L pdf </dev/null 2>&1 >/dev/null`
+      if test "x$fig2dev_quiet" = "x" ; then
+        HAVE_FIG2DEV_PDF=yes
+      fi
+    fi
+  
+    AC_CHECK_PROG(HAVE_PNGTOPNM, pngtopnm, yes, no)
+    AC_CHECK_PROG(HAVE_PNMTOPS,  pnmtops,  yes, no)
+    AC_CHECK_PROG(HAVE_EPSTOPDF, epstopdf, yes, no)
+  
+    dnl check if we can generate HTML
+    if test "x$HAVE_DOCBOOK2HTML" = "xyes" && \
+       test "x$enable_docbook" = "xyes" && \
+       test "x$HAVE_FIG2DEV_PNG" = "xyes"; then
+      DOC_HTML=yes
+      AC_MSG_NOTICE(Will output HTML documentation)
+     else
+      DOC_HTML=no
+      AC_MSG_NOTICE(Will not output HTML documentation)
+    fi
+    
+    dnl check if we can generate PS
+    if test "x$HAVE_DOCBOOK2PS" = "xyes" && \
+       test "x$enable_docbook" = "xyes" && \
+       test "x$HAVE_JADETEX" = "xyes" && \
+       test "x$HAVE_FIG2DEV_EPS" = "xyes" && \
+       test "x$HAVE_DVIPS" = "xyes" && \
+       test "x$HAVE_PNGTOPNM" = "xyes" && \
+       test "x$HAVE_PNMTOPS" = "xyes"; then
+      DOC_PS=yes
+      AC_MSG_NOTICE(Will output PS documentation)
+    else
+      DOC_PS=no
+      AC_MSG_NOTICE(Will not output PS documentation)
+    fi
+    
+    dnl check if we can generate PDF - using only ps2pdf
+    if test "x$DOC_PS" = "xyes" && \
+       test "x$enable_docbook" = "xyes" && \
+       test "x$HAVE_PS2PDF" = "xyes"; then
+      DOC_PDF=yes
+      AC_MSG_NOTICE(Will output PDF documentation)
     else
-      BUILD_DOCS=no
-    fi ;;
-  no)  BUILD_DOCS=no ;;
-  *) AC_MSG_ERROR(bad value ${enableval} for --disable-docs-build) ;;
-esac],
-[BUILD_DOCS=yes]) dnl Default value
+      DOC_PDF=no
+      AC_MSG_NOTICE(Will not output PDF documentation)
+    fi
+
+    dnl if we don't have everything, we should disable
+    if test "x$have_docbook" != "xyes"; then
+      enable_docbook=no
+    fi
+  fi
 
-dnl AC_ARG_ENABLE(plugin-docs,
-dnl [  --enable-plugin-docs         enable the building of plugin documentation
-dnl                                (this is currently broken, so off by default)],
-dnl [case "${enableval}" in
-dnl   yes) BUILD_PLUGIN_DOCS=yes ;;
-dnl   no)  BUILD_PLUGIN_DOCS=no ;;
-dnl   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-docs) ;;
-dnl esac], 
-dnl [BUILD_PLUGIN_DOCS=yes]) dnl Default value
-BUILD_PLUGIN_DOCS=no
+  dnl if we're going to install documentation, tell us where
+  if test "x$have_docbook" = "xyes"; then
+    AC_MSG_NOTICE(Installing documentation in $docdir)
+    AC_SUBST(docdir)
+  fi
 
-AM_CONDITIONAL(HAVE_GTK_DOC,        $HAVE_GTK_DOC)
-AM_CONDITIONAL(HAVE_DOCBOOK,        $HAVE_DOCBOOK)
-AM_CONDITIONAL(BUILD_DOCS,          test "x$BUILD_DOCS" = "xyes")
-AM_CONDITIONAL(BUILD_PLUGIN_DOCS,   test "x$BUILD_PLUGIN_DOCS" = "xyes")
-AM_CONDITIONAL(DOC_HTML,            $DOC_HTML)
-AM_CONDITIONAL(DOC_PDF,             $DOC_PDF)
-AM_CONDITIONAL(DOC_PS,              $DOC_PS)
+  AM_CONDITIONAL(ENABLE_DOCBOOK,      test x$enable_docbook = xyes)
+  AM_CONDITIONAL(DOC_HTML,            test x$DOC_HTML = xyes)
+  AM_CONDITIONAL(DOC_PDF,             test x$DOC_PDF = xyes)
+  AM_CONDITIONAL(DOC_PS,              test x$DOC_PS = xyes)
 ])
-