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