4
There's a DCL command procedure that will issue all the necessary
5
CC and LINK commands, and there's also a Makefile for use with the MMS
6
utility. From the source directory, use either
9
|$ MMS/DECRIPTION=[.VMS]DECSRIP.MMS GAWK
11
VAX C V3.x -- use either vmsbuild.com or descrip.mms as is. These use
12
CC/OPTIMIZE=NOLINE, which is essential for version 3.0.
13
VAX C V2.x -- (version 2.3 or 2.4; older ones won't work); edit either
14
vmsbuild.com or descrip.mms according to the comments in them.
15
For vmsbuild.com, this just entails removing two '!' delimiters.
16
Also edit config.h (which is a copy of file [.config]vms-conf.h)
17
and comment out or delete the two lines ``#define __STDC__ 0''
18
and ``#define VAXC_BUILTINS'' near the end.
19
GNU C -- edit vmsbuild.com or descrip.mms; the changes are different
20
from those for VAX C V2.x, but equally straightforward. No
21
changes to config.h should be needed.
22
DEC C -- edit vmsbuild.com or descrip.mms according to their comments.
24
Tested under VAX/VMS V5.5-2 using VAX C V3.2, GNU C 1.42 and 2.5.0.
25
Should work without modifications for VMS V4.6 and up.
28
Installing GAWK on VMS:
30
All that's needed is a 'foreign' command, which is a DCL symbol
31
whose value begins with a dollar sign.
32
|$ GAWK :== $device:[directory]GAWK
33
(Substitute the actual location of gawk.exe for 'device:[directory]'.)
34
That symbol should be placed in the user's login.com or in the system-
35
wide sylogin.com procedure so that it will be defined every time the
38
Optionally, the help entry can be loaded into a VMS help library.
39
|$ LIBRARY/HELP SYS$HELP:HELPLIB [.VMS]GAWK.HLP
40
(You may want to substitute a site-specific help library rather than
41
the standard VMS library 'HELPLIB'.) After loading the help text,
43
will provide information about both the gawk implementation and the
44
awk programming language.
46
The logical name AWK_LIBRARY can designate a default location
47
for awk program files. For the '-f' option, if the specified filename
48
has no device or directory path information in it, Gawk will look in
49
the current directory first, then in the directory specified by the
50
translation of AWK_LIBRARY if it the file wasn't found. If the file
51
still isn't found, then ".awk" will be appended and the file access
52
will be re-tried. If AWK_LIBRARY is not defined, that portion of the
53
file search will fail benignly.
58
Command line parsing and quoting conventions are significantly
59
different on VMS, so examples in _The_GAWK_Manual_ or the awk book
60
often need minor changes. They *are* minor though, and all the awk
61
programs should run correctly.
63
Here are a couple of trivial tests:
64
|$ gawk -- "BEGIN {print ""Hello, World!""}"
65
|$ gawk -"W" version !could also be -"W version" or "-W version"
66
Note that upper- and mixed-case text must be quoted.
68
The VMS port of Gawk includes a DCL-style interface in addition
69
to the original shell-style interface. See the help entry for details.
70
One side-effect of dual command line parsing is that if there's only a
71
single parameter (as in the quoted string program above), the command
72
becomes ambiguous. To work-around this, the normally optional "--"
73
flag is required to force shell rather than DCL parsing. If any other
74
dash-type options (or multiple parameters such as data files to be
75
processed) are present, there is no ambiguity and "--" can be omitted.
77
The logical name AWKPATH can be used to override the default
78
search path of "SYS$DISK:[],AWK_LIBRARY:" when looking for awk program
79
files specified by the '-f' option. The format of AWKPATH is a comma-
80
separated list of directory specifications. When defining it, the
81
value should be quoted so that it retains a single translation, not a
82
multi-translation RMS searchlist.
85
Building and using GAWK under VMS POSIX:
87
Ignore the instructions above, although vms/gawk.hlp should still
88
be made available in a help library. Make sure that the two scripts,
89
'configure' and 'mungeconf', are executable; use `chmod +x' on them if
90
necessary. Then execute the following two commands:
91
|psx> configure vms-posix
92
|psx> make PARSER=yacc awktab.c gawk
93
The first command will construct files "config.h" and "Makefile" out of
94
templates. The second command will compile and link 'gawk'. Due to
95
a 'make' bug in VMS POSIX 1.0 and V1.1, the file "awktab.c" must be
96
given as an explicit target or it will not be built and the final link
97
step will fail. Ignore the warning "Could not find lib m in lib list";
98
it is harmless, caused by the Makefile's explicit use of -lm as a linker
99
option which is not needed under VMS POSIX. Under V1.1 (but not V1.0)
100
a problem with the yacc skeleton /etc/yyparse.c will cause a compiler
101
warning for awktab.c, followed by a linker warning about compilation
102
warnings in the resulting object module. These warnings can be ignored.
104
Another 'make' bug interferes with exercising various components
105
of the test suite, but all the actual tests should execute correctly.
106
(The main exception being book/wordfreq, which gives different results
107
due to VMS POSIX 'sort' rather than to 'gawk'.)