summaryrefslogtreecommitdiff
path: root/contrib/sboxes
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2021-10-17 10:29:53 +1100
committerG. Branden Robinson <g.branden.robinson@gmail.com>2021-10-17 13:57:41 +1100
commitf1f0470136212658dedc7a3f84b8ffffdecd02a7 (patch)
treed0e65c54c9297b6fe212251c0bcf976a9b64ce57 /contrib/sboxes
parent1eaead451bd1ce9f32dfcb1e354b997d9dbee0e0 (diff)
downloadgroff-git-f1f0470136212658dedc7a3f84b8ffffdecd02a7.tar.gz
[sboxes]: Add more prerequisite checking.
* contrib/sboxes/sboxes.tmac: Add more prerequisite checking. Check `GS` register for groff ms macros specifically. Check installed version of groff since the gropdf in earlier versions won't implement the underlying feature. Add new string to introduce diagnostic messages now that we have more than one (that we can emit without limp-along AT&T compatibility mode). (sboxes*error): Use new string in diagnostic message.
Diffstat (limited to 'contrib/sboxes')
-rw-r--r--contrib/sboxes/ChangeLog10
-rw-r--r--contrib/sboxes/sboxes.tmac14
2 files changed, 23 insertions, 1 deletions
diff --git a/contrib/sboxes/ChangeLog b/contrib/sboxes/ChangeLog
index d2bcd2c24..3ecd28207 100644
--- a/contrib/sboxes/ChangeLog
+++ b/contrib/sboxes/ChangeLog
@@ -1,5 +1,15 @@
2021-10-17 G. Branden Robinson <g.branden.robinson@gmail.com>
+ * sboxes.tmac: Add more prerequisite checking. Check `GS`
+ register for groff ms macros specifically. Check installed
+ version of groff since the gropdf in earlier versions won't
+ implement the underlying feature. Add new string to introduce
+ diagnostic messages now that we have more than one (that we can
+ emit without limp-along AT&T compatibility mode).
+ (sboxes*error): Use new string in diagnostic message.
+
+2021-10-17 G. Branden Robinson <g.branden.robinson@gmail.com>
+
* sboxes.tmac (sboxes*error): Add new macro to produce
diagnostic message in a standard format.
(BoxStart): Use it.
diff --git a/contrib/sboxes/sboxes.tmac b/contrib/sboxes/sboxes.tmac
index 63e4c1e69..3733720b5 100644
--- a/contrib/sboxes/sboxes.tmac
+++ b/contrib/sboxes/sboxes.tmac
@@ -26,13 +26,25 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
.if \n(.C \
. ab groff sboxes macros do not work in compatibility mode; aborting
.
+.\" Define a string for use in diagnostic messages.
+.ds sboxes*name sboxes.tmac\"
+.
+.if !r GS \
+. ab \*[sboxes*name]: ms macros must be loaded first; aborting
+.
+.if (\n[.x]\n[.y] < 123) \{\
+. ds sboxes*msg \*[sboxes*name]: groff 1.23 or later is required,\"
+. as sboxes*msg " but found groff \n[.x].\n[.y]; aborting\"
+. ab \*[sboxes*msg]
+.\}
+.
.\" See if already loaded.
.if r GSBOX .nx
.nr GSBOX 1
.nr bx@stack 0
.
.de sboxes*error
-. tm sboxes.tmac:\\n[.F]:\\n[.c]: error: \\$*
+. tm \*[sboxes*name]:\\n[.F]:\\n[.c]: error: \\$*
..
.
.de pdfbackground