ftp.nice.ch/pub/next/unix/text/rtf.N.bsd.tar.gz#/rtf-utilities/tools/gawk-2.14

ACKNOWLEDGMENT
 
COPYING
 
FUTURES
 
LIMITATIONS
 
Makefile
 
Makefile.bsd44alpha
 
Makefile.in
 
NEWS
 
PORTS
 
POSIX
 
PROBLEMS
 
README
 
README.VMS
 
README.atari
 
README.dos
 
README.linux
 
README.rs6000
 
README.sun386i
 
README.ultrix
 
alloca.c
[View alloca.c] 
alloca.s
 
array.c
[View array.c] 
atari/
 
awk.h
[View awk.h] 
awk.y
 
awktab.c
[View awktab.c] 
builtin.c
[View builtin.c] 
config/
 
config.h
[View config.h] 
config.in
 
configure
 
dfa.c
[View dfa.c] 
dfa.h
[View dfa.h] 
eval.c
[View eval.c] 
field.c
[View field.c] 
gawk.1
 
gawk.texi
 
getopt.c
[View getopt.c] 
getopt.h
[View getopt.h] 
io.c
[View io.c] 
iop.c
[View iop.c] 
main.c
[View main.c] 
missing/
 
missing.c
[View missing.c] 
msg.c
[View msg.c] 
mungeconf
 
node.c
[View node.c] 
patchlevel.h
[View patchlevel.h] 
pc/
 
protos.h
[View protos.h] 
re.c
[View re.c] 
regex.c
[View regex.c] 
regex.h
[View regex.h] 
support/
 
tags
 
test/
 
version.c
[View version.c] 
vms/
 

README

README:

This is GNU Awk 2.14. It should be upwardly compatible with the
System V Release 4 awk.  It is almost completely compliant with draft 11.3
of POSIX 1003.2.

This release is essentially a bug fix release.

See the installation instructions, below.

Known problems are given in the PROBLEMS file.  Work to be done is
described briefly in the FUTURES file.  Verified ports are listed in
the PORTS file.  Changes in this version are summarized in the CHANGES file.
Please read the LIMITATIONS and ACKNOWLEDGMENT files.

Read the file POSIX for a discussion of how the standard says comparisons
should be done vs. how they really should be done and how gawk does them.
  
To format the documentation with TeX, you must use texinfo.tex 2.53
or later.  Otherwise footnotes look unacceptable.

If you wish to remake the Info files, you should use makeinfo. The 2.15 
version of makeinfo works with no errors.

The man page is up to date.

INSTALLATION:

Check whether there is a system-specific README file for your system.

Makefile.in may need some tailoring.  The only changes necessary should
be to change installation targets or to change compiler flags.
The changes to make in Makefile.in are commented and should be obvious.

All other changes should be made in a config file.  Samples for
various systems are included in the config directory.  Starting with
2.11, our intent has been to make the code conform to standards (ANSI,
POSIX, SVID, in that order) whenever possible, and to not penalize
standard conforming systems.  We have included substitute versions of
routines not universally available.  Simply add the appropriate define
for the missing feature(s) on your system.

If you have neither bison nor yacc, use the awktab.c file here.  It was
generated with bison, and should have no AT&T code in it.  (Note that
modifying awk.y without bison or yacc will be difficult, at best.  You might
want to get a copy of bison from the FSF too.)

If no config file is included for your system,  start by copying one
for a similar system.  One way of determining the defines needed is to
try to load gawk with nothing defined and see what routines are
unresolved by the loader.  This should give you a good idea of how to
proceed.

The next release will use the FSF autoconfig program, so we are no longer 
soliciting new config files.

If you have an MS-DOS system, use the stuff in the pc directory.
For an Atari there is an atari directory and similarly one for VMS.

Chapter 16 of The GAWK Manual discusses configuration in detail.

After successful compilation, do 'make test' to run a small test
suite.  There should be no output from the 'cmp' invocations except in
the cases where there are small differences in floating point values.
If there are other differences, please investigate and report the
problem.  More extensive testing can be invoked with 'make bigtest'.

PRINTING THE MANUAL

The 'support' directory contains texinfo.tex 2.65, which will be necessary
for printing the manual, and the texindex.c program from the texinfo
distribution which is also necessary.  See the makefile for the steps needed
to get a DVI file from the manual.

