1853
1853
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
1854
1854
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
1856
ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"])
1857
AC_MSG_CHECKING([for gtk-doc])
1858
PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no])
1859
AC_MSG_RESULT($have_gtk_doc)
1861
if test "$have_gtk_doc" = "no"; then
1863
You will not be able to create source packages with 'make dist'
1864
because $gtk_doc_requires is not found.])
1856
1867
dnl check for tools we added during development
1857
AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check])
1868
dnl Use AC_CHECK_PROG to avoid the check target using an absolute path that
1869
dnl may not be writable by the user. Currently, automake requires that the
1870
dnl test name must end in '.test'.
1871
dnl https://bugzilla.gnome.org/show_bug.cgi?id=701638
1872
AC_CHECK_PROG([GTKDOC_CHECK],[gtkdoc-check],[gtkdoc-check.test])
1873
AC_PATH_PROG([GTKDOC_CHECK_PATH],[gtkdoc-check])
1858
1874
AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true])
1859
1875
AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf])
1871
1887
[use gtk-doc to build documentation [[default=no]]]),,
1872
1888
[enable_gtk_doc=no])
1874
if test x$enable_gtk_doc = xyes; then
1876
[PKG_CHECK_EXISTS([gtk-doc],,
1877
AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))],
1878
[PKG_CHECK_EXISTS([gtk-doc >= $1],,
1879
AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))])
1880
dnl don't check for glib if we build glib
1881
if test "x$PACKAGE_NAME" != "xglib"; then
1882
dnl don't fail if someone does not have glib
1883
PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:])
1887
1890
AC_MSG_CHECKING([whether to build gtk-doc documentation])
1888
1891
AC_MSG_RESULT($enable_gtk_doc)
1893
if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then
1895
You must have $gtk_doc_requires installed to build documentation for
1896
$PACKAGE_NAME. Please install gtk-doc or disable building the
1897
documentation by adding '--disable-gtk-doc' to '[$]0'.])
1900
dnl don't check for glib if we build glib
1901
if test "x$PACKAGE_NAME" != "xglib"; then
1902
dnl don't fail if someone does not have glib
1903
PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:])
1890
1906
dnl enable/disable output formats
1891
1907
AC_ARG_ENABLE([gtk-doc-html],
1892
1908
AS_HELP_STRING([--enable-gtk-doc-html],
1907
1923
AC_SUBST([AM_DEFAULT_VERBOSITY])
1925
AM_CONDITIONAL([HAVE_GTK_DOC], [test x$have_gtk_doc = xyes])
1909
1926
AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])
1910
1927
AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes])
1911
1928
AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes])