summaryrefslogtreecommitdiff
path: root/common/m4/gst-plugin-docs.m4
diff options
context:
space:
mode:
Diffstat (limited to 'common/m4/gst-plugin-docs.m4')
-rwxr-xr-xcommon/m4/gst-plugin-docs.m447
1 files changed, 47 insertions, 0 deletions
diff --git a/common/m4/gst-plugin-docs.m4 b/common/m4/gst-plugin-docs.m4
new file mode 100755
index 0000000..29ebbd6
--- /dev/null
+++ b/common/m4/gst-plugin-docs.m4
@@ -0,0 +1,47 @@
+dnl AG_GST_PYXML_CHECK([MINIMUM-PYTHON-VERSION])
+
+AC_DEFUN([AG_GST_PYXML_CHECK],
+[
+ AC_BEFORE([AS_PATH_PYTHON],[$0])dnl find python first
+
+ have_pyxml=no
+ if test "x$PYTHON" != x; then
+ AC_MSG_CHECKING([pyxml])
+ if $PYTHON -c "from xml.dom.ext.reader import Sax2" 2>/dev/null \
+ && $PYTHON -c "from xml.dom.NodeFilter import NodeFilter" 2>/dev/null; then
+ AC_MSG_RESULT(yes)
+ have_pyxml=yes
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+])
+
+dnl AG_GST_PLUGIN_DOCS([MINIMUM-GTK-DOC-VERSION],[MINIMUM-PYTHON-VERSION])
+dnl
+dnl checks for prerequisites for the common/mangle-tmpl.py script
+dnl used when building the plugin documentation
+
+AC_DEFUN([AG_GST_PLUGIN_DOCS],
+[
+ AC_BEFORE([GTK_DOC_CHECK],[$0])dnl check for gtk-doc first
+
+ if test x$enable_gtk_doc = xyes -a x$have_gtk_doc = xyes; then
+ AG_GST_PYXML_CHECK([$1])
+ fi
+
+ build_plugin_docs=no
+ AC_MSG_CHECKING([whether to build plugin documentation])
+ if test x$enable_gtk_doc = xyes -a x$have_gtk_doc = xyes; then
+ if test "x$have_pyxml" != xyes; then
+ AC_MSG_RESULT([no (pyxml not installed)])
+ else
+ build_plugin_docs=yes
+ AC_MSG_RESULT([yes])
+ fi
+ else
+ AC_MSG_RESULT([no (gtk-doc disabled or not available)])
+ fi
+
+ AM_CONDITIONAL(ENABLE_PLUGIN_DOCS, test x$build_plugin_docs = xyes)
+])