Add checks for gtk-doc availability
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 13 Aug 2008 08:25:51 +0000 (10:25 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 13 Aug 2008 08:25:51 +0000 (10:25 +0200)
acinclude.m4
bootstrap-configure
configure.ac

index 95486c3..9c51ddf 100644 (file)
@@ -9,3 +9,37 @@ AC_DEFUN([AC_PROG_CC_PIE], [
                rm -rf conftest*
        ])
 ])
+
+AC_DEFUN([GTK_DOC_CHECK],
+[
+  AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+  AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+  dnl for overriding the documentation installation directory
+  AC_ARG_WITH([html-dir],
+    AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
+    [with_html_dir='${datadir}/gtk-doc/html'])
+  HTML_DIR="$with_html_dir"
+  AC_SUBST([HTML_DIR])
+
+  dnl enable/disable documentation building
+  AC_ARG_ENABLE([gtk-doc],
+    AS_HELP_STRING([--enable-gtk-doc],
+                   [use gtk-doc to build documentation [[default=no]]]),,
+    [enable_gtk_doc=no])
+
+  if test x$enable_gtk_doc = xyes; then
+    ifelse([$1],[],
+      [PKG_CHECK_EXISTS([gtk-doc],,
+                        AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))],
+      [PKG_CHECK_EXISTS([gtk-doc >= $1],,
+                        AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build gtk-doc]))])
+  fi
+
+  AC_MSG_CHECKING([whether to build gtk-doc documentation])
+  AC_MSG_RESULT($enable_gtk_doc)
+
+  AC_PATH_PROGS(GTKDOC_CHECK,gtkdoc-check,)
+
+  AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])
+  AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"])
+])
index 2b8dc78..ea6d525 100755 (executable)
@@ -4,8 +4,13 @@ if [ -f config.status ]; then
        make maintainer-clean
 fi
 
+if [ ! -f doc/gtk-doc.make ]; then
+       gtkdocize --copy --docdir doc
+fi
+
 ./bootstrap && \
     ./configure --enable-maintainer-mode \
+               --enable-gtk-doc \
                --enable-debug \
                --prefix=/usr \
                --mandir=/usr/share/man \
index fdb290b..fe70d73 100644 (file)
@@ -24,6 +24,8 @@ m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
 AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
 
+GTK_DOC_CHECK
+
 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
                        [enable compiling with debugging information]), [
        if (test "${enableval}" = "yes" &&