No empty .Rs/.Re
[netbsd-mini2440.git] / crypto / dist / heimdal / cf / check-man.m4
blob762e5a2dbe19cd0ade64d076f4a902c4e9eb2005
1 dnl $Heimdal: check-man.m4 13338 2004-02-12 14:21:14Z lha $
2 dnl $NetBSD$
3 dnl check how to format manual pages
4 dnl
6 AC_DEFUN([rk_CHECK_MAN],
7 [AC_PATH_PROG(NROFF, nroff)
8 AC_PATH_PROG(GROFF, groff)
9 AC_CACHE_CHECK(how to format man pages,ac_cv_sys_man_format,
10 [cat > conftest.1 << END
11 .Dd January 1, 1970
12 .Dt CONFTEST 1
13 .Sh NAME
14 .Nm conftest
15 .Nd
16 foobar
17 END
19 if test "$NROFF" ; then
20         for i in "-mdoc" "-mandoc"; do
21                 if "$NROFF" $i conftest.1 2> /dev/null | \
22                         grep Jan > /dev/null 2>&1 ; then
23                         ac_cv_sys_man_format="$NROFF $i"
24                         break
25                 fi
26         done
28 if test "$ac_cv_sys_man_format" = "" -a "$GROFF" ; then
29         for i in "-mdoc" "-mandoc"; do
30                 if "$GROFF" -Tascii $i conftest.1 2> /dev/null | \
31                         grep Jan > /dev/null 2>&1 ; then
32                         ac_cv_sys_man_format="$GROFF -Tascii $i"
33                         break
34                 fi
35         done
37 if test "$ac_cv_sys_man_format"; then
38         ac_cv_sys_man_format="$ac_cv_sys_man_format \[$]< > \[$]@"
41 if test "$ac_cv_sys_man_format"; then
42         CATMAN="$ac_cv_sys_man_format"
43         AC_SUBST(CATMAN)
45 AM_CONDITIONAL(CATMAN, test "$CATMAN")
46 AC_CACHE_CHECK(extension of pre-formatted manual pages,ac_cv_sys_catman_ext,
47 [if grep _suffix /etc/man.conf > /dev/null 2>&1; then
48         ac_cv_sys_catman_ext=0
49 else
50         ac_cv_sys_catman_ext=number
53 if test "$ac_cv_sys_catman_ext" = number; then
54         CATMANEXT='$$section'
55 else
56         CATMANEXT=0
58 AC_SUBST(CATMANEXT)