4bc0aeb98a3ce6ed20597dfea14741a874553aa6
[platform/upstream/groff.git] / PROBLEMS
1     Copyright 1989-2014 Free Software Foundation, Inc.
2
3     Copying and distribution of this file, with or without modification,
4     are permitted in any medium without royalty provided the copyright
5     notice and this notice are preserved.
6
7 This file describes various problems that have been encountered in
8 compiling, installing and running groff.  Suggestions for additions or
9 other improvements to this file are welcome.
10
11 ----------------------------------------------------------------------
12
13
14
15 Generic Problems
16 ================
17
18
19
20 * Displaying a man page on a terminal with/without my favourite pager
21   only gives garbage.
22
23 groff by default now uses SGR escape sequences (`ANSI color') to
24 control the display attributes (bold, underlined, colour) on TTYs.
25 Some terminals (e.g. `kterm') don't understand SGR, and some pagers
26 (e.g. older versions of `less' or `less' without the -R option) don't
27 understand SGR either.  There are three solutions to fix this, in
28 order of preference; please read the grotty man page for more details.
29
30 The fourth and probably best option is to update your terminal program
31 and pager to versions which can handle SGR.
32
33   1. Set the GROFF_NO_SGR environment variable.
34
35   2. Pass option `-c' to grotty (this is, add `-P-c' to groff's
36      command line options).
37
38   3. Append the following fragment to the `troffrc' file:
39
40
41 --- start ---
42 .if n \{\
43 .  nr _C \n(.C
44 .  cp 0
45 .
46 .  \" The following code sets a top-of-page trap to disable grotty's TTY
47 .  \" mode.  Since neither \X nor .output can be used before the first
48 .  \" page has started, we must use a trap.  To make it work with troff's
49 .  \" -o option, we wait until the first printed page.
50 .
51 .  de sgr@dummy
52 .  .
53 .
54 .  rn wh wh@old
55 .
56 .  \" The stand-alone version.  If no other trap is set, we can safely
57 .  \" insert the truncated vertical space caused by the trap (if any).
58 .  \" Otherwise we assume that the document's main macro package takes
59 .  \" care of that.  As soon as the trap has been executed, it is removed.
60 .  de1 no@sgr
61 .    if \\n[.P] \{\
62 .      if (\\n[.t] == \\n[.p]) \{\
63 .        rn wh@old wh
64 .        rm no@sgr
65 .        wh 0
66 .        sp \\n[.trunc]
67 .        nop \X'tty: sgr 0'
68 .        sp -1
69 .    \}\}
70 .  .
71 .
72 .  wh@old 0 no@sgr
73 .
74 .  \" The piggyback version to be appended to macros planted with the
75 .  \" modified `wh' request.
76 .  de1 no@sgr1
77 .    if \\n[.P] \{\
78 .      rn wh@old wh
79 .      ds no@sgr1
80 .      nop \X'tty: sgr 0'
81 .      sp -1
82 .    \}
83 .  .
84 .
85 .  \" We redefine the `wh' request so that `no@sgr1' is appended to
86 .  \" the trap macro.
87 .  de1 wh
88 .    am1 \\$2 sgr@dummy
89 .      no@sgr1
90 .    sgr@dummy
91 .    wh@old \\$1 \\$2
92 .  .
93 .
94 .  cp \n[_C]
95 .\}
96 --- end ---
97
98 ----------------------------------------------------------------------
99
100 * The UTF-8 output of grotty has strange characters for the minus, the
101   hyphen, and the right quote.  Why?
102
103 The used Unicode characters (U+2212 for the minus sign and U+2010 for
104 the hyphen) are the correct ones, but many programs can't search them
105 properly.  The same is true for the right quote (U+201D).  To map
106 those characters back to the ASCII characters, insert the following
107 code snippet into the `troffrc' configuration file:
108
109 .if '\*[.T]'utf8' \{\
110 .  char \- \N'45'
111 .  char  - \N'45'
112 .  char  ' \N'39'
113 .\}
114
115 ----------------------------------------------------------------------
116
117 * Processing mdoc man pages like `groff_mdoc.n' fails if I use
118   `test-groff'.  Why?
119
120 The mdoc package works only after installation, not with test-groff.
121 Reason is that the macro files of mdoc get stripped off the `doc-'
122 prefix before they are copied to the final destination.
123
124 ----------------------------------------------------------------------
125
126 * My document says that the current year is 19100, not 2000.
127
128 In groff, as in traditional troff, the yr number register yields the
129 year minus 1900.  Unfortunately, there is a longstanding bug in the
130 Troff User's Manual <http://cm.bell-labs.com/cm/cs/cstr/54.ps.gz>,
131 which incorrectly claims that yr is the last two digits of the year.
132 This claim was never true of either Unix troff or of groff.
133
134 If your text looks like this:
135
136         .\" Wrong:
137         This document was formatted in 19\n(yr.
138
139 you can correct it as follows:
140
141         This document was formatted in \n[year].
142
143 or, if you want to be portable to older troff versions, as follows:
144
145         .nr y4 1900+\n(yr
146         This document was formatted in \n(y4.
147
148 ----------------------------------------------------------------------
149
150 * groff can't handle my troff document.  It works fine with AT&T
151   troff.
152
153 Read the section on incompatibilities in groff_diff(7).  Try using the
154 -C option.  Alternatively there's the sed script `tmac/fixmacros.sed'
155 which attempts to edit a file of macros so that it can be used with
156 groff without the -C flag.
157
158 ----------------------------------------------------------------------
159
160 * gtroff doesn't understand lines like `.ce99' with no space between
161   the name of the request or macro and the arguments.
162
163 gtroff requires a space between macro or request and its arguments
164 because it allows the use of long names for macros and requests.  You
165 can use the -C option or the `cp' request to put gtroff into a
166 compatibility mode in which it is not possible to use long names for
167 macros but in which no space is required between macros and their
168 arguments.  The use of compatibility mode is strongly discouraged.
169
170 ----------------------------------------------------------------------
171
172 * groff -Tdvi produces dvi files that use fonts at weird
173   magnifications.
174
175 Yes, it does.  You may need to compile fonts with Metafont at these
176 magnifications.  The CompileFonts script in the devdvi/generate
177 directory may help you to do this.  (It takes a *long* time on slow
178 computers.)
179
180 ----------------------------------------------------------------------
181
182 * Groff doesn't use the font names I'm used to.
183
184 Use the `ftr' request.  See groff_diff(7).
185
186 ----------------------------------------------------------------------
187
188 * gpic output is not centered horizontally; pictures sometimes run off
189   the bottom of the page.
190
191 The macro package you are using is not supplying appropriate
192 definitions of PS and PE.  Give groff a -mpic option.
193
194 ----------------------------------------------------------------------
195
196 * gpic doesn't accept the syntax `chop N M' for chopping both ends of
197   a line.
198
199 The correct syntax is `chop N chop M'.
200
201 ----------------------------------------------------------------------
202
203 * With gpic -t, when I print `line ->; box' using a dvi to ps program,
204   the arrow head sticks through into the inside of the box.
205
206 The dvi to ps program should be modified to set the line cap and line
207 join parameters to 1 while printing tpic specials.
208
209 ----------------------------------------------------------------------
210
211 * gtroff gives warnings about lines like
212   .ev   \" a comment
213   (with a tab after the .ev).
214
215 A tab character cannot be used as a substitute for a space character
216 (except in one case: between a control character at the beginning of a
217 line and the name of a macro or request).  For example, in Unix troff
218
219   .ps   \" restore the previous point size
220
221 (with a tab after the .ps) does NOT restore the previous point-size;
222 instead it is silently ignored.  Since this is very likely to be an
223 error, gtroff can give a warning about it.  If you want to align
224 comments, you can do it like this:
225
226   .ev\"                         \" a comment
227
228 ----------------------------------------------------------------------
229
230 * I don't like the page headers and footers produced by groff -man.
231
232 There seem to be many different styles of page header and footer
233 produced by different versions of the -man macros.  You need to put
234 modified macros from tmac/an-old.tmac into man.local.  More
235 information is available in groff_man(7).
236
237 ----------------------------------------------------------------------
238
239 * Where can I get grap?
240
241 Ted Faber <faber@lunabase.org> has written a freely available grap:
242
243   http://www.lunabase.org/~faber/Vault/software/grap/
244
245 You need version 1.42 or newer.
246
247 ----------------------------------------------------------------------
248
249 * The \n(st and \n(sb registers don't seem to work.  I thought \w set
250   them to the height and depth of its argument, but the registers
251   always seem to be 0.
252
253 \n(st and \n(sb aren't supposed to give the height and depth of the
254 string rather they give the minimum and maximum vertical displacement
255 of the baseline.  For example for \v'2u'\v'-3u', \n(st is 1 and \n(sb
256 is -2.  The height and depth of the string is available in the \n[rst]
257 and \n[rsb] registers: these are groff extensions.
258
259 ----------------------------------------------------------------------
260
261 * While formatting a manual page, groff complains about not being able
262   to break lines.  The problem seems to be caused by a line like:
263   .TP \w'label'+2
264
265 The -man documentation says that the default scale indicator for TP
266 macro is `n'.  The groff -man macros implement this correctly, so that
267 the argument is evaluated as if it were
268
269   \w'label'n+2n
270
271 The Unix -man macros don't implement this correctly (probably because
272 it's hard to do in Unix troff); they just append `n' to the entire
273 argument, so that it is evaluated as if it were
274
275   \w'label'u+2n
276
277 The solution is to fix the manual page:
278
279   .TP \w'label'u+2
280
281 ----------------------------------------------------------------------
282
283 * I'm having problems formatting man pages produced by the perl
284   wrapman script.
285
286 Some versions of wrapman have a superfluous blank line before the .TH
287 line.  This must be deleted.  Then either use groff -C, or apply the
288 following patch:
289
290 *** wrapman.~2~ Sun Jan 19 12:10:24 1992
291 --- wrapman     Tue Aug 10 02:06:41 1993
292 ***************
293 *** 35,41 ****
294       $line1 .= <IN> if $line1 =~ /eval/;
295       $line1 .= <IN> if $line1 =~ /argv/;
296       $line2 = <IN>;
297 !     next if $line2 eq "'di';\n";
298
299       # Pull the old switcheroo.
300
301 --- 35,41 ----
302       $line1 .= <IN> if $line1 =~ /eval/;
303       $line1 .= <IN> if $line1 =~ /argv/;
304       $line2 = <IN>;
305 !     next if $line2 eq "'di ';\n" || $line2 eq "'di';\n";
306
307       # Pull the old switcheroo.
308
309 ***************
310 *** 49,56 ****
311
312       print OUT $line1;
313       print OUT <<EOF;
314 ! 'di';
315 ! 'ig00';
316   #
317   # $header
318   #
319 --- 49,58 ----
320
321       print OUT $line1;
322       print OUT <<EOF;
323 ! 'di ';
324 ! 'ds 00 \\"';
325 ! 'eo ';
326 ! 'ig 00 ';
327   #
328   # $header
329   #
330 ***************
331 *** 72,85 ****
332
333       # These next few lines are legal in both Perl and nroff.
334
335 ! $null.00;                       # finish .ig
336
337   'di           \\" finish diversion--previous line must be blank
338   .nr nl 0-1    \\" fake up transition to first page again
339   .nr % 0         \\" start at page 1
340 ! '; __END__ ##### From here on it's a standard manual page #####
341   .TH $PROG 1 "$month $mday, 19$year"
342 - .AT 3
343   .SH NAME
344   $prog \\- whatever
345   .SH SYNOPSIS
346 --- 74,87 ----
347
348       # These next few lines are legal in both Perl and nroff.
349
350 ! $null.00 ;                      # finish .ig
351 ! 'ec \\';
352
353   'di           \\" finish diversion--previous line must be blank
354   .nr nl 0-1    \\" fake up transition to first page again
355   .nr % 0         \\" start at page 1
356 ! .\\"'; __END__ ##### From here on it's a standard manual page #####
357   .TH $PROG 1 "$month $mday, 19$year"
358   .SH NAME
359   $prog \\- whatever
360   .SH SYNOPSIS
361
362 ----------------------------------------------------------------------
363
364 * groff uses up an enormous amount of memory processing large files.
365   I'm using 386BSD 0.1.
366
367 386BSD includes an old version of g++, 1.39, which has a bug that
368 causes a major memory leak in gtroff.  Apply the following fix to g++
369 and recompile groff:
370
371 *** cplus-decl.c.~1~    Mon Aug  6 05:28:59 1990
372 --- cplus-decl.c        Wed Jun  5 08:55:04 1991
373 ***************
374 *** 7951,7961 ****
375
376         /* At the end, call delete if that's what's requested.  */
377         if (TREE_GETS_DELETE (current_class_type))
378         exprstmt = build_method_call (build1 (NOP_EXPR, TYPE_POINTER_TO (current_class_type), error_mark_node),
379                                       get_identifier (OPERATOR_DELETE_FORMAT),
380 !                                     build_tree_list (NULL_TREE, integer_zero_node),
381                                       NULL_TREE, LOOKUP_NORMAL);
382         else if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
383         exprstmt = build_x_delete (ptr_type_node, current_class_decl, 0);
384         else
385         exprstmt = 0;
386 --- 7951,7961 ----
387
388         /* At the end, call delete if that's what's requested.  */
389         if (TREE_GETS_DELETE (current_class_type))
390         exprstmt = build_method_call (build1 (NOP_EXPR, TYPE_POINTER_TO (current_class_type), error_mark_node),
391                                       get_identifier (OPERATOR_DELETE_FORMAT),
392 !                                     build_tree_list (NULL_TREE, current_class_decl),
393                                       NULL_TREE, LOOKUP_NORMAL);
394         else if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
395         exprstmt = build_x_delete (ptr_type_node, current_class_decl, 0);
396         else
397         exprstmt = 0;
398
399
400
401 Printing and Display Problems
402 =============================
403
404
405
406 * I'm having problems including PostScript illustrations (EPS) using
407   the PSPIC macro and/or \X'ps: import ...'.
408
409 A PostScript document must meet three requirements in order to be
410 included with the PSPIC macro: it must comply with the Adobe Document
411 Structuring Conventions; it must contain a BoundingBox line; it must
412 be `well-behaved'.  The BoundingBox line should be of the form:
413
414   %%BoundingBox: llx lly urx ury
415
416 where llx, lly, urx, ury are the coordinates of the lower left x,
417 lower left y, upper right x, upper right y of the bounding box of
418 marks on the page expressed as integers in the default PostScript
419 coordinate system (72 units per inch, origin at bottom left corner).
420
421 The most convenient program to get the bounding box of a document is
422 the `ps2epsi' script coming with GhostScript.
423
424 If you can't use this program, another useful tactic is to print out
425 the illustration by itself (you may need to add a `showpage' at the
426 end), and physically measure the bounding box.  For more detail on
427 these requirements, read the specification of Encapsulated PostScript
428 format.  (This is available from the Adobe file server; send a message
429 with a body of `help' to ps-file-server@adobe.com.)
430
431 If an EPS file to be included via \X'ps: import' does not start with
432 `%!PS-Adobe-...', gtroff still includes the file, but grops does not
433 add any fonts to the generated output file that are listed in the EPS
434 file, even though the files are listed in the `download' file and are
435 available in the devps directory.
436
437 ----------------------------------------------------------------------
438
439 * I've configured groff for A4 paper, but gtroff still seems to think
440   that the length of a page (as returned by `\n(.p') is 11 inches.
441
442 This is intentional.  The PAGE option during configuration is used
443 only by grops.  For compatibility with ditroff, the default page
444 length in gtroff is always 11 inches.  The page length can be changed
445 with the `pl' request.
446
447 A convenient way to set paper dimensions is to use the -dpaper option
448 of groff, together with proper -P options for the postprocessor
449 (overriding the default).  For example, use the following for PS
450 output on A4 paper in landscape orientation:
451
452   groff -Tps -dpaper=a4l -P-pa4 -P-l -ms foo.ms > foo.ps
453
454 See groff_tmac(5) for more information.
455
456 ----------------------------------------------------------------------
457
458 * When I print the output of groff -Tps, the output is always shifted
459   up by about 0.7 inches; I'm using 8.5x11 inch paper.
460
461 Make sure that the paper size is `letter'.  See groff_tmac(5).
462
463 ----------------------------------------------------------------------
464
465 * When I try to run gxditview, I get the error:
466   Error: Widget viewport has zero width and/or height
467
468 This error means you haven't correctly installed the application
469 defaults file, GXditview.ad; `make install' does this for you
470 automatically, so either you didn't do `make install', or you haven't
471 passed a good `--appresdir=<DIR>' argument to groff's configure
472 script.
473
474 See the X(7) man page for information how and where application
475 resource files have to be located.  Look for the XAPPLRESDIR and
476 XUSERFILESEARCHPATH environment variables.
477
478 ----------------------------------------------------------------------
479
480 * When I preview documents using -TX75 or -TX100, the layout is not
481   the same as when I print the document with -Tps: the line and page
482   breaks come in different places.
483
484 Use `groff -X -Tps'.
485
486 ----------------------------------------------------------------------
487
488 * When I try to print the output of groff -Tps, I get no output at all
489   from the printer, and the log file shows the error
490   %%[ error: undefined; offendingcommand: BP ]%%
491   I'm using TranScript spooling software.
492
493 This is a bug in the page reversal filter in early versions of
494 TranScript.  Change the `broken' parameter in
495 /usr/local/lib/groff/font/devps/DESC to 7.
496
497 ----------------------------------------------------------------------
498
499 * When I preview groff -Tps output using the Sun OpenWindows 2.0
500   pageview program, all the pages are displayed on top of each other.
501
502 This is a defect in pageview.  Change the `broken' parameter in
503 /usr/local/lib/groff/font/devps/DESC to 2.
504
505 ----------------------------------------------------------------------
506
507 * With groff -TX75, -TX100 or -X, I can only view the first page.
508
509 The left mouse button brings up a menu that allows you to view other
510 pages.
511
512 ----------------------------------------------------------------------
513
514 * When I print the output of groff -Tdvi, I just get a black dot in
515   upper left corner.
516
517 Some dvi drivers (notably early versions of xtex) do not correctly
518 handle dvi files that use a resolution different from that used by dvi
519 files produced by TeX.  Try getting a more up to date driver.
520
521 ----------------------------------------------------------------------
522
523 * How can I use groff with an old LaserJet printer that doesn't work
524   with groff -Tlj4?
525
526 You have at least 3 options:
527
528 - use groff -Tps with GNU Ghostscript;
529
530 - use groff -Tdvi with a TeX .dvi to Laserjet driver;
531
532 - use groff with the LaserJet driver in Chris Lewis' psroff package
533   (available for ftp from:
534   ftp.uunet.ca:/distrib/chris_lewis/psroff3.0pl17).
535
536 ----------------------------------------------------------------------
537
538 * Groff seems to generate level 3 Postscript, but my printer is only a
539   level 1 or 2 PostScript printer.
540
541 In fact groff generates only level 2 PostScript (or rather level 1
542 with some extensions; see grops(1) for more information how to disable
543 them).  The `%!PS-Adobe-3.0' comment at the beginning of PostScript
544 output generated by groff indicates that the file conforms to version
545 3.0 of the Adobe Document Structuring Conventions.  The output
546 generated by groff should be printable on any PostScript printer.
547 Problems with groff output's not printing are most often caused by the
548 spooling system.
549
550
551
552 Platform-Dependent Macro Problems
553 =================================
554
555
556
557 * I get lots of errors when I use groff with the AT&T -mm macros.
558
559 Use the groff -mm macros.
560
561 ----------------------------------------------------------------------
562
563 * groff produces wrapper macros for `ms' and friends which call the
564   system's original macros.  Then, to get groff's ms macro package I
565   have to use `-mgs' instead `-ms'.  Can I avoid this?
566
567 Yes.  Configure and compile groff as usual, but install it with
568
569   make install tmac_wrap=""
570
571 Then no wrapper files are produced, and `-ms' uses groff's `ms'
572 macros.
573
574 ----------------------------------------------------------------------
575
576 * I'm having problems formatting HP-UX 9.0 man pages with groff -man.
577
578 Copy HP's tmac.an into /usr/local/share/groff/site-tmac/an.tmac, and
579 either put `.cp 1' at the beginning or filter it (and any files it
580 .so's) through tmac/fixmacros.sed.
581
582 ----------------------------------------------------------------------
583
584 * I get errors using the Unix -ms macros with groff -e -C.
585
586 Apply this change:
587
588 *** /usr/lib/ms/ms.eqn  Tue Apr 25 02:14:28 1989
589 --- ms.eqn      Sun Nov 11 10:33:59 1990
590 ***************
591 *** 22,29 ****
592   ..
593   .     \" EN - end of a displayed equation
594   .de EN
595 ! .if !\a\\*(10\a\a .br
596   .di
597   .rm EZ
598   .nr ZN \\n(dn
599   .if \\n(ZN>0 .if \\n(YE=0 .LP
600 --- 22,30 ----
601   ..
602   .     \" EN - end of a displayed equation
603   .de EN
604 ! .if \\n(.k>0 .br
605   .di
606 + .ds 10 \\*(EZ\\
607   .rm EZ
608   .nr ZN \\n(dn
609   .if \\n(ZN>0 .if \\n(YE=0 .LP
610
611 ----------------------------------------------------------------------
612
613 * I'm having problems formatting Ultrix man pages with groff -man.
614
615 The Ultrix man pages use a number of non-standard extensions to the
616 Unix man macros.  One solution is to use the Ultrix -man macros with
617 groff.  Copy /usr/lib/tmac/tmac.an to
618 /usr/local/share/groff/site-tmac/an.tmac and apply the following patch
619 (from Frank Wortner):
620
621 *** /usr/local/lib/groff/tmac/tmac.an     Wed Sep  9 12:29:28 1992
622 --- /usr/lib/tmac/tmac.an       Fri Jul 24 19:58:19 1992
623 ***************
624 *** 489,495 ****
625   .     \" make special case of shift out of italic
626   .de }S
627   .ds ]F
628 ! .if \\$12 .if !\\$5 .ds ]F \^
629   .ie !\\$4 .}S \\$2 \\$1 "\\$3\f\\$1\\$4\\*(]F" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
630   .el \\$3
631   .}f
632 --- 489,495 ----
633   .     \" make special case of shift out of italic
634   .de }S
635   .ds ]F
636 ! .if \\$12 .if !\\$5 .ds ]F\^
637   .ie !\\$4 .}S \\$2 \\$1 "\\$3\f\\$1\\$4\\*(]F" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
638   .el \\$3
639   .}f
640
641 Another possible solution is to install tmac/man.ultrix as
642 /usr/local/share/groff/site-tmac/man.local.
643
644 ----------------------------------------------------------------------
645
646 * On an SGI system, how can I make the man command use groff?
647
648 From David Hinds <dhinds@allegro.stanford.edu> (some of these steps
649 are unnecessary if you install with the `g' Makefile variable defined
650 as empty):
651
652 Create a script called `eqn':
653
654  > #! /bin/sh
655  > if [ ${1:-""} = /usr/pub/eqnchar ] ; then shift ; fi
656  > geqn $*
657
658 and a script called `neqn':
659
660  > #! /bin/sh
661  > if [ ${1:-""} = /usr/pub/eqnchar ] ; then shift ; fi
662  > geqn -Tascii $*
663
664 and do:
665
666  > ln -s gnroff nroff
667
668 and edit the end of the gnroff script to be:
669
670  > rest=`echo ${1+"$@"} | sed -e 's+/usr/lib/tmac+/usr/local/lib/groff/tmac+'`
671  > exec groff -Wall -mtty-char $T $opts $rest
672
673 To get PostScript output from `man -t', you also need to create a
674 `psroff' script similar to `nroff'.  Here are the context diffs:
675
676 *** /usr/local/bin/nroff        Sat Feb 13 15:51:09 1993
677 --- /usr/local/bin/psroff       Sat Feb 13 17:45:46 1993
678 ***************
679 *** 1,8 ****
680   #! /bin/sh
681 ! # Emulate nroff with groff.
682
683   prog="$0"
684 ! T=-Tascii
685   opts=
686
687   for i
688 --- 1,8 ----
689   #! /bin/sh
690 ! # Emulate psroff with groff.
691
692   prog="$0"
693 ! T=-Tps
694   opts=
695
696   for i
697 ***************
698 *** 25,30 ****
699 --- 25,33 ----
700         -Tascii|-Tlatin1)
701                 T=$1
702                 ;;
703 +       -t)
704 +               # ignore -- default is send to stdout
705 +               ;;
706         -T*)
707                 # ignore other devices
708                 ;;
709 ***************
710 *** 49,53 ****
711   rest=`echo ${1+"$@"} | sed -e 's+/usr/lib/tmac+/usr/local/lib/groff/tmac+'`
712
713   # This shell script is intended for use with man, so warnings are
714   # probably not wanted.  Also load nroff-style character definitions.
715 ! exec groff -Wall -mtty-char $T $opts $rest
716 --- 52,56 ----
717   rest=`echo ${1+"$@"} | sed -e 's+/usr/lib/tmac+/usr/local/lib/groff/tmac+'`
718
719   # This shell script is intended for use with man, so warnings are
720 ! # probably not wanted.
721 ! exec groff -Wall $T $opts $rest
722
723
724
725 Compilation Problems
726 ====================
727
728
729
730 * Compilation dies with
731
732     y.tab.c: In function `int yyparse()':
733     y.tab.c: `size_t' undeclared in namespace `std'
734
735 * bison reports conflicts (either on stderr or in the `pic.output'
736   file) while processing `pic.y', and the produced pic binary doesn't
737   work at all.
738
739 You need bison version 1.875b or greater.  Alternatively, use yacc or
740 byacc.
741
742 ----------------------------------------------------------------------
743
744 * There are many empty `Makefile.dep' files.  Is this a bug?
745
746 No.  Real dependency files are created with a `make depend' call.
747
748 ----------------------------------------------------------------------
749
750 * On HP-UX, the compiler complains about missing symbol `alloca'.
751
752 Say
753
754   export LDFLAGS=-lPW
755
756 before starting the configure script.
757
758 ----------------------------------------------------------------------
759
760 * The configure script fails on OS/390 (z/OS) Unix.
761
762 [This has been fixed in z/OS V1R3 (aka OS/390 R13).]
763
764 There is a bug in the Language Environment (LE) whereby the test
765 program for static destructors fails.  You see the message `configure:
766 error: a working C++ compiler is required'.
767
768 Applying PTF UQ42006 is supposed to fix this, but the test program is
769 still returning the wrong value (1).  To work around this problem, you
770 can comment out the following in the configure script (near line
771 2029).  This effectively bypasses the test (static constructors and
772 destructors do actually work properly):
773
774 #if { (eval echo "$as_me:2029: \"$ac_link\"") >&5
775 #  (eval $ac_link) 2>&5
776 #  ac_status=$?
777 #  echo "$as_me:2032: \$? = $ac_status" >&5
778 #  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
779 #  { (eval echo "$as_me:2034: \"$ac_try\"") >&5
780 #  (eval $ac_try) 2>&5
781 #  ac_status=$?
782 #  echo "$as_me:2037: \$? = $ac_status" >&5
783 #  (exit $ac_status); }; }; then
784 #  echo "$as_me:2039: result: yes" >&5
785 #echo "${ECHO_T}yes" >&6
786 #else
787 #  echo "$as_me: program exited with status $ac_status" >&5
788 #echo "$as_me: failed program was:" >&5
789 #cat conftest.$ac_ext >&5
790 #echo "$as_me:2045: result: no" >&5
791 #echo "${ECHO_T}no" >&6;{ { echo "$as_me:2046: error: a working C++ compiler is required" >&5
792 #echo "$as_me: error: a working C++ compiler is required" >&2;}
793 #   { (exit 1); exit 1; }; }
794 #fi
795
796 ----------------------------------------------------------------------
797
798 * I get errors when I try to compile groff with DEC C++.
799
800 Fix the declaration of write() in <unistd.h> so that the second
801 argument is a const char *.  Fix the declaration of open() in
802 <sys/file.h> so that the first argument is a const char *.
803
804 ----------------------------------------------------------------------
805
806 * On a host using Unix make (e.g. Solaris), if you are compiling for
807   multiple architectures by building in a subdirectory, the make stops
808   with a message like this:
809
810     make: Fatal error: Don't know how to make target `assert.o'
811
812   or like this:
813
814     make: Fatal error: Can't find /u/src/groff/src/include/Makefile.sub': No such file or directory
815
816 This occurs because GNU make and Unix make handle VPATH differently,
817 and the groff build relies on GNU make's VPATH handling.
818
819 Use GNU make <http://www.gnu.org/software/make/> to work around this.
820 In Solaris 8 and 9, GNU make is on the Software Companion CD in
821 package SFWgmake and is installed as /opt/sfw/bin/gmake.  Prebuilt
822 versions of GNU make for Solaris are also available from
823 sunfreeware.com.
824
825 ----------------------------------------------------------------------
826
827 * On Ultrix, the make program stops with the message
828
829     *** Error code 1
830
831     Stop.
832
833   for no apparent reason.
834
835 Use GNU make.
836
837 ----------------------------------------------------------------------
838
839 * I'm having problems compiling groff on 386BSD 0.1.
840
841 If you're using ash as /bin/sh, you'll need the following patch.
842
843 *** gendef.sh.org       Sun Jun 30 13:30:36 1991
844 --- gendef.sh   Sun Feb 28 10:23:49 1993
845 ***************
846 *** 3,9 ****
847   file=$1
848   shift
849
850 ! defs="#define $1"
851   shift
852   for def
853   do
854 --- 3,10 ----
855   file=$1
856   shift
857
858 ! x=$1
859 ! defs="#define $x"
860   shift
861   for def
862   do
863
864 You'll also need to change dirnamemax.c so that it doesn't use
865 pathconf().
866
867 ----------------------------------------------------------------------
868
869 * While compiling on Xenix, ranlib libgroff.a fails.
870
871 The system ranlib can't handle externals longer than 40 characters.
872 Use the ranlib included in demon.co.uk:/pub/xenix/g++-1.40.3a.v1
873 instead.
874
875 ----------------------------------------------------------------------
876
877 * I get errors when I try to compile groff with Sun C++ version 3 or
878   earlier.
879
880 Groff requires header files that are moderately compatible with AT&T
881 C++ and ANSI C.  With some versions of Sun C++, the supplied header
882 files need some of the following changes to meet this requirement:
883 <string.h> must declare the mem* functions, (just add `#include
884 <memory.h>' to <string.h>); the first argument to fopen and freopen
885 should be declared as `const char *'; the first argument to fread
886 should be declared as `void *'; the first argument to fwrite should be
887 declared as `const void *'; malloc should be declared to return
888 `void *'; in <alloca.h>, the declaration `extern "C" { void
889 *__builtin_alloca(int); }' should be added; in <sys/signal.h> the
890 return type and the second argument type of signal() should be changed
891 to be `void (*)(int)'.
892
893 You can either change them in place, or copy them to some other
894 directory and include that directory with a -I option.
895
896 ----------------------------------------------------------------------
897
898 * I get errors when I try to compile groff with Forte Development 6
899   or 6u1, or Sun C++ version 5.0 through 5.2.
900
901 This is a known problem; see Sun bug #4301919.  See Sun patches
902 109482, 109490, 109508, and 109509 for fixes.
903
904 ----------------------------------------------------------------------
905
906 * I get warnings from the Sun linker while using gcc 3.4.0:
907
908   ld: warning: relocation error: R_SPARC_UA32:
909       file groff/src/libs/libgroff/libgroff.a(getopt.o): symbol optarg:
910       external symbolic relocation against non-allocatable
911       section .debug_info; cannot be processed at runtime:
912       relocation ignored
913
914 This seems to be a known problem (Sun bugs #4910101 and #4910810,
915 filed in September 2003; gcc bug #15599, filed May 2004) without a
916 public fix as of this writing.  A work-around is to use option
917 `-gstabs+' instead of `-g' (and a high probability that the output is
918 only debuggable with gdb but not with Sun's debuggers).
919
920 ----------------------------------------------------------------------
921
922 * I get lots of `numeric overflow' error messages whenever I run
923   groff; I compiled groff with AT&T C++ 2.0 with an ANSI C compiler.
924
925 Make sure -DCFRONT_ANSI_BUG is included in DEFINES in the top-level
926 Makefile.  If that doesn't solve the problem, define INT_MIN as
927 -INT_MAX in libgroff/lib.h.
928
929 ----------------------------------------------------------------------
930
931 * In MacOS X, I want to completely replace the groff that came with
932   the system.
933
934 Use
935
936   ./configure --prefix=/usr --mandir=/usr/share/man
937
938 then
939
940   make
941   make install
942
943 Note that subsequent system updates may replace your groff.
944
945 ----------------------------------------------------------------------
946
947 * When compiling on MacOS X 10.2, groff compiles but does not run
948   well, especially `eqn', causing many `can't break line' messages.
949
950 Use
951
952   ./configure CXX=g++2
953
954 then
955
956   make
957
958 as usual.
959
960 ----------------------------------------------------------------------
961
962 * Configuration on MacOS X 10.6 doesn't succeed.
963
964 Use
965
966   ./configure CXX=g++-4.2
967
968 ##### Emacs settings
969 Local Variables:
970 mode: text
971 End: