You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

68 lines
2.4 KiB

  1. dnl -*- mode: autoconf -*-
  2. # serial 1
  3. dnl Usage:
  4. dnl GTK_DOC_CHECK([minimum-gtk-doc-version])
  5. AC_DEFUN([GTK_DOC_CHECK],
  6. [
  7. AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  8. AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
  9. AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
  10. dnl check for tools we added during development
  11. AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check])
  12. AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true])
  13. AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf])
  14. dnl for overriding the documentation installation directory
  15. AC_ARG_WITH([html-dir],
  16. AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
  17. [with_html_dir='${datadir}/gtk-doc/html'])
  18. HTML_DIR="$with_html_dir"
  19. AC_SUBST([HTML_DIR])
  20. dnl enable/disable documentation building
  21. AC_ARG_ENABLE([gtk-doc],
  22. AS_HELP_STRING([--enable-gtk-doc],
  23. [use gtk-doc to build documentation [[default=no]]]),,
  24. [enable_gtk_doc=no])
  25. if test x$enable_gtk_doc = xyes; then
  26. ifelse([$1],[],
  27. [PKG_CHECK_EXISTS([gtk-doc],,
  28. AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))],
  29. [PKG_CHECK_EXISTS([gtk-doc >= $1],,
  30. AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))])
  31. dnl don't check for glib if we build glib
  32. if test "x$PACKAGE_NAME" != "xglib"; then
  33. dnl don't fail if someone does not have glib
  34. PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,)
  35. fi
  36. fi
  37. AC_MSG_CHECKING([whether to build gtk-doc documentation])
  38. AC_MSG_RESULT($enable_gtk_doc)
  39. dnl enable/disable output formats
  40. AC_ARG_ENABLE([gtk-doc-html],
  41. AS_HELP_STRING([--enable-gtk-doc-html],
  42. [build documentation in html format [[default=yes]]]),,
  43. [enable_gtk_doc_html=yes])
  44. AC_ARG_ENABLE([gtk-doc-pdf],
  45. AS_HELP_STRING([--enable-gtk-doc-pdf],
  46. [build documentation in pdf format [[default=no]]]),,
  47. [enable_gtk_doc_pdf=no])
  48. if test -z "$GTKDOC_MKPDF"; then
  49. enable_gtk_doc_pdf=no
  50. fi
  51. AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])
  52. AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes])
  53. AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes])
  54. AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"])
  55. AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"])
  56. ])