home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.bin / groff / INSTALL.gnu < prev    next >
Encoding:
Text File  |  1991-04-30  |  13.2 KB  |  404 lines

  1. Groff has been compiled on a Sun 4 under SunOS 4.0.3 with g++ 1.37.1
  2. and with AT&T C++ 2.0, and on a 386 PC under 386/ix 2.0.1 with g++
  3. 1.37.1 using Michael Bloom's GNU COFF patches.  You may encounter
  4. problems on other machines that I cannot anticipate.
  5.  
  6. If you are using g++, you will need to install the header files from
  7. libg++.  The only other parts of libg++ used by groff are contained in
  8. the files xyzzy.c and gnulib3.c; the libg++.a that I use contains only
  9. xyzzy.o and gnulib3.o.  You don't need xyzzy.o unless you're using GNU
  10. ld.
  11.  
  12. If you are using g++ 1.37.2 alpha, you'll need the following fix (from
  13. Michael Tiemann):
  14.  
  15. *** cplus-tree.c~    Sat Jun 23 16:10:41 1990
  16. --- cplus-tree.c    Sat Jun 30 23:45:09 1990
  17. ***************
  18. *** 685,688 ****
  19. --- 685,689 ----
  20.   }
  21.   
  22. + /* Constructor for hashed lists.  */
  23.   tree
  24.   hash_tree_chain (value, chain)
  25. ***************
  26. *** 701,705 ****
  27. --- 702,721 ----
  28.   }
  29.   
  30. + /* Similar, but used for concatenating two lists.  */
  31.   tree
  32. + hash_chainon (list1, list2)
  33. +      tree list1, list2;
  34. + {
  35. +   if (list2 == 0)
  36. +     return list1;
  37. +   if (list1 == 0)
  38. +     return list2;
  39. +   if (TREE_CHAIN (list1) == NULL_TREE)
  40. +     return hash_tree_chain (TREE_VALUE (list1), list2);
  41. +   return hash_tree_chain (TREE_VALUE (list1),
  42. +               hash_chainon (TREE_CHAIN (list1), list2));
  43. + }
  44. + tree
  45.   build_decl_list_1 (value)
  46.        tree value;
  47. ***************
  48. *** 926,930 ****
  49.       {
  50.         if (DECL_NAME (decl))
  51. !     return IDENTIFIER_POINTER (DECL_NAME (decl));
  52.         return "((anonymous))";
  53.       }
  54. --- 942,950 ----
  55.       {
  56.         if (DECL_NAME (decl))
  57. !     {
  58. !       if (THIS_NAME_P (DECL_NAME (decl)))
  59. !         return "this";
  60. !       return IDENTIFIER_POINTER (DECL_NAME (decl));
  61. !     }
  62.         return "((anonymous))";
  63.       }
  64. *** cplus-parse.y~    Mon Jun  4 23:52:34 1990
  65. --- cplus-parse.y    Sat Jun 30 23:45:09 1990
  66. ***************
  67. *** 501,505 ****
  68.               error ("no base initializers given following ':'");
  69.             setup_vtbl_ptr ();
  70. !          }
  71.       ;
  72.   
  73. --- 501,505 ----
  74.               error ("no base initializers given following ':'");
  75.             setup_vtbl_ptr ();
  76. !         }
  77.       ;
  78.   
  79. ***************
  80. *** 1274,1278 ****
  81.           { $$ = hash_tree_chain ($1, $2); }
  82.       | declmods typespec reserved_declspecs
  83. !         { $$ = hash_tree_chain ($2, chainon ($3, $1)); }
  84.       ;
  85.   
  86. --- 1274,1278 ----
  87.           { $$ = hash_tree_chain ($1, $2); }
  88.       | declmods typespec reserved_declspecs
  89. !         { $$ = hash_tree_chain ($2, hash_chainon ($3, $1)); }
  90.       ;
  91.   
  92. ***************
  93. *** 1319,1323 ****
  94.           { $$ = decl_tree_cons (NULL_TREE, $1, $2); }
  95.       | nonempty_type_quals typespec reserved_typespecquals
  96. !         { $$ = decl_tree_cons (NULL_TREE, $2, chainon ($3, $1)); }
  97.       ;
  98.   
  99. --- 1319,1323 ----
  100.           { $$ = decl_tree_cons (NULL_TREE, $1, $2); }
  101.       | nonempty_type_quals typespec reserved_typespecquals
  102. !         { $$ = decl_tree_cons (NULL_TREE, $2, hash_chainon ($3, $1)); }
  103.       ;
  104.   
  105.  
  106. If you're using g++ 1.39 on a sparc you'll probably want to apply the
  107. following fix (from Casper H.S. Dik):
  108.  
  109. *** config/out-sparc.c.org    Wed Dec 12 03:13:57 1990
  110. --- config/out-sparc.c    Sat Feb 23 23:21:26 1991
  111. ***************
  112. *** 908,925 ****
  113.       else if (GET_CODE (XEXP (operands[1], 0)) == PLUS)
  114.         {
  115.           rtx inc_reg = XEXP (XEXP (operands[1], 0), 0);
  116.           if (inc_reg == frame_pointer_rtx
  117.           && GET_CODE (XEXP (XEXP (operands[1], 0), 1)) == REG
  118. !         && XEXP (XEXP (operands[1], 0), 0) != frame_pointer_rtx)
  119.             inc_reg = XEXP (XEXP (operands[1], 0), 1);
  120.           if (inc_reg == frame_pointer_rtx)
  121.             {
  122.           output_asm_insn ("mov %%fp,%%g1", xoperands);
  123.           inc_reg = gen_rtx (REG, SImode, 1);
  124.             }
  125.           xoperands[1] = inc_reg;
  126.           output_asm_insn ("add 4,%1,%1", xoperands);
  127. !         xoperands[1] = operands[1];
  128.           output_asm_insn ("ld %1,%0", xoperands);
  129.           xoperands[1] = inc_reg;
  130.           output_asm_insn ("add -4,%1,%1", xoperands);
  131. --- 908,931 ----
  132.       else if (GET_CODE (XEXP (operands[1], 0)) == PLUS)
  133.         {
  134.           rtx inc_reg = XEXP (XEXP (operands[1], 0), 0);
  135. +         rtx from = operands[1];
  136.           if (inc_reg == frame_pointer_rtx
  137.           && GET_CODE (XEXP (XEXP (operands[1], 0), 1)) == REG
  138. !         && XEXP (XEXP (operands[1], 0), 1) != frame_pointer_rtx)
  139.             inc_reg = XEXP (XEXP (operands[1], 0), 1);
  140.           if (inc_reg == frame_pointer_rtx)
  141.             {
  142.           output_asm_insn ("mov %%fp,%%g1", xoperands);
  143.           inc_reg = gen_rtx (REG, SImode, 1);
  144. +         from = gen_rtx (GET_CODE (operands[1]),
  145. +                 GET_MODE (operands[1]),
  146. +                 gen_rtx (PLUS, GET_MODE (XEXP (operands[1], 0)),
  147. +                            inc_reg,
  148. +                            XEXP (XEXP (operands[1], 0), 1)));
  149.             }
  150.           xoperands[1] = inc_reg;
  151.           output_asm_insn ("add 4,%1,%1", xoperands);
  152. !         xoperands[1] = from;
  153.           output_asm_insn ("ld %1,%0", xoperands);
  154.           xoperands[1] = inc_reg;
  155.           output_asm_insn ("add -4,%1,%1", xoperands);
  156. ***************
  157. *** 989,1006 ****
  158.       else if (GET_CODE (XEXP (operands[0], 0)) == PLUS)
  159.         {
  160.           rtx inc_reg = XEXP (XEXP (operands[0], 0), 0);
  161.           if (inc_reg == frame_pointer_rtx
  162.           && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == REG
  163. !         && XEXP (XEXP (operands[0], 0), 0) != frame_pointer_rtx)
  164.             inc_reg = XEXP (XEXP (operands[0], 0), 1);
  165.           if (inc_reg == frame_pointer_rtx)
  166.             {
  167.           output_asm_insn ("mov %%fp,%%g1", xoperands);
  168.           inc_reg = gen_rtx (REG, SImode, 1);
  169.             }
  170.           xoperands[0] = inc_reg;
  171.           output_asm_insn ("add 4,%0,%0", xoperands);
  172. !         xoperands[0] = operands[0];
  173.           output_asm_insn ("st %r1,%0", xoperands);
  174.           xoperands[0] = inc_reg;
  175.           output_asm_insn ("add -4,%0,%0", xoperands);
  176. --- 995,1018 ----
  177.       else if (GET_CODE (XEXP (operands[0], 0)) == PLUS)
  178.         {
  179.           rtx inc_reg = XEXP (XEXP (operands[0], 0), 0);
  180. +         rtx to = operands[0];
  181.           if (inc_reg == frame_pointer_rtx
  182.           && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == REG
  183. !         && XEXP (XEXP (operands[0], 0), 1) != frame_pointer_rtx)
  184.             inc_reg = XEXP (XEXP (operands[0], 0), 1);
  185.           if (inc_reg == frame_pointer_rtx)
  186.             {
  187.           output_asm_insn ("mov %%fp,%%g1", xoperands);
  188.           inc_reg = gen_rtx (REG, SImode, 1);
  189. +         to = gen_rtx (GET_CODE (operands[0]),
  190. +                 GET_MODE (operands[0]),
  191. +                 gen_rtx (PLUS, GET_MODE (XEXP (operands[0], 0)),
  192. +                            inc_reg,
  193. +                            XEXP (XEXP (operands[0], 0), 1)));
  194.             }
  195.           xoperands[0] = inc_reg;
  196.           output_asm_insn ("add 4,%0,%0", xoperands);
  197. !         xoperands[0] = to;
  198.           output_asm_insn ("st %r1,%0", xoperands);
  199.           xoperands[0] = inc_reg;
  200.           output_asm_insn ("add -4,%0,%0", xoperands);
  201.  
  202. On a Sun 3 and other 68k machines, using libg++ 1.37.0 you will need
  203. to apply the following change to g++-include/math.h:
  204.  
  205. *** math.h-    Sat Jan  6 14:09:52 1990
  206. --- math.h    Tue Mar 13 02:07:01 1990
  207. ***************
  208. *** 32,39 ****
  209.   
  210.   
  211.   #ifdef __HAVE_68881__        /* MC68881/2 Floating-Point Coprocessor */
  212. - #include <math-68881.h>
  213.   extern "C" {            /* fill in what we've left out */
  214.   
  215.   double  acosh(double);
  216.   double  asinh(double);
  217. --- 32,39 ----
  218.   
  219.   
  220.   #ifdef __HAVE_68881__        /* MC68881/2 Floating-Point Coprocessor */
  221.   extern "C" {            /* fill in what we've left out */
  222. + #include <math-68881.h>
  223.   
  224.   double  acosh(double);
  225.   double  asinh(double);
  226.  
  227. If you have bison 1.11, you will need to apply the following fix to
  228. bison.simple if you want change any of the grammars:
  229.  
  230. *** bison.simple.~1~    Fri Aug 10 12:13:41 1990
  231. --- bison.simple    Fri Aug 10 12:24:46 1990
  232. ***************
  233. *** 20,26 ****
  234. --- 20,28 ----
  235.   
  236.   
  237.   #ifdef __GNUC__
  238. + #ifndef alloca
  239.   #define alloca __builtin_alloca
  240. + #endif /* Not alloca. */
  241.   #else /* Not GNU C.  */
  242.   #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__)
  243.   #include <alloca.h>
  244. ***************
  245. *** 114,123 ****
  246. --- 116,129 ----
  247.   /* This is the most reliable way to avoid incompatibilities
  248.      in available built-in functions on various systems.  */
  249.   static void
  250. + #ifdef __cplusplus
  251. + __yy_bcopy (char *from, char *to, int count)
  252. + #else
  253.   __yy_bcopy (from, to, count)
  254.        char *from;
  255.        char *to;
  256.        int count;
  257. + #endif
  258.   {
  259.     register char *f = from;
  260.     register char *t = to;
  261. ***************
  262. *** 127,133 ****
  263.       *t++ = *f++;
  264.   }
  265.   
  266. ! #line 131 "/usr/local/lib/bison.simple"
  267.   int
  268.   yyparse()
  269.   {
  270. --- 133,139 ----
  271.       *t++ = *f++;
  272.   }
  273.   
  274. ! #line 137 "/usr/local/lib/bison.simple"
  275.   int
  276.   yyparse()
  277.   {
  278.  
  279. For gas 1.36 on a Sun 4, the following fix is desirable:
  280.  
  281. *** sparc.c.~1~    Mon May 21 19:06:18 1990
  282. --- sparc.c    Sat Aug 11 11:09:12 1990
  283. ***************
  284. *** 56,65 ****
  285. --- 56,67 ----
  286.   static struct hash_control *op_hash = NULL;
  287.   
  288.   static void s_seg(), s_proc(), s_data1(), s_reserve(), s_common();
  289. + static void s_sparc_align();
  290.   extern void s_globl(), s_long(), s_short(), s_space(), cons();
  291.   
  292.   pseudo_typeS
  293.   md_pseudo_table[] = {
  294. +     { "align",        s_sparc_align, 0 },
  295.       { "common",     s_common,   0 },
  296.       { "global",     s_globl,    0 },
  297.       { "half",       cons,       2 },
  298.  
  299. *** read.c.~1~    Tue Mar  6 21:08:29 1990
  300. --- read.c    Sat Aug 11 11:07:23 1990
  301. ***************
  302. *** 175,181 ****
  303. --- 175,183 ----
  304.   potable[] =
  305.   {
  306.     { "abort",    s_abort,    0    },
  307. + #ifndef SPARC
  308.     { "align",    s_align,    0    },
  309. + #endif
  310.     { "ascii",    stringer,    0    },
  311.     { "asciz",    stringer,    1    },
  312.     { "byte",    cons,        1    },
  313.  
  314.  
  315. On a Sequent Symmetry S27 running Dynix 3.0.17, you'll need to use GNU
  316. make or add 'MAKE=make' to Makefiles which use $(MAKE).  You'll also
  317. need to change
  318.  
  319.   dev=${GROFF_TYPESETTER:-@DEVICE@}
  320.  
  321. to
  322.  
  323.   dev=$GROFF_TYPESETTER
  324.  
  325. in groff.sh.  You should use gcc to compile xditview.
  326.  
  327. You should only have to edit the top-level Makefile.  The comments
  328. should make it clear what has to be changed.  If you don't have a
  329. separate directory tree for local manual pages you can make
  330. MAN[157]EXT be l (that's an ell) or n, and MANROOT be /usr/man.  The
  331. changes you make to the top-level Makefile will be propagated to
  332. sub-makes, but this won't happen if you invoke make in the
  333. sub-directories.
  334.  
  335. You might also need to edit groff.sh.  This is a shell-script that
  336. runs gtroff, an appropriate postprocessor and optionally various
  337. preprocessors.  (Actually, the shell-script is created from groff.sh
  338. by substituting for some variables surrounded by @s).  If your kernel
  339. doesn't understand #!, you will need to arrange for the script to be
  340. run by /bin/sh in some other way.
  341.  
  342. If you want to use existing troff drivers you should change groff.sh
  343. so that it recognises them.  It is also a good idea to copy over the
  344. dev* directory for the device into a directory that's only searched by
  345. groff (eg /usr/local/lib/groff/font), so that you can take advantage
  346. of the groff extensions to the DESC and font formats.  Groff only uses
  347. the ASCII versions of the device files so you only need copy them.  If
  348. you want to use GNU eqn, it is essential that the font files contain
  349. correct height and depth information.  The format for this information
  350. is described in the groff_font(5) page.  The best way to add this
  351. information is to modify the program that generates the font files.
  352. As a last resort you could try using the program addftinfo: it
  353. attempts to guess plausible heights and depths.  To obtain good
  354. results you would probably have to do more work on addftinfo.
  355.  
  356. To compile everything, just do a `make'.  If that works, then do a
  357. `make install'.
  358.  
  359. If you have problems compiling pic/pic.tab.c or eqn/eqn.tab.c, you might
  360. want to try using your system's yacc.  Set YACC=yacc in the top-level
  361. Makefile, and also do
  362.  
  363.   mv pic/pic.tab.c pic/pic.tab.c.dist
  364.   mv eqn/eqn.tab.c eqn/eqn.tab.c.dist
  365.  
  366. so that the parsers will be regenerated using yacc (the supplied
  367. *.tab.[ch] files were generated by bison.)
  368.  
  369. If you want to install xditview, you'll need to do that separately:
  370. change directory to xditview, edit the Makefile, do a make and a make
  371. install. You'll need to be running X11R4.
  372.  
  373. The dvi files produced by grodvi can use fonts at non-standard
  374. magnifications.  You may need to compile fonts with Metafont at these
  375. magnifications. The CompileFonts script in the dvi/devdvi directory
  376. may help you to do this. (It will take a *long* time.)
  377.  
  378. If you have problems printing existing troff documents, read the
  379. section on `Incompatbilities' in gtroff(1).  If you have existing
  380. macro packages that are in the habit of omitting the space between a
  381. macro or request and its arguments, it is good idea to produce a
  382. version with spaces so that you can use it with groff (without having
  383. to use the -C flag).  The file macros/fixmacros.sed is a sed script
  384. which will attempt to edit a file of macros so that it can be used
  385. with groff without the -C flag.  If you have the DWB 2.0 mm macros
  386. installed on your machine, you might want to do a `make install.mm';
  387. this will copy the mm macros to groff's macro directory and fix a few
  388. problems that occur when using the mm macros with groff; this requires
  389. the `patch' program.  If the patch in macros/mm.diff is rejected,
  390. carefully apply it by hand.
  391.  
  392. You can share groff with a friend who has the same type of machine as
  393. you, but does not have a C++ compiler.  First do `make bindist'; this
  394. will create a subdirectory `bindist' containing a set of binaries, a
  395. Makefile and a README.  If you want to strip the binaries, now do a
  396. `make strip' in the bindist directory.  Rename the bindist directory
  397. to something more meaningful, tar it up, and give to your friend along
  398. with the original groff source distribution.  Your friend can then
  399. install groff just by editing the Makefile in the bindist directory
  400. and doing a make there; this will automatically install the non-binary
  401. parts of the groff source distribution as well as the binaries from
  402. the bindist directory.
  403.