Blame m4/gtk-doc.m4

Packit Service ac8c34
dnl -*- mode: autoconf -*-
Packit Service ac8c34
Packit Service ac8c34
# serial 2
Packit Service ac8c34
Packit Service ac8c34
dnl Usage:
Packit Service ac8c34
dnl   GTK_DOC_CHECK([minimum-gtk-doc-version])
Packit Service ac8c34
AC_DEFUN([GTK_DOC_CHECK],
Packit Service ac8c34
[
Packit Service ac8c34
  AC_REQUIRE([PKG_PROG_PKG_CONFIG])
Packit Service ac8c34
  AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
Packit Service ac8c34
  AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
Packit Service ac8c34
Packit Service ac8c34
  ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"])
Packit Service ac8c34
  AC_MSG_CHECKING([for gtk-doc])
Packit Service ac8c34
  PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no])
Packit Service ac8c34
  AC_MSG_RESULT($have_gtk_doc)
Packit Service ac8c34
Packit Service ac8c34
  if test "$have_gtk_doc" = "no"; then
Packit Service ac8c34
      AC_MSG_WARN([
Packit Service ac8c34
  You will not be able to create source packages with 'make dist'
Packit Service ac8c34
  because $gtk_doc_requires is not found.])
Packit Service ac8c34
  fi
Packit Service ac8c34
Packit Service ac8c34
  dnl check for tools we added during development
Packit Service ac8c34
  dnl Use AC_CHECK_PROG to avoid the check target using an absolute path that
Packit Service ac8c34
  dnl may not be writable by the user. Currently, automake requires that the
Packit Service ac8c34
  dnl test name must end in '.test'.
Packit Service ac8c34
  dnl https://bugzilla.gnome.org/show_bug.cgi?id=701638
Packit Service ac8c34
  AC_CHECK_PROG([GTKDOC_CHECK],[gtkdoc-check],[gtkdoc-check.test])
Packit Service ac8c34
  AC_PATH_PROG([GTKDOC_CHECK_PATH],[gtkdoc-check])
Packit Service ac8c34
  AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true])
Packit Service ac8c34
  AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf])
Packit Service ac8c34
Packit Service ac8c34
  dnl for overriding the documentation installation directory
Packit Service ac8c34
  AC_ARG_WITH([html-dir],
Packit Service ac8c34
    AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
Packit Service ac8c34
    [with_html_dir='${datadir}/gtk-doc/html'])
Packit Service ac8c34
  HTML_DIR="$with_html_dir"
Packit Service ac8c34
  AC_SUBST([HTML_DIR])
Packit Service ac8c34
Packit Service ac8c34
  dnl enable/disable documentation building
Packit Service ac8c34
  AC_ARG_ENABLE([gtk-doc],
Packit Service ac8c34
    AS_HELP_STRING([--enable-gtk-doc],
Packit Service ac8c34
                   [use gtk-doc to build documentation [[default=no]]]),,
Packit Service ac8c34
    [enable_gtk_doc=no])
Packit Service ac8c34
Packit Service ac8c34
  AC_MSG_CHECKING([whether to build gtk-doc documentation])
Packit Service ac8c34
  AC_MSG_RESULT($enable_gtk_doc)
Packit Service ac8c34
Packit Service ac8c34
  if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then
Packit Service ac8c34
    AC_MSG_ERROR([
Packit Service ac8c34
  You must have $gtk_doc_requires installed to build documentation for
Packit Service ac8c34
  $PACKAGE_NAME. Please install gtk-doc or disable building the
Packit Service ac8c34
  documentation by adding '--disable-gtk-doc' to '[$]0'.])
Packit Service ac8c34
  fi
Packit Service ac8c34
Packit Service ac8c34
  dnl don't check for glib if we build glib
Packit Service ac8c34
  if test "x$PACKAGE_NAME" != "xglib"; then
Packit Service ac8c34
    dnl don't fail if someone does not have glib
Packit Service ac8c34
    PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0,,[:])
Packit Service ac8c34
  fi
Packit Service ac8c34
Packit Service ac8c34
  dnl enable/disable output formats
Packit Service ac8c34
  AC_ARG_ENABLE([gtk-doc-html],
Packit Service ac8c34
    AS_HELP_STRING([--enable-gtk-doc-html],
Packit Service ac8c34
                   [build documentation in html format [[default=yes]]]),,
Packit Service ac8c34
    [enable_gtk_doc_html=yes])
Packit Service ac8c34
    AC_ARG_ENABLE([gtk-doc-pdf],
Packit Service ac8c34
      AS_HELP_STRING([--enable-gtk-doc-pdf],
Packit Service ac8c34
                     [build documentation in pdf format [[default=no]]]),,
Packit Service ac8c34
      [enable_gtk_doc_pdf=no])
Packit Service ac8c34
Packit Service ac8c34
  if test -z "$GTKDOC_MKPDF"; then
Packit Service ac8c34
    enable_gtk_doc_pdf=no
Packit Service ac8c34
  fi
Packit Service ac8c34
Packit Service ac8c34
  if test -z "$AM_DEFAULT_VERBOSITY"; then
Packit Service ac8c34
    AM_DEFAULT_VERBOSITY=1
Packit Service ac8c34
  fi
Packit Service ac8c34
  AC_SUBST([AM_DEFAULT_VERBOSITY])
Packit Service ac8c34
Packit Service ac8c34
  AM_CONDITIONAL([HAVE_GTK_DOC], [test x$have_gtk_doc = xyes])
Packit Service ac8c34
  AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])
Packit Service ac8c34
  AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes])
Packit Service ac8c34
  AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes])
Packit Service ac8c34
  AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"])
Packit Service ac8c34
  AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"])
Packit Service ac8c34
])