CAVEATS

The existence of a patchlevel.h file does *N*O*T* imply a commitment on
our part to issue bug fixes or patches.  It is there in case we should
decide to do so.

BUG REPORTS AND FIXES (Un*x systems):

Please coordinate changes through David Trueman and/or Arnold Robbins.

David Trueman
Department of Mathematics, Statistics and Computing Science,
Dalhousie University, Halifax, Nova Scotia, Canada

UUCP:		{uunet utai watmath}!dalcs!david
INTERNET:	david@cs.dal.ca

Arnold Robbins
1736 Reindeer Drive
Atlanta, GA, 30329, USA

INTERNET:	arnold@skeeve.atl.ga.us
UUCP:		{ gatech, emory, emoryu1 }!skeeve!arnold

BUG REPORTS AND FIXES (non-Unix ports):

MS-DOS:
	Scott Deifik
	AMGEN Inc.
	Amgen Center, Bldg.17-Dept.393
	Thousand Oaks, CA  91320-1789
	Tel-805-499-5725  ext.4677
	Fax-805-498-0358
	scottd@amgen.com

VMS:
	Pat Rankin
	rankin@eql.caltech.edu (e-mail only)

Atari ST:
	Michal Jaegermann
	NTOMCZAK@vm.ucs.UAlberta.CA  (e-mail only)

README.VMS

Compiling GAWK on VMS:

     There's a DCL command procedure that will issue all the necessary
CC and LINK commands, and there's also a Makefile for use with the MMS
utility.  From the source directory, use either
 |$ @[.VMS]VMSBUILD.COM
or
 |$ MMS/DECRIPTION=[.VMS]DECSRIP.MMS GAWK

VAX C V3.x  -- use either vmsbuild.com or descrip.mms as is.  These use
        CC/OPTIMIZE=NOLINE, which is essential for version 3.0.
