Adding upstream version 1.0.1.
[debian/menu-cache.git] / m4 / gtk-doc.m4
CommitLineData
eac4754c
AG
1dnl -*- mode: autoconf -*-
2
3# serial 1
4
5dnl Usage:
6dnl GTK_DOC_CHECK([minimum-gtk-doc-version])
7AC_DEFUN([GTK_DOC_CHECK],
8[
9 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
10 AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
11 AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
12
13 dnl check for tools we added during development
14 AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check])
15 AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true])
16 AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf])
17
18 dnl for overriding the documentation installation directory
19 AC_ARG_WITH([html-dir],
20 AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
21 [with_html_dir='${datadir}/gtk-doc/html'])
22 HTML_DIR="$with_html_dir"
23 AC_SUBST([HTML_DIR])
24
25 dnl enable/disable documentation building
26 AC_ARG_ENABLE([gtk-doc],
27 AS_HELP_STRING([--enable-gtk-doc],
28 [use gtk-doc to build documentation [[default=no]]]),,
29 [enable_gtk_doc=no])
30
31 if test x$enable_gtk_doc = xyes; then
32 ifelse([$1],[],
33 [PKG_CHECK_EXISTS([gtk-doc],,
34 AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))],
35 [PKG_CHECK_EXISTS([gtk-doc >= $1],,
36 AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))])
37 dnl don't check for glib if we build glib
38 if test "x$PACKAGE_NAME" != "xglib"; then
39 dnl don't fail if someone does not have glib
40 PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,)
41 fi
42 fi
43
44 AC_MSG_CHECKING([whether to build gtk-doc documentation])
45 AC_MSG_RESULT($enable_gtk_doc)
46
47 dnl enable/disable output formats
48 AC_ARG_ENABLE([gtk-doc-html],
49 AS_HELP_STRING([--enable-gtk-doc-html],
50 [build documentation in html format [[default=yes]]]),,
51 [enable_gtk_doc_html=yes])
52 AC_ARG_ENABLE([gtk-doc-pdf],
53 AS_HELP_STRING([--enable-gtk-doc-pdf],
54 [build documentation in pdf format [[default=no]]]),,
55 [enable_gtk_doc_pdf=no])
56
57 if test -z "$GTKDOC_MKPDF"; then
58 enable_gtk_doc_pdf=no
59 fi
60
61
62 AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])
63 AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes])
64 AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes])
65 AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"])
66 AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"])
67])