This is a port of GNU Textutils 2.0 to DJGPP.  (Since Textutils now
support DJGPP in the official GNU distribution, the ``port'' isn't
much more than a simple build of the official source distribution.)

Installation of the binary distribution
=======================================

Just unzip the binary distribution from the top DJGPP installation
directory, preserving the directory structure (use -d switch if you do
this with PKUNZIP).  If you aren't familiar with the package, read the
info docs (type "info text" at the DOS prompt).  If you run the
programs from plain DOS (no Windows), you will need to install a DPMI
host.  A free DPMI host is available as csdpmi4b.zip from the peer
directory ../v2misc at the same place you got this port of Textutils.


The rest of this file are instructions to build GNU Textutils for
MS-DOS and MS-Windows using DJGPP tools.  See "Notes" near the end for
some additional inside information.


Required tools
==============

To build the package, you will need the DJGPP development environment
(GCC, header files and the libraries) and DJGPP ports of the following
tools:

	- GNU Make 3.75 or later
	- Bash (or some other Unix-like shell)
	- GNU Sed
	- GNU Fileutils
	- GNU Textutils
	- GNU Sh-utils
	- Groff (only if you need to format the man pages)
	- GNU Grep (only if you need to run DJGPP\CONFIG.BAT)
	- GNU Diffutils (only if you run the test suite)
	- Perl (only if you need to change the test scripts)

These should be available from the DJGPP sites.  There are a few more
programs (such as `utod') invoked during the build process, but they
are all part of a standard DJGPP installation and should be already
installed on your system.

The package should be built with the port of Make 3.75 or later.
Previous versions of Make ported to DJGPP didn't support Unix shells,
and the Makefiles for this package won't work without a Unix shell.


Unpacking the sources
=====================

If you download the source distribution from one of the DJGPP
archives, just unzip it preserving the directory structure (use -d
switch if you do that with PKUNZIP).  You are now ready to build the
programs; see the section "How to build" below.

Source distributions downloaded from one of the GNU FTP sites need
some more work to unpack.  First, you MUST use the `djtar' program to
unzip the package.  That's because some file names in the official
distributions need to be changed to avoid problems on the various
platforms supported by DJGPP.  `djtar' can rename files on the fly
given a file with name mappings.  The distribution includes a file
`djgpp/fnchange.lst' with the necessary mappings.  So you need first
to retrieve that file, and then invoke `djtar' to unpack the
distribution.  Here's how:


  djtar -x -p -o textutils-2.0/djgpp/fnchange.lst textutils-2.0.tar.gz > lst
  djtar -x -n lst textutils-2.0.tar.gz

(The name of the distribution archive and the top-level directory will
be different for versions other than 2.0.)



How to build
============


The source distribution available from DJGPP archives is already
configured for DJGPP v2.x, so if you only want to compile it, just
invoke Make:

		make

To build a package downloaded from a GNU FTP site, you will need o
configure it first.  You will also need to configure it if you want to
change the configuration options (e.g., use Rx instead of Regex, or
add the National Language Support).  To configure Textutils, use the
CONFIG.BAT batch file in the DJGPP subdirectory.  It sets a few
environment variables, then calls BASH to run the configure script, so
you should run CONFIG.BAT, then Make:

		djgpp\config
		make

If you are building from a directory other than that where the sources
were unpacked, give the source directory as an argument o COMNFIG.BAT:

	f:\gnu\textutils-2.0\djgpp\config f:/gnu/textutils-2.0

Note that you MUST use forward slashes in the argument to CONFIG.BAT.

The configure script run by CONFIG.BAT supports a few options (e.g.,
you could build the package with the GNU Rx library instead of the
default Regex).  Run "sh ./configure --help" to see all the options
recognized by the script.

When Make finishes, you can install the package:

		make install

If you make a change in some of the programs, it is a good idea to run
the test suite, so you know you didn't break anything:

		make check

This will run for a while and should print PASSED for every program it
tests.  Note that the test suite needs 7 recursive invocations of
DJGPP programs at some points (5 recursive Make's and Bash + the
tested program on top of that), so some DPMI hosts, notably QDPMI,
might run out of free conventional memory.  CWSDPMI and Windows are
two DPMI hosts that should have no problems with running "make check".

Note that "make check" will ONLY run from the same directory where
Textutils sources are unpacked.  To run it from another directory, you
will need to copy the entire `tests' subdirectory to the other place.


Notes
=====

The absolute majority of the DOS-specific changes for this package
take care of the text/binary file I/O issue.  Most (but not all) of
the ported programs do their I/O in binary mode, unless the input or
output is connected to the terminal device.  This ensures that
Unix-style text files (which don't have a CR character at the end of
each line) don't change while being processed by the utilities of this
package.  The only programs that do all I/O in text mode are those
which don't make sense in conjunction with binary files, like `sort'
and `pr'.  Some programs need to change their I/O mode when certain
options are given on the command line; for details, see the Info docs.

The GNU Gettext package is not supported yet in the DJGPP version, so
don't expect the programs to talk to you in any language but English.

		Enjoy,
				Eli Zaretskii <eliz@is.elta.co.il>
