                         README for smallutils
                         =====================

Overview
--------

smallutils is a collection of very small utilities.  I made this
distribution primarily because I couldn't find good implementations of
sync(1) and sln(8) -- or *any* implementations of link(8) and unlink(8)
-- for Linux.  I included true(1) and false(1) because most common
implementations, particularly GNU's, are shell scripts, which is sometimes
a security problem, and always inefficient.  The GNU versions also examine
their arguments, which is Too Silly.  Assembler implementations of these
six utilities are included for some platforms, for maximal efficiency.
(I have produced a 48-byte binary version of sync(1) for i386/Linux by
taking some shortcuts in compiling.)

pwd(1) and uname(1) are also included, primarily because (a) they are
small, and (b) I don't like the GNU versions.  Other small utilities
may be added to this package in future versions.

Building and Installing
-----------------------

To build these utilities, you must first run `./configure'.  If you wish
to build in a separate directory from the source, you must have a `make'
that supports the `VPATH' mechanism, such as GNU make.  To initiate such
a build, make an empty directory to build in, and then *in that directory*
run `/path/to/smallutils/configure'.

The `configure' script takes some options.  Use the option `--prefix'
to determine where the utilities will be installed.  For example,
`--prefix=/usr'.  The default is /usr/local.  Finer control over
the installation is possible with the `--bindir', `--sbindir' and
`--mandir' options.  For example, `--prefix= --mandir=/usr/man' would
put the executables in /bin and /sbin, and the man pages in /usr/man/man*.

You can specify the compiler to use, flags, and so on, by exporting
the usual variables to configure in its environment.  For example,
`CFLAGS=-O ./configure' will cause the optimisation flag `-O' to be
passed to the compiler, instead of the default of `-O3'.  If you wish to
use a different compiler than the normal one to assemble the assembler
versions of the programs, that can be specified by setting ASMCC in the
environment.  For example, `ASMCC="gcc -b i386-linuxaout" ./configure'
on a Linux system will cause the assembler programs to be built in a.out
form instead of ELF, which makes them smaller.

If you prefer the GNU implementations of some of these
utilities, in the sh-utils and fileutils packages, you can use
the configure options `--disable-clash-with-gnu-sh-utils' and
`--disable-clash-with-gnu-fileutils'.  The first will inhibit building
of false, pwd, true and uname.  The second will inhibit building of sync.
You will almost certainly prefer the smallutils versions if an assembler
version for your system is included.

After running configure, you can build the utilities by typing `make'.
For each utility, if an appropriate assembler version is available,
it will be used in preference to the generic C version.

To install the utilities and their manual pages, type `make install'.
These utilities should really be in /bin and /sbin if they are to
be the primary implementations on the system.  sln, link and unlink,
to be as useful as intended, really need to be on the root partition,
so if they are installed anywhere other than /sbin or /etc make will
suggest that you manually install them there too.

Static Linking
--------------

link, sln, sync and unlink *must* be statically linked in order to be as
useful as intended.  As the package is at the moment, on platforms where
assembler versions of the utilities are not available, the programs will
be linked dynamically.  If this happens, you can specify a link option
at configure time (e.g., `LDFLAGS=-static ./configure').  Alternatively,
you can modify Generic/Makefile to add the appropriate linker option
for only those utilities that really require it.

Bug Reporting
-------------

If you find a bug, or, more likely, need to modify the configuration to
get these programs to compile on your system, please report the details
to the author (see below).  Be sure to include any error messages from
the compiler.

Author
------

smallutils has been written entirely by Andrew Main <zefram@fysh.org>.
No doubt several of the source files in this package are similar, if
not identical, to other implementations of the same programs, but this
is due solely to the nature of the programs.

Copyright and Disclaimer
------------------------

Copyright (c) 1996 Andrew Main.  All rights reserved.

Redistribution and use, in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer
   in the documentation and/or other materials provided with the
   distribution.
3. All advertising materials mentioning features or use of this
   software must display the following acknowledgement:
       This product includes software developed by Andrew Main.
4. The name of Andrew Main may not be used to endorse or promote
   products derived from this software without specific prior
   written permission.

THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL ANDREW MAIN BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
