make compile
[heimdal.git] / cf / check-man.m4
blobc0c05d73771c5219154f259e24ca620cf33c9525
1 dnl $Id$
2 dnl check how to format manual pages
3 dnl
5 AC_DEFUN([rk_CHECK_MAN],
6 [AC_PATH_PROG(NROFF, nroff)
7 AC_PATH_PROG(GROFF, groff)
8 AC_CACHE_CHECK(how to format man pages,ac_cv_sys_man_format,
9 [cat > conftest.1 << END
10 .Dd January 1, 1970
11 .Dt CONFTEST 1
12 .Sh NAME
13 .Nm conftest
14 .Nd
15 foobar
16 END
18 if test "$NROFF" ; then
19         for i in "-mdoc" "-mandoc"; do
20                 if "$NROFF" $i conftest.1 2> /dev/null | \
21                         grep Jan > /dev/null 2>&1 ; then
22                         ac_cv_sys_man_format="$NROFF $i"
23                         break
24                 fi
25         done
27 if test "$ac_cv_sys_man_format" = "" -a "$GROFF" ; then
28         for i in "-mdoc" "-mandoc"; do
29                 if "$GROFF" -Tascii $i conftest.1 2> /dev/null | \
30                         grep Jan > /dev/null 2>&1 ; then
31                         ac_cv_sys_man_format="$GROFF -Tascii $i"
32                         break
33                 fi
34         done
36 if test "$ac_cv_sys_man_format"; then
37         ac_cv_sys_man_format="$ac_cv_sys_man_format \[$]< > \[$]@"
40 if test "$ac_cv_sys_man_format"; then
41         CATMAN="$ac_cv_sys_man_format"
42         AC_SUBST(CATMAN)
44 AM_CONDITIONAL(CATMAN, test "$CATMAN")
45 AC_CACHE_CHECK(extension of pre-formatted manual pages,ac_cv_sys_catman_ext,
46 [if grep _suffix /etc/man.conf > /dev/null 2>&1; then
47         ac_cv_sys_catman_ext=0
48 else
49         ac_cv_sys_catman_ext=number
52 if test "$ac_cv_sys_catman_ext" = number; then
53         CATMANEXT='$$section'
54 else
55         CATMANEXT=0
57 AC_SUBST(CATMANEXT)