2 dnl check where to install documentation
4 dnl determines documentation "root directory", i.e. the directory
5 dnl where all documentation will be placed in
8 AC_DEFUN([GP_CHECK_DOC_DIR],
10 AC_BEFORE([$0], [GP_BUILD_GTK_DOCS])dnl
11 AC_BEFORE([$0], [GP_CHECK_DOXYGEN])dnl
13 AC_ARG_WITH([doc-dir],
14 [AS_HELP_STRING([--with-doc-dir=PATH],
15 [Where to install docs [default=autodetect]])])
17 # check for the main ("root") documentation directory
18 AC_MSG_CHECKING([main docdir])
20 if test "x${with_doc_dir}" != "x"
21 then # docdir is given as parameter
22 docdir="${with_doc_dir}"
23 AC_MSG_RESULT([${docdir} (from parameter)])
24 else # otherwise invent a docdir hopefully compatible with system policy
25 if test -d "/usr/share/doc"
27 maindocdir='${prefix}/share/doc'
28 AC_MSG_RESULT([${maindocdir} (FHS style)])
29 elif test -d "/usr/doc"
31 maindocdir='${prefix}/doc'
32 AC_MSG_RESULT([${maindocdir} (old style)])
34 maindocdir='${datadir}/doc'
35 AC_MSG_RESULT([${maindocdir} (default value)])
37 AC_MSG_CHECKING([package docdir])
38 # check whether to include package version into documentation path
39 # FIXME: doesn't work properly.
40 if ls -d /usr/{share/,}doc/make-[0-9]* > /dev/null 2>&1
42 docdir="${maindocdir}/${PACKAGE}-${VERSION}"
43 AC_MSG_RESULT([${docdir} (redhat style)])
45 docdir="${maindocdir}/${PACKAGE}"
46 AC_MSG_RESULT([${docdir} (default style)])
54 dnl check whether to build docs and where to:
56 dnl * determine presence of prerequisites (only gtk-doc for now)
57 dnl * determine destination directory for HTML files
60 AC_DEFUN([GP_BUILD_GTK_DOCS],
62 # docdir has to be determined in advance
63 AC_REQUIRE([GP_CHECK_DOC_DIR])
65 # ---------------------------------------------------------------------------
66 # gtk-doc: We use gtk-doc for building our documentation. However, we
67 # require the user to explicitely request the build.
68 # ---------------------------------------------------------------------------
70 gtkdoc_msg="no (not requested)"
73 [AS_HELP_STRING([--enable-docs],
74 [Use gtk-doc to build documentation [default=no]])],[
75 if test x$enableval = xyes; then
80 AC_PATH_PROG([GTKDOC],[gtkdoc-mkdb])
81 if test -n "${GTKDOC}"; then
85 gtkdoc_msg="no (http://www.gtk.org/rdp/download.html)"
88 AM_CONDITIONAL([ENABLE_GTK_DOC], [$have_gtkdoc])
89 GP_CONFIG_MSG([build API docs with gtk-doc],[$gtkdoc_msg])
92 # ---------------------------------------------------------------------------
93 # Give the user the possibility to install html documentation in a
94 # user-defined location.
95 # ---------------------------------------------------------------------------
96 AC_ARG_WITH([html-dir],
97 [AS_HELP_STRING([--with-html-dir=PATH],
98 [Where to install html docs [default=autodetect]])])
100 AC_MSG_CHECKING([for html dir])
101 if test "x${with_html_dir}" = "x" ; then
102 htmldir="${docdir}/html"
103 AC_MSG_RESULT([${htmldir} (default)])
105 htmldir="${with_html_dir}"
106 AC_MSG_RESULT([${htmldir} (from parameter)])
109 apidocdir="${htmldir}/api"
110 AC_SUBST([apidocdir])