VAX C V2.x  -- (version 2.3 or 2.4; older ones won't work); edit either
        vmsbuild.com or descrip.mms according to the comments in them.
        For vmsbuild.com, this just entails removing two '!' delimiters.
        Also edit config.h (which is a copy of file [.config]vms-conf.h)
        and comment out or delete the two lines ``#define __STDC__ 0''
        and ``#define VAXC_BUILTINS'' near the end.
GNU C  -- edit vmsbuild.com or descrip.mms; the changes are different
        from those for VAX C V2.x, but equally straightforward.  No
        changes to config.h should be needed.
DEC C  -- edit vmsbuild.com or descrip.mms according to their comments.

     Tested under VAX/VMS V5.5-1 using VAX C V3.2, GNU C 1.40 and 2.3.
Should work without modifications for VMS V4.6 and up.


Installing GAWK on VMS:

     All that's needed is a 'foreign' command, which is a DCL symbol
whose value begins with a dollar sign.
 |$ GAWK :== $device:[directory]GAWK
(Substitute the actual location of gawk.exe for 'device:[directory]'.)
That symbol should be placed in the user's login.com or in the system-
wide sylogin.com procedure so that it will be defined every time the
user logs on.

     Optionally, the help entry can be loaded into a VMS help library.
 |$ LIBRARY/HELP SYS$HELP:HELPLIB [.VMS]GAWK.HLP
(You may want to substitute a site-specific help library rather than
the standard VMS library 'HELPLIB'.)  After loading the help text,
 |$ HELP GAWK
will provide information about both the gawk implementation and the
awk programming language.

     The logical name AWK_LIBRARY can designate a default location
for awk program files.  For the '-f' option, if the specified filename
has no device or directory path information in it, Gawk will look in
the current directory first, then in the directory specified by the
translation of AWK_LIBRARY if it the file wasn't found.  If the file
still isn't found, then ".awk" will be appended and the file access
will be re-tried.  If AWK_LIBRARY is not defined, that portion of the
file search will fail benignly.


Running GAWK on VMS:

     Command line parsing and quoting conventions are significantly
different on VMS, so examples in _The_GAWK_Manual_ or the awk book
often need minor changes.  They *are* minor though, and all the awk
programs should run correctly.

     Here are a couple of trivial tests:
 |$ gawk -- "BEGIN {print ""Hello, World!""}"
 |$ gawk -"W" version     !could also be -"W version" or "-W version"
Note that upper- and mixed-case text must be quoted.

     The VMS port of Gawk includes a DCL-style interface in addition
to the original shell-style interface.  See the help entry for details.
One side-effect of dual command line parsing is that if there's only a
single parameter (as in the quoted string program above), the command
becomes ambiguous.  To work-around this, the normally optional "--"
flag is required to force shell rather than DCL parsing.  If any other
dash-type options (or multiple parameters such as data files to be
processed) are present, there is no ambiguity and "--" can be omitted.

     The logical name AWKPATH can be used to override the default
search path of "SYS$DISK:[],AWK_LIBRARY:" when looking for awk program
files specified by the '-f' option.  The format of AWKPATH is a comma-
separated list of directory specifications.  When defining it, the
value should be quoted so that it retains a single translation, not a
multi-translation RMS searchlist.


Building and using GAWK under VMS POSIX:

     Ignore the instructions above, although vms/gawk.hlp should still
be made available in a help library.  Make sure that the two scripts,
'configure' and 'mungeconf', are executable; use `chmod +x' on them if
necessary.  Then execute the following two commands:
 |psx> configure vms-posix
 |psx> make awktab.c gawk
The first command will construct files "config.h" and "Makefile" out of
templates.  The second command will compile and link 'gawk'.  Due to
a 'make' bug in VMS POSIX 1.0 and V1.1, the file "awktab.c" must be
given as an explicit target or it will not be built and the final link
step will fail.  Ignore the warning "Could not find lib m in lib list";
it is harmless, caused by the Makefile's explicit use of -lm as a linker
option which is not needed under VMS POSIX.  Under V1.1 (but not V1.0)
a problem with the yacc skeleton /etc/yyparse.c will cause a compiler
warning for awktab.c, followed by a linker warning about compilation
warnings in the resulting object module.  These warnings can be ignored.

     Another 'make' bug interferes with exercising various components
of the test suite, but all the actual tests should execute correctly.
(The main exception being book/wordfreq, which gives different results
due to VMS POSIX 'sort' rather than to 'gawk'.)

README.atari

Gawk on Atari has been compiled and tested using gcc compiler
(versions 1.4 and 2.2.2) both with and without -mshort flag.  Other
compilers can be used but if sizeof(pointer) != sizeof(int) this
code will not compile correctly with non-ANSI compiler (prototypes
and library).

Compiled executables were tested and with minor modifications, due
to differences in environment and/or shell, succesfully completed
at least the following tests:
awf, pearls, resub, chem, swaplns, delete, messages, argarray,
longwrds, getline, inftest, spiece2top, fstabplus, compare, arrayref,
rs, fsrs, rand, fsbs, negexp, ugh2, asgext, anchgsub, splitargv,
fieldwidths, ignorecase, posix, manyfiles, igncfs, lisp, regtest,
awkpath, reparse, nfset.

Nearly all of these test do not require any adjustments to run, but a
modified test suite with a driving Makefile (for gulam) is available
on a request from Michal Jaegermann, ntomczak@vm.ucs.ualberta.ca,
via e-mail.

TOS and MiNT
-----------
Setup for Atari assumes that gawk will be used under TOS.  In
particular atari/system.c source is for a system function which nicely
cooperates with gulam shell and pipes are simulated with temporary
files.  If you plan to run gawk under MiNT then you likely want a
different system function and real pipes.  For that purpose do not
define SYSTEM_MISSING in a configuration file and do not define
PIPES_SIMULATED in io.c file.  Please note that in the later case gawk
calls, in gawk_popen(), a function execl() with a hard-coded name of
"/bin/sh".  You want likely to change that to get a name and some
arguments from an environment variable.  This was not done here in
order to avoid changes which may prove troublesome in a general
distribution.  Subdirectory ./atari contains also a file textrd.c with
a bug fix for old versions of gcc libraries.  This bug is currently
fixed and the file is not used, but it is left as a convenience for
those who may not updated yet their libraries.

README.dos

Gawk has been compiled and (very) minimally tested under MS-DOS using
MSC 5.1.  To compile under DOS, move the stuff in the pc directory to
the directory with the rest of the gawk sources, and run make.bat.
The Makefile.pc file is obsolete and should probably go away.

You will have to put CRs at the end of each line in make.bat.

You will have to copy the Microsoft library routine setargv.obj to
the gawk directory for the link to work

README.linux

A proper config file was not submitted for linux, so just copy
config/linux.h to config.h and make the small changes noted in
the comment at the top of that file.

README.rs6000

Date:	Fri, 26 Apr 1991 18:01:04 -0300
From:	mjlx@eagle.cnsf.cornell.edu (Mike Lijewski)
To:	arnold@audiofax.com
Cc:	david@cs.dal.ca
Subject: testing 2.12 on a machine with unsigned chars

I chose to use the alloca which you supply.  The RS/6000 has a builtin
alloca which is accessible using a `#pragma alloca', but I chose not
to use it.  Initially, I tried to use it by conditionally compiling it,
similar to the way alloca.h is included on sparcs.  But this has
some problems.  Firstly, the RS/6000 compiler complains about the
placement of the #pragma, something to the intent that the pragma must
precede all C code.  This would be easy enough to fix by conditionally
including the #pragma elsewhere in the relevant files.  A more
difficult problem is that the awk.tab.c generated by bison uses
alloca.  To fix this the right way, bison would have to be modified to
output the appropriate conditionally compilable code as it does now
for sparcs.  If you think it is worth while to use the builtin alloca,
I would be happy to get it working, except for the bison problem, and
send you the diffs.  The FSF might also be interested in "fixing"
bison to use the builtin alloca on the RS/6000.

README.sun386i

Date:	Mon, 16 Mar 1992 14:49:10 -0400
From:	<beebe@math.utah.edu>
To:	david@cs.dal.ca, arnold@skeeve.atl.ga.us

...

On the Sun 386i, floating-point numbers are printed without a leading
zero digit.  This causes the cmp step to fail for the chem target.  I
revised the Makefile, and at the same time, inserted an RM macro in
place of the many rm calls.  The complete updated Makefile is appended
below. This change should be applied to all systems to avoid the
leading-zero problem in the future.

On the Sun 386i, my initial "make sunos40" resulted in a load failure
with

>> Undefined:
>> strncasecmp
>> strftime

I therefore modified the Makefile to read

OPTIMIZE=	-g -O -fstrength-reduce -DSTRFTIME_MISSING -DSTRCASE_MISSING

and loading got further, but still failed:

>> tzset: ld: /lib/libc.a(localtime.o): multiply defined
>> *** Error code 1
>> make: Fatal error: Command failed for target `gawk'
>> Current working directory /home/share/gnu/src/gawk-2.13
>> *** Error code 1
>> make: Fatal error: Command failed for target `test'

Investigation with nm showed that localtime() is only referenced by
builtin.o, so I simply did

	chmod +x gawk
	make test bigtest

and was able to complete the test after the leading-zero digit fix
was applied to the Makefile.

The Sun 386i is not receiving further development by Sun, and SunOS
4.0.3 is the last O/S release for it, so perhaps you don't want to do
anything other than note the problem in the README file.

README.ultrix

When compiling on DECstation running Ultrix 4.0 a command 'cc -c -O
regex.c' is causing an infinite loop in an optimizer.  Other sources
compile fine with -O flag.  If you are going to use this flag either
add a special rule to Makefile for a compilation of regex.c, or issue
'cc -c regex.c' before hitting 'make'.

From:	Steve Simmons <scs@wotan.iti.org>
Subject: Non-bug report on gawk 2.13.2
To:	david@cs.dal.ca, arnold@skeeve.atl.ga.us
Date:	Thu, 25 Jul 1991 13:45:38 -0300

Just fyi -- it passes tests with flying colors under Ultrix 4.2.  The
README.ultrix file applies more than ever.  You might want to add
these paragraphs to it:

 As of Ultrix 4.2 the optimise works for regex.c, but you must give an
 additional switch to get everything optimised.  Using '-Olimit 1500'
 does the job.  Without the switch gawk will compile and run correctly,
 but you will get complaints about lost optimisations in builtin.c,
 awk.tab.c and regex.c.

 The configure for ultrix4.1 works just fine for ultrix4.2

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.