This file explains how to build GNU Sh-utils for MS-DOS and MS-Windows
using DJGPP tools.


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
	- A previous version of GNU Sh-utils
	- GNU Grep
	- To run the test suite you'll also need Perl and Awk.

These should be available from the DJGPP sites (see the FAQ for
Simtelnet mirrors).

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 sh-utils-2.0j/djgpp/fnchange.lst sh-utils-2.0j.tar.gz > lst
  djtar -x -n lst sh-utils-2.0j.tar.gz

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



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

If you obtained the sources from one of the DJGPP archives, there's
nothing much to be done. The Makefiles are ready and you can build the
package in one go by running `make'. Make sure that you have Make 3.75
or later.

If you want to get the DVI, Postscript and HTML documents you need to
do this:

		make dvi
		make sh-utils.ps  (In the doc directory)
		makeinfo --html sh-utils.texi  (In the doc dorectory)

To build the 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 Sh-utils, 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 CONFIG.BAT:

	f:\gnu\sh-utils-2.0j\djgpp\config f:/gnu/sh-utils-2.0j

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 run the test suite and install the package:

		make check
		make install

Notes
=====

The absolute majority of the DOS-specific changes for this package
take care of the filename issues such as backward and forward slashes.

		Enjoy,
				Prashant TR <tr@midpec.com>
