[PATCH] configure.ac: Add mandoc as valid formatter

Darren Tucker dtucker at dtucker.net
Fri May 10 15:03:58 AEST 2019


On Sat, May 04, 2019 at 07:31:23PM +0200, Wolfgang Müller wrote:
> On systems that have mandoc installed but are missing an nroff binary,
> the configure script will fall back to pre-formatted manual pages
> despite the fact that mandoc could be used.
> 
> The proposed patch adds mandoc as a valid formatter to configure.ac. As
> mandoc supports the -mdoc flag, it can simply be added to the list of
> nroff-like binaries.

Having read this and Ingo's feedback in addition to performing some git
archaelogy (and subsequently learning what "awf" is) I have come up with
the following which I think should resolve this by removing one of the
AC_PATH_PROG checks.

Thanks.

$ ./configure | egrep -i 'roff|mandoc|manpage format'
checking for groff... no
checking for nroff... no
checking for mandoc... /usr/bin/mandoc
                    Manpage format: doc

diff --git a/configure.ac b/configure.ac
index 9022ee9c..17a11dee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,11 +41,11 @@ AC_PATH_PROG([TEST_MINUS_S_SH], [ksh])
 AC_PATH_PROG([TEST_MINUS_S_SH], [sh])
 AC_PATH_PROG([SH], [sh])
 AC_PATH_PROG([GROFF], [groff])
-AC_PATH_PROG([NROFF], [nroff])
+AC_PATH_PROG([NROFF], [nroff awf])
 AC_PATH_PROG([MANDOC], [mandoc])
 AC_SUBST([TEST_SHELL], [sh])
 
-dnl select manpage formatter
+dnl select manpage formatter to be used to build "cat" format pages.
 if test "x$MANDOC" != "x" ; then
 	MANFMT="$MANDOC"
 elif test "x$NROFF" != "x" ; then
@@ -4626,9 +4626,9 @@ AC_ARG_WITH([mantype],
 	]
 )
 if test -z "$MANTYPE"; then
-	TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
-	AC_PATH_PROGS([NROFF], [nroff awf], [/bin/false], [$TestPath])
-	if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
+	if ${MANDOC} ${srcdir}/ssh.1 >/dev/null 2>&1; then
+		MANTYPE=doc
+	elif ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
 		MANTYPE=doc
 	elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
 		MANTYPE=man

-- 
Darren Tucker (dtucker at dtucker.net)
GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860  37F4 9357 ECEF 11EA A6FA (new)
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.


More information about the openssh-unix-dev mailing list