/contrib/groff/PROBLEMS

https://bitbucket.org/freebsd/freebsd-head/ · #! · 916 lines · 663 code · 253 blank · 0 comment · 0 complexity · 1875928943fa844f194471817896ca16 MD5 · raw file

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