1 # This file is part of Autoconf. -*- Autoconf -*-
4 AC_DEFUN([DOC_SUPPORT_INIT], [
6 PD_DOC_SUPPORT_DEFVAL=true
7 PD_DOCTOOL_PATH=/usr/share/policy-doc-tools
9 AC_PATH_TOOL([PD_LYX], lyx)
11 AS_IF([test x$PD_LYX = x],
12 [PD_DOC_SUPPORT_DEFVAL=false
13 AC_MSG_WARN([Can't find lyx. doc-support is going to be disabled])]
16 AC_PATH_TOOL([PD_FIG2DEV], fig2dev)
18 AS_IF([test x$PD_FIG2DEV = x],
19 [PD_DOC_SUPPORT_DEFVAL=false
20 AC_MSG_WARN([Can't find fig2dev. doc-support is going to be disabled])]
23 AC_PATH_TOOL([PD_DOXYGEN], doxygen)
25 AS_IF([test x$PD_DOXYGEN = x],
26 [PD_DOC_SUPPORT_DEFVAL=false
27 AC_MSG_WARN([Can't find doxygen. doc-support is going to be disabled])]
30 AC_PATH_TOOL([PD_XSLTPROC], xsltproc)
32 AS_IF([test x$PD_XSLTPROC = x],
33 [PD_DOC_SUPPORT_DEFVAL=false
34 AC_MSG_WARN([Can't find xsltproc. doc-support is going to be disabled])]
37 AC_SUBST([PD_DOXML2DB_STY], [${PD_DOCTOOL_PATH}/xslt/doxml2db.sty])
39 AC_CHECK_FILE([$PD_DOXML2DB_STY], [PD_DOXML2DB_STY_OK=true])
41 AS_IF([test x$PD_DOXML2DB_STY_OK != xtrue],
42 [PD_DOC_SUPPORT_DEFVAL=false
43 AC_MSG_WARN([Can't find doxml2db.sty; doc-support is going to be disabled])]
48 [AS_HELP_STRING(--disable-doc-support, [turns off policy-doc support])],
50 case "$enableval" in #(
51 y|Y|yes|Yes|YES) doc_support=false ;; #(
52 n|N|no|No|NO) doc_support=true ;; #(
53 *) AC_MSG_ERROR([bad value '${enableval}' for --disable-doc-support]) ;;
56 [doc_support=$PD_DOC_SUPPORT_DEFVAL])
58 AM_CONDITIONAL([PD_SUPPORT], [test x${doc_support} = xtrue])