0 | 0 |
dnl -*- mode: autoconf -*-
|
1 | 1 |
|
2 | |
# serial 1
|
|
2 |
# serial 2
|
3 | 3 |
|
4 | 4 |
dnl Usage:
|
5 | 5 |
dnl GTK_DOC_CHECK([minimum-gtk-doc-version])
|
|
9 | 9 |
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
|
10 | 10 |
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
|
11 | 11 |
|
|
12 |
ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"])
|
|
13 |
AC_MSG_CHECKING([for gtk-doc])
|
|
14 |
PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no])
|
|
15 |
AC_MSG_RESULT($have_gtk_doc)
|
|
16 |
|
|
17 |
if test "$have_gtk_doc" = "no"; then
|
|
18 |
AC_MSG_WARN([
|
|
19 |
You will not be able to create source packages with 'make dist'
|
|
20 |
because $gtk_doc_requires is not found.])
|
|
21 |
fi
|
|
22 |
|
12 | 23 |
dnl check for tools we added during development
|
13 | |
AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check])
|
|
24 |
dnl Use AC_CHECK_PROG to avoid the check target using an absolute path that
|
|
25 |
dnl may not be writable by the user. Currently, automake requires that the
|
|
26 |
dnl test name must end in '.test'.
|
|
27 |
dnl https://bugzilla.gnome.org/show_bug.cgi?id=701638
|
|
28 |
AC_CHECK_PROG([GTKDOC_CHECK],[gtkdoc-check],[gtkdoc-check.test])
|
|
29 |
AC_PATH_PROG([GTKDOC_CHECK_PATH],[gtkdoc-check])
|
14 | 30 |
AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true])
|
15 | 31 |
AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf])
|
16 | 32 |
|
|
27 | 43 |
[use gtk-doc to build documentation [[default=no]]]),,
|
28 | 44 |
[enable_gtk_doc=no])
|
29 | 45 |
|
30 | |
if test x$enable_gtk_doc = xyes; then
|
31 | |
ifelse([$1],[],
|
32 | |
[PKG_CHECK_EXISTS([gtk-doc],,
|
33 | |
AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))],
|
34 | |
[PKG_CHECK_EXISTS([gtk-doc >= $1],,
|
35 | |
AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))])
|
36 | |
dnl don't check for glib if we build glib
|
37 | |
if test "x$PACKAGE_NAME" != "xglib"; then
|
38 | |
dnl don't fail if someone does not have glib
|
39 | |
PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,)
|
40 | |
fi
|
|
46 |
AC_MSG_CHECKING([whether to build gtk-doc documentation])
|
|
47 |
AC_MSG_RESULT($enable_gtk_doc)
|
|
48 |
|
|
49 |
if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then
|
|
50 |
AC_MSG_ERROR([
|
|
51 |
You must have $gtk_doc_requires installed to build documentation for
|
|
52 |
$PACKAGE_NAME. Please install gtk-doc or disable building the
|
|
53 |
documentation by adding '--disable-gtk-doc' to '[$]0'.])
|
41 | 54 |
fi
|
42 | 55 |
|
43 | |
AC_MSG_CHECKING([whether to build gtk-doc documentation])
|
44 | |
AC_MSG_RESULT($enable_gtk_doc)
|
|
56 |
dnl don't check for glib if we build glib
|
|
57 |
if test "x$PACKAGE_NAME" != "xglib"; then
|
|
58 |
dnl don't fail if someone does not have glib
|
|
59 |
PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:])
|
|
60 |
fi
|
45 | 61 |
|
46 | 62 |
dnl enable/disable output formats
|
47 | 63 |
AC_ARG_ENABLE([gtk-doc-html],
|
|
57 | 73 |
enable_gtk_doc_pdf=no
|
58 | 74 |
fi
|
59 | 75 |
|
|
76 |
if test -z "$AM_DEFAULT_VERBOSITY"; then
|
|
77 |
AM_DEFAULT_VERBOSITY=1
|
|
78 |
fi
|
|
79 |
AC_SUBST([AM_DEFAULT_VERBOSITY])
|
60 | 80 |
|
|
81 |
AM_CONDITIONAL([HAVE_GTK_DOC], [test x$have_gtk_doc = xyes])
|
61 | 82 |
AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])
|
62 | 83 |
AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes])
|
63 | 84 |
AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes])
|