Blame m4/gtk-doc.m4

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