Blame m4/gtk-doc.m4

Packit 3ff832
# -*- mode: autoconf -*-
Packit 3ff832
#
Packit 3ff832
# gtk-doc.m4 - configure macro to check for gtk-doc
Packit 3ff832
# Copyright (C) 2003 James Henstridge
Packit 3ff832
#               2007-2017  Stefan Sauer
Packit 3ff832
#
Packit 3ff832
# This program is free software: you can redistribute it and/or modify
Packit 3ff832
# it under the terms of the GNU General Public License as published by
Packit 3ff832
# the Free Software Foundation, either version 3 of the License, or
Packit 3ff832
# (at your option) any later version.
Packit 3ff832
#
Packit 3ff832
# This program is distributed in the hope that it will be useful,
Packit 3ff832
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 3ff832
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 3ff832
# GNU General Public License for more details.
Packit 3ff832
#
Packit 3ff832
# You should have received a copy of the GNU General Public License
Packit 3ff832
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit 3ff832
#
Packit 3ff832
# As a special exception, the above copyright owner gives unlimited
Packit 3ff832
# permission to copy, distribute and modify the configure scripts that
Packit 3ff832
# are the output of Autoconf when processing the Macro. You need not
Packit 3ff832
# follow the terms of the GNU General Public License when using or
Packit 3ff832
# distributing such scripts, even though portions of the text of the
Packit 3ff832
# Macro appear in them. The GNU General Public License (GPL) does govern
Packit 3ff832
# all other use of the material that constitutes the Autoconf Macro.
Packit 3ff832
Packit 3ff832
# serial 2
Packit 3ff832
Packit 3ff832
dnl Usage:
Packit 3ff832
dnl   GTK_DOC_CHECK([minimum-gtk-doc-version])
Packit 3ff832
AC_DEFUN([GTK_DOC_CHECK],
Packit 3ff832
[
Packit 3ff832
  AC_REQUIRE([PKG_PROG_PKG_CONFIG])
Packit 3ff832
  AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
Packit 3ff832
  AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
Packit 3ff832
Packit 3ff832
  ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"])
Packit 3ff832
  AC_MSG_CHECKING([for gtk-doc])
Packit 3ff832
  PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no])
Packit 3ff832
  AC_MSG_RESULT($have_gtk_doc)
Packit 3ff832
Packit 3ff832
  if test "$have_gtk_doc" = "no"; then
Packit 3ff832
      AC_MSG_WARN([
Packit 3ff832
  You will not be able to create source packages with 'make dist'
Packit 3ff832
  because $gtk_doc_requires is not found.])
Packit 3ff832
  fi
Packit 3ff832
Packit 3ff832
  dnl check for tools we added during development
Packit 3ff832
  dnl Use AC_CHECK_PROG to avoid the check target using an absolute path that
Packit 3ff832
  dnl may not be writable by the user. Currently, automake requires that the
Packit 3ff832
  dnl test name must end in '.test'.
Packit 3ff832
  dnl https://bugzilla.gnome.org/show_bug.cgi?id=701638
Packit 3ff832
  AC_CHECK_PROG([GTKDOC_CHECK],[gtkdoc-check],[gtkdoc-check.test])
Packit 3ff832
  AC_PATH_PROG([GTKDOC_CHECK_PATH],[gtkdoc-check])
Packit 3ff832
  AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true])
Packit 3ff832
  AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf])
Packit 3ff832
Packit 3ff832
  dnl for overriding the documentation installation directory
Packit 3ff832
  AC_ARG_WITH([html-dir],
Packit 3ff832
    AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
Packit 3ff832
    [with_html_dir='${datadir}/gtk-doc/html'])
Packit 3ff832
  HTML_DIR="$with_html_dir"
Packit 3ff832
  AC_SUBST([HTML_DIR])
Packit 3ff832
Packit 3ff832
  dnl enable/disable documentation building
Packit 3ff832
  AC_ARG_ENABLE([gtk-doc],
Packit 3ff832
    AS_HELP_STRING([--enable-gtk-doc],
Packit 3ff832
                   [use gtk-doc to build documentation [[default=no]]]),,
Packit 3ff832
    [enable_gtk_doc=no])
Packit 3ff832
Packit 3ff832
  AC_MSG_CHECKING([whether to build gtk-doc documentation])
Packit 3ff832
  AC_MSG_RESULT($enable_gtk_doc)
Packit 3ff832
Packit 3ff832
  if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then
Packit 3ff832
    AC_MSG_ERROR([
Packit 3ff832
  You must have $gtk_doc_requires installed to build documentation for
Packit 3ff832
  $PACKAGE_NAME. Please install gtk-doc or disable building the
Packit 3ff832
  documentation by adding '--disable-gtk-doc' to '[$]0'.])
Packit 3ff832
  fi
Packit 3ff832
Packit 3ff832
  dnl don't check for glib if we build glib
Packit 3ff832
  if test "x$PACKAGE_NAME" != "xglib"; then
Packit 3ff832
    dnl don't fail if someone does not have glib
Packit 3ff832
    PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0,,[:])
Packit 3ff832
  fi
Packit 3ff832
Packit 3ff832
  dnl enable/disable output formats
Packit 3ff832
  AC_ARG_ENABLE([gtk-doc-html],
Packit 3ff832
    AS_HELP_STRING([--enable-gtk-doc-html],
Packit 3ff832
                   [build documentation in html format [[default=yes]]]),,
Packit 3ff832
    [enable_gtk_doc_html=yes])
Packit 3ff832
    AC_ARG_ENABLE([gtk-doc-pdf],
Packit 3ff832
      AS_HELP_STRING([--enable-gtk-doc-pdf],
Packit 3ff832
                     [build documentation in pdf format [[default=no]]]),,
Packit 3ff832
      [enable_gtk_doc_pdf=no])
Packit 3ff832
Packit 3ff832
  if test -z "$GTKDOC_MKPDF"; then
Packit 3ff832
    enable_gtk_doc_pdf=no
Packit 3ff832
  fi
Packit 3ff832
Packit 3ff832
  if test -z "$AM_DEFAULT_VERBOSITY"; then
Packit 3ff832
    AM_DEFAULT_VERBOSITY=1
Packit 3ff832
  fi
Packit 3ff832
  AC_SUBST([AM_DEFAULT_VERBOSITY])
Packit 3ff832
Packit 3ff832
  AM_CONDITIONAL([HAVE_GTK_DOC], [test x$have_gtk_doc = xyes])
Packit 3ff832
  AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])
Packit 3ff832
  AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes])
Packit 3ff832
  AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes])
Packit 3ff832
  AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"])
Packit 3ff832
  AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"])
Packit 3ff832
])