vendor/awk: upgrade from 20121220 to 20200612
[dragonfly.git] / contrib / awk / README.md
1 # The One True Awk
2
3 This is the version of `awk` described in _The AWK Programming Language_,
4 by Al Aho, Brian Kernighan, and Peter Weinberger
5 (Addison-Wesley, 1988, ISBN 0-201-07981-X).
6
7 ## Copyright
8
9 Copyright (C) Lucent Technologies 1997<br/>
10 All Rights Reserved
11
12 Permission to use, copy, modify, and distribute this software and
13 its documentation for any purpose and without fee is hereby
14 granted, provided that the above copyright notice appear in all
15 copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name Lucent Technologies or any of
18 its entities not be used in advertising or publicity pertaining
19 to distribution of the software without specific, written prior
20 permission.
21
22 LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
23 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
24 IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
25 SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
26 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
27 IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
28 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
29 THIS SOFTWARE.
30
31 ## Distribution and Reporting Problems
32
33 Changes, mostly bug fixes and occasional enhancements, are listed
34 in `FIXES`.  If you distribute this code further, please please please
35 distribute `FIXES` with it.
36
37 If you find errors, please report them
38 to bwk@cs.princeton.edu.
39 Please _also_ open an issue in the GitHub issue tracker, to make
40 it easy to track issues.
41 Thanks.
42
43 ## Submitting Pull Requests
44
45 Pull requests are welcome. Some guidelines:
46
47 * Please do not use functions or facilities that are not standard (e.g.,
48 `strlcpy()`, `fpurge()`).
49
50 * Please run the test suite and make sure that your changes pass before
51 posting the pull request. To do so:
52
53   1. Save the previous version of `awk` somewhere in your path. Call it `nawk` (for example).
54   1. Run `oldawk=nawk make check > check.out 2>&1`.
55   1. Search for `BAD` or `error` in the result. In general, look over it manually to make sure there are no errors.
56
57 * Please create the pull request with a request
58 to merge into the `staging` branch instead of into the `master` branch.
59 This allows us to do testing, and to make any additional edits or changes
60 after the merge but before merging to `master`.
61
62 ## Building
63
64 The program itself is created by
65
66         make
67
68 which should produce a sequence of messages roughly like this:
69
70         yacc -d awkgram.y
71         conflicts: 43 shift/reduce, 85 reduce/reduce
72         mv y.tab.c ytab.c
73         mv y.tab.h ytab.h
74         cc -c ytab.c
75         cc -c b.c
76         cc -c main.c
77         cc -c parse.c
78         cc maketab.c -o maketab
79         ./maketab >proctab.c
80         cc -c proctab.c
81         cc -c tran.c
82         cc -c lib.c
83         cc -c run.c
84         cc -c lex.c
85         cc ytab.o b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o -lm
86
87 This produces an executable `a.out`; you will eventually want to
88 move this to some place like `/usr/bin/awk`.
89
90 If your system does not have `yacc` or `bison` (the GNU
91 equivalent), you need to install one of them first.
92
93 NOTE: This version uses ANSI C (C 99), as you should also.  We have
94 compiled this without any changes using `gcc -Wall` and/or local C
95 compilers on a variety of systems, but new systems or compilers
96 may raise some new complaint; reports of difficulties are
97 welcome.
98
99 This compiles without change on Macintosh OS X using `gcc` and
100 the standard developer tools.
101
102 The version of `malloc` that comes with some systems is sometimes
103 astonishly slow.  If `awk` seems slow, you might try fixing that.
104 More generally, turning on optimization can significantly improve
105 `awk`'s speed, perhaps by 1/3 for highest levels.
106
107 #### Last Updated
108 Wed Jan  1 22:44:38 IST 2020