From d116052796d3810f8815650e9898e10d945de606 Mon Sep 17 00:00:00 2001 From: "G. Branden Robinson" Date: Tue, 10 Sep 2024 06:04:14 -0500 Subject: [PATCH] Build *roff documents with groff warnings enabled. ...some of them, at any rate. We shut off (1) warnings provoked by Matt Bishop's "mn" macro package, and (2) warnings spuriously emitted by groff 1.23 and previous when "-wall" (or "-ww") is specified. Also update explanatory comments. --- sys/unix/Makefile.doc | 2 ++ sys/unix/hints/include/misc.370 | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/unix/Makefile.doc b/sys/unix/Makefile.doc index cef4f936e..92473995b 100644 --- a/sys/unix/Makefile.doc +++ b/sys/unix/Makefile.doc @@ -19,6 +19,8 @@ GUIDEBOOK = Guidebook # regular ASCII file # Some versions of col need -x to keep them from converting spaces to tabs; # some versions of col don't do the conversion by default and don't # recognize the option. Sigh. +# +# col is unnecessary, but harmless, with groff. See grotty(1). COLCMD = col -bx #COLCMD = col -b diff --git a/sys/unix/hints/include/misc.370 b/sys/unix/hints/include/misc.370 index 7f8c40439..6608cf45a 100644 --- a/sys/unix/hints/include/misc.370 +++ b/sys/unix/hints/include/misc.370 @@ -76,6 +76,13 @@ NROFFISGROFF := $(shell echo `nroff --version | grep "GNU groff version"`) ifneq "$(NROFFISGROFF)" "" # get the version of groff and flag if it is gt or eq to 1.23 GROFFGE123 := $(shell expr `echo $(NROFFISGROFF) | cut -f2 -d.` \>= 23) +# or less than 1.24 +GROFFLT124 := $(shell expr `echo $(NROFFISGROFF) | cut -f2 -d.` \< 24) +# -Wtab -Wrange are for the sake of tmac.n. +NROFF_FLAGS := -wall -Wtab -Wrange +ifneq "$(GROFFLT124)" "" +NROFF_FLAGS += -Wel -Wscale +endif endif # NROFFISGROFF ifneq "$(NROFFISGROFF)" "" # It's groff @@ -83,7 +90,8 @@ ifneq "$(NROFFISGROFF)" "" # It's groff MAN2TXTPRE += -Tascii ifneq "$(GROFFGE123)" "" # It's groff 1.23 or greater #$(info GROFFGE123=$(GROFFGE123)) -# add the groff 1.23 specific plain text flag -P +# nroff in groff 1.23 supports the -P option to pass arguments to the +# output driver. -cbou are flags to grotty(1). MAN2TXTPRE += -P -cbou MAN2TXTPOST= else