Fix VD-1301 and VD-1302 vulnerabilities
[libmodbus.git] / acinclude.m4
blob47c7971358b059fad36fc623496868689a131e57
1 dnl ##############################################################################
2 dnl # AC_LIBMODBUS_CHECK_BUILD_DOC                                               #
3 dnl # Check whether to build documentation and install man-pages                 #
4 dnl ##############################################################################
5 AC_DEFUN([AC_LIBMODBUS_CHECK_BUILD_DOC], [{
6     # Allow user to disable doc build
7     AC_ARG_WITH([documentation], [AS_HELP_STRING([--without-documentation],
8         [disable documentation build even if asciidoc and xmlto are present [default=no]])])
10     if test "x$with_documentation" = "xno"; then
11         ac_libmodbus_build_doc="no"
12     else
13         # Determine whether or not documentation should be built and installed.
14         ac_libmodbus_build_doc="yes"
15         # Check for asciidoc and xmlto and don't build the docs if these are not installed.
16         AC_CHECK_PROG(ac_libmodbus_have_asciidoc, asciidoc, yes, no)
17         AC_CHECK_PROG(ac_libmodbus_have_xmlto, xmlto, yes, no)
18         if test "x$ac_libmodbus_have_asciidoc" = "xno" -o "x$ac_libmodbus_have_xmlto" = "xno"; then
19            ac_libmodbus_build_doc="no"
20         fi
21     fi
23     AC_MSG_CHECKING([whether to build documentation])
24     AC_MSG_RESULT([$ac_libmodbus_build_doc])
25     if test "x$ac_libmodbus_build_doc" = "xno"; then
26         AC_MSG_WARN([The tools to build the documentation aren't installed])
27     fi
28     AM_CONDITIONAL(BUILD_DOC, test "x$ac_libmodbus_build_doc" = "xyes")
29 }])