check_mdoc_or_man.m4 728 B

12345678910111213141516171819
  1. # CHECK_MDOC_OR_MAN
  2. # -----------------
  3. # If 'nroff -mdoc' or 'mandoc -mdoc' returns with an exit status of 0, we will
  4. # install man pages which use mdoc macros; otherwise, we will install man pages
  5. # which have had mdoc macros stripped out. On systems which support them, the
  6. # mdoc versions are preferable; but we err on the side of caution -- there may
  7. # be systems where man(1) does not use nroff(1) but still have mdoc macros
  8. # available, yet we will use the mdoc-less man pages on them.
  9. AC_DEFUN([CHECK_MDOC_OR_MAN],
  10. [if nroff -mdoc </dev/null >/dev/null 2>/dev/null; then
  11. MANVER=mdoc;
  12. elif mandoc -mdoc </dev/null >/dev/null 2>/dev/null; then
  13. MANVER=mdoc;
  14. else
  15. MANVER=man;
  16. fi
  17. AC_SUBST([MANVER])
  18. ])# CHECK_MDOC_OR_MAN