+GCC_NEED_DECLARATION(): See whether we need a declaration for a function.
[macros.git] / gtk-doc.m4
1 # $Id$
2 # Macros for gtk-doc
3 # from gtk-doc-0.9-5/usr/share/doc/gtk-doc-0.9/examples/configure.in
4 # Copyright (C) 2002 Jan Kratochvil <project-macros@jankratochvil.net>
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; exactly version 2 of June 1991 is required
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19
20 # local diff:
21 # s/if test x$GTKDOC = xtrue ; then/if test x$GTKDOC = xtrue -o x$USE_MAINTAINER_MODE = xyes ; then/
22
23
24 AC_DEFUN([GTK_DOC_CHECK],
25 [
26
27 # This is a check for gtk-doc which you can insert into your configure.in.
28 # You shouldn't need to change it at all.
29
30
31 ##################################################
32 # Check for gtk-doc.
33 ##################################################
34
35 AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
36
37 if test "x$with_html_dir" = "x" ; then
38   HTML_DIR='${datadir}/gtk-doc/html'
39 else
40   HTML_DIR=$with_html_dir
41 fi
42
43 AC_SUBST(HTML_DIR)
44
45 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
46
47 gtk_doc_min_version=0.6
48 if $GTKDOC ; then 
49     gtk_doc_version=`gtkdoc-mkdb --version`
50     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
51     if perl <<EOF ; then
52       exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
53             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
54 EOF
55       AC_MSG_RESULT(yes)
56    else
57       AC_MSG_RESULT(no)
58       GTKDOC=false
59    fi
60 fi
61
62 dnl Let people disable the gtk-doc stuff.
63 AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
64
65 if test x$enable_gtk_doc = xauto ; then
66   if test x$GTKDOC = xtrue -o x$USE_MAINTAINER_MODE = xyes ; then
67     enable_gtk_doc=yes
68   else
69     enable_gtk_doc=no 
70   fi
71 fi
72
73 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
74
75
76 ])