acinclude.m4 1.5 KB

1234567891011121314151617181920212223242526272829
  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]])])
  9. if test "x$with_documentation" = "xno"; then
  10. ac_libmodbus_build_doc="no"
  11. else
  12. # Determine whether or not documentation should be built and installed.
  13. ac_libmodbus_build_doc="yes"
  14. # Check for asciidoc and xmlto and don't build the docs if these are not installed.
  15. AC_CHECK_PROG(ac_libmodbus_have_asciidoc, asciidoc, yes, no)
  16. AC_CHECK_PROG(ac_libmodbus_have_xmlto, xmlto, yes, no)
  17. if test "x$ac_libmodbus_have_asciidoc" = "xno" -o "x$ac_libmodbus_have_xmlto" = "xno"; then
  18. ac_libmodbus_build_doc="no"
  19. fi
  20. fi
  21. AC_MSG_CHECKING([whether to build documentation])
  22. AC_MSG_RESULT([$ac_libmodbus_build_doc])
  23. if test "x$ac_libmodbus_build_doc" = "xno"; then
  24. AC_MSG_WARN([The tools to build the documentation aren't installed])
  25. fi
  26. AM_CONDITIONAL(BUILD_DOC, test "x$ac_libmodbus_build_doc" = "xyes")
  27. }])