This is a port of GNU Groff version 1.10 to DJGPP v2.01 or later.
Groff is the GNU version of document formatting tools related to
`troff'.

This README file describes how to build and install Groff on MS-DOS
systems using the DJGPP port of GNU C/C++ compiler and development
tools.


I.  Installing the pre-compiled binary package
    ------------------------------------------

    1. Unzip the file gro110b.zip preserving the directory structure
       (-d switch to PKUNZIP) from the main DJGPP installation
       directory.  If you will use Groff on Windows 9x, use an unzip
       program which supports long filenames.

    2. Groff binaries were configured so that they will look for their
       standard directories under C:\DJGPP.  If the main DJGPP
       directory on your system is different, add the following to
       your DJGPP.ENV file:


	[groff]
	+GROFF_TMAC_PATH=.;%DJDIR%/share/groff/tmac
	+GROFF_TYPESETTER=ascii
	+GROFF_FONT_PATH=.;%DJDIR%/share/groff/font

	[eqn]
	+GROFF_TMAC_PATH=.;%DJDIR%/share/groff/tmac
	+GROFF_TYPESETTER=ascii

	[grodvi]
	+GROFF_FONT_PATH=.;%DJDIR%/share/groff/font

	[grolj4]
	+GROFF_FONT_PATH=.;%DJDIR%/share/groff/font

	[grops]
	+GROFF_FONT_PATH=.;%DJDIR%/share/groff/font
	+GROFF_TMPDIR=%TMPDIR%

	[grotty]
	+GROFF_FONT_PATH=.;%DJDIR%/share/groff/font

	[indxbib]
	+GROFF_EIGN=%DJDIR%/share/groff/eign

	[lkbib]
	+REFER=%DJDIR%/share/Ind

	[refer]
	+REFER=%DJDIR%/share/Ind
	+GROFF_TMPDIR=%TMPDIR%

	[troff]
	+GROFF_TMAC_PATH=.;%DJDIR%/share/groff/tmac
	+GROFF_TYPESETTER=ascii
	+GROFF_FONT_PATH=.;%DJDIR%/share/groff/font

       You can also set the above variables (sans the `+' sign) from
       the DOS prompt, in which case replace %DJDIR% with the name of
       the directory where you unzip the distribution, and replace
       %TMPDIR% with the name of a temporary directory.

       Note that the GROFF_TYPESETTER variable sets the default Groff
       device to be `ascii', which is suitable for formatting man
       pages to be viewed on the terminal.  Use the -T switch to
       generate output for other devices (e.g., -Tps for PostScript).

    3. If your TMPDIR environment variable points to a RAM drive, you
       might consider changing GROFF_TMPDIR to point to a directory on
       a real disk drive, especially if you intend to generate
       PostScript output, because RAM disks are typically small (2-3
       MBytes) which might be too small for large jobs.

    4. Read the docs.  It comes as formatted manual pages called *.1n,
       *.5n and *.7n which unzip into your info/ subdirectory.  You
       can read them with a pager such as GNU Less (recommended, as
       Less will use colors for bold and underlined text) or with
       Info (which will remove the bold/underline attributes).
       Another alternative is to use Emacs built-in man page reader;
       the DJGPP FAQ lists other possibilities.

    5. For those who only need Groff to format man pages and don't
       like reading the docs, here's how you do that:

		  groff -man -s -Tascii foo.1 > foo.man

       where `foo.1' is the troff source of the man page and `foo.man'
       is the formatted page.  If you need to view the man page, say
       this:

		  groff -man -s -Tascii foo.1 | less

       Here's how you print the page on a PostScript printer:

		  groff -man -s -Tps foo.1 > prn

       And this is for a LaserJet4 printer:

		  groff -man -s -Tlj4 foo.1 > prn

       Generally, you should redirect output of Groff to the printer,
       rather than use the `-l' switch to Groff, unless you have a
       program called `lpr' installed, because `-l' causes Groff to
       pipe its output to a program by that name.  If you do have such
       a program and want to use it with Groff, make sure it can print
       its standard input (some versions of `lpr' which come with DOS
       network redirectors can't).  The name of the program is read by
       Groff from the files named `DESC' in the devXXX subdirectories
       of %DJDIR%/share/groff/font, so you can change it manually if
       your `lpr' clone is called differently (e.g., `lp').

    6. Some programs in the package are supplied as Unix shell
       scripts.  While it is relatively easy to write a DOS batch file
       which will do the same, DOS doesn't allow to redirect input and
       output of a batch file.  Since Groff tools are meant to be
       invoked in a pipe, the batch files would be useless.  If you
       need to run these scripts, you would need to install the port
       of bash (or other Unix-like shell) and any utilities called by
       the script.  Alternatively, just look inside the shell script
       and invoke the programs it calls manually.

    7. The `grog' script and `grog.bat' batch file need these
       utilities to run (in addition to the Groff programs they call):

		 - bash
		 - gawk
		 - egrep
		 - sed

       All of these should be available from the DJGPP sites.

       The `afmtodit' utility is a Perl script, so you will need a
       Perl port to run it.

       Fortunately, both `grog' and `afmtodit' are used infrequently
       and aren't required for core Groff functionality.

    8. Note that Groff programs use floating point, so you will need
       an FP emulator if your machine doesn't have an FPU.  The binary
       distribution includes the emulator, in case you don't have the
       DJGPP development environment installed.  Please refer to the
       DJGPP FAQ list in case you have any problems with the emulator.

    9. The package does not include the directories under
       share/groff/font whose names begin with "devX": these are
       needed on X-Windows which are not supported by this port.



II. Building Groff from sources
    ---------------------------

    1. To build Groff, you will need the following tools:

	  - Standard DJGPP development environment (djdev201.zip)
	  - GNU C compiler (gcc2721b.zip)
	  - GNU C++ compiler (gpp2721b.zip)
	  - GNU Make 3.75 (mak375b.zip)
	  - Bash (bsh1147b.zip)
	  - Fileutils (fil313b.zip)
	  - Textutils (txt122b.zip)
	  - Sh-utils (shl112b.zip)
	  - Sed (sed118b.zip)
	  - Gawk (gwk302b.zip)
	  - Grep (grep20b.zip)

       Note that you don't need to install libg++ (lgp271b.zip) since
       Groff doesn't use any C++ classes except its own.

       Any versions of the utilities later than what's mentioned above
       should also do.

       After you install these tools, make sure you have a ``symlink''
       to bash.exe called sh.exe and a ``symlink'' to gawk.exe called
       awk.exe.  If not, go to the DJGPP bin/ subdirectory and type
       the following words of wisdom from the DOS prompt:

		     ln -s bash.exe sh.exe
		     ln -s gawk.exe awk.exe

       (`ln' is part of GNU Fileutils, see above.)

    2. Unzip the source distribution gro110s.zip preserving the
       directory structure (-d switch to PKUNZIP) from the main DJGPP
       installation directory.  (If you are building Groff on Windows
       9x, use an unzip program which supports long filenames.)  This
       creates directory gnu/groff-1.10 and unzips the sources there.

    3. Groff sources are already configured for the case where DJGPP
       installation is rooted on C:\DJGPP.  If that is OK with you
       (Groff can be told to look for its files in non-standard places
       by setting environment variables, see above), then you can just
       chdir to gnu/groff-1.10 and say "make" to compile the entire
       package.

       If you prefer to configure the package so that it defaults to
       the directory structure on your machine, or if you need to
       change some options (e.g., compile with different optimization
       options), you will have to reconfigure Groff.  To this end, use
       the CONFIG.BAT batch file in the DJGPP subdirectory:

		     djgpp\config

       After the configure script exits, say "make" to build Groff.
       Groff is a large package, and it might take as much as 10-20
       minutes to build, depending on your CPU, so you might as well
       go for a coffee while it grinds away.

    4. Test the package that you have built.  A batch file T-GROFF.BAT
       in the DJGPP subdirectory is supplied for that purpose.  Most
       of the commands there are commented out, since I cannot
       possibly know what kind of printer do you have and which
       additional programs, such as Less, do you have installed.  The
       only command that runs by default will format a large document
       and print it to the screen.  Read the comments in the batch
       file, uncomment additional lines as you see fit and run the
       batch file to see that you get the document printed as you'd
       expect.  (Btw, the document that the batch file prints is an
       introduction to the entire Groff package, so you might as well
       read it to make yourself familiar with the programs.)

       Note that the batch file sets a lot of environment variables;
       if you get ``Out of environment space'' messages, launch a
       subsidiary COMMAND.COM with plenty of environment space, like
       so:

		     command /e:3000

       then invoke T-GROFF.BAT from that COMMAND.COM.

    5. Install the package by typing "make install".  This will copy
       all the binaries, the auxiliary files (fonts, macros, etc.) and
       the docs into their places.  If you configured the package for
       your system, these are precisely the directories where the
       files should remain (with the exception of the man pages, see
       below).  If you use the default configuration, the files will
       be installed under C:\DJGPP, and you will need to move the
       entire tree to where you keep DJGPP on your system.

       "make install" doesn't format the man pages, it just copies
       them into subdirectories of the %DJDIR%\MAN directory.  If you
       need to keep formatted pages in your info/ subdirectory, you
       will need to format them.  Use the command shown above to do
       that, and redirect its output to the info/ subdirectory.
       Alternatively, you could just copy unformatted pages into info/
       and format them when you need to view them.

       Consult the installation instructions for pre-compiled binaries
       above, for more info about installing and using Groff.

    6. You can safely delete the directories under share/groff/font
       whose names begin with "devX": these are needed on X-Windows
       which is not supported by this port.
