The existing detection logic was not working on any groff since at least 1.22.3 (November 2014), as could be seen by uncommenting the "$(info ...)" line. The regex used to match "nroff --version" output was insufficiently flexible. Fixes: $ (cd doc && rm -f Guidebook && PATH=$HOME/groff-1.22.3/usr/bin:/bin make Guidebook) | grep NROFF NROFFISGROFF= $ (cd doc && rm -f Guidebook && PATH=$HOME/groff-1.22.4/usr/bin:/bin make Guidebook) | grep NROFF NROFFISGROFF= $ (cd doc && rm -f Guidebook && PATH=$HOME/groff-1.23.0/usr/bin:/bin make Guidebook) | grep NROFF NROFFISGROFF= $ (cd doc && rm -f Guidebook && PATH=$HOME/groff-HEAD/usr/bin:/bin make Guidebook) | grep NROFF NROFFISGROFF= Use a different approach in Make to recording groff detection. Use "grep -c" (which is POSIX-conforming) to count the number of matches so that we can use the contents of the Make macro `NROFFISGROFF` as a sort of Boolean, which reads more idiomatically (in my opinion). Further, instead of trying to lexically analyze a matched line in the output of "nroff --version" and parse components of a version number out of it, use GNU troff's built-in facility for extracting its minor version number by storing the output of a tiny *roff document that reports that datum (and nothing else). Ignore warnings in category "scale" in any version of groff, because the `tmac.n` macro package provokes them. Clarify comments.
2.9 KiB
2.9 KiB