1 | This is the README for GNU awk 3.1 under Windows32, OS/2, and DOS.
|
---|
2 |
|
---|
3 | Gawk has been compiled and tested under OS/2, DOS, and Windows32 using
|
---|
4 | the GNU development tools from DJ Delorie (DJGPP; DOS with special
|
---|
5 | support for long filenames under Win95), Eberhard Mattes (EMX; OS/2,
|
---|
6 | DOS, and Windows32 with rsxnt), and Jan-Jaap van der Heijden and Mumit Khan
|
---|
7 | (Mingw32; Windows32). Microsoft Visual C/C++ can be used to build a Windows32
|
---|
8 | version for Windows 9x/NT, and MSC can be used to build 16-bit versions
|
---|
9 | for DOS and OS/2. (As of 3.1.2, the MSC version doesn't work, but the
|
---|
10 | maintainer for it is working on fixing it.)
|
---|
11 |
|
---|
12 | The cygwin environment (http://www.cygwin.com) may also be used
|
---|
13 | to compile and run gawk under Windows. For cygwin, building and
|
---|
14 | installation is the same as under Unix:
|
---|
15 |
|
---|
16 | tar -xvpzf gawk-3.1.x.tar.gz
|
---|
17 | cd gawk-3.1.x
|
---|
18 | ./configure && make
|
---|
19 |
|
---|
20 | The `configure' step takes a long time, but works otherwise.
|
---|
21 |
|
---|
22 | ******************************** N O T E **********************************
|
---|
23 | * The `|&' operator only works when gawk is compiled for cygwin. Neither *
|
---|
24 | * socket support nor two-way pipes work in any other Windows environment! *
|
---|
25 | ***************************************************************************
|
---|
26 |
|
---|
27 | Building gawk
|
---|
28 | -------------
|
---|
29 |
|
---|
30 | Building on DOS or Windows environments can be troublesome, in part due
|
---|
31 | to shell limitations, the long filename issue, and various Windows32 pipe
|
---|
32 | considerations. The situation is somewhat better on OS/2. The general
|
---|
33 | recommendation is to use tools (especially make) which are compatible
|
---|
34 | or built with the compiler to be used on gawk.
|
---|
35 |
|
---|
36 | Building versions which do not understand long filenames on systems
|
---|
37 | that offer long names is a special case. The maintainers unpack the
|
---|
38 | distribution and process using utilities (unzip, make, cmp) which do not
|
---|
39 | use long filenames. (For example, the djgpp tools will work if LFN=n is
|
---|
40 | set in the environment.)
|
---|
41 |
|
---|
42 | Copy the files in the `pc' directory (EXCEPT for `ChangeLog') to the
|
---|
43 | directory with the rest of the gawk sources. (The subdirectories of
|
---|
44 | `pc' need not be copied.) The makefile contains a configuration
|
---|
45 | section with comments, and may need to be edited in order to work
|
---|
46 | with your make utility.
|
---|
47 |
|
---|
48 | The "prefix" line in the Makefile is used during the install of gawk
|
---|
49 | (and in building igawk.bat and igawk.cmd). Since the libraries for
|
---|
50 | gawk will be installed under $(prefix)/lib/awk (e.g., /gnu/lib/awk),
|
---|
51 | it is convenient to have this directory in DEFPATH of config.h.
|
---|
52 |
|
---|
53 | The makefile contains a number of targets for building various DOS and
|
---|
54 | OS/2 versions. A list of targets will be printed if the make command is
|
---|
55 | given without a target. As an example, to build gawk using the djgpp
|
---|
56 | tools, enter "make djgpp".
|
---|
57 |
|
---|
58 |
|
---|
59 | Testing and installing gawk
|
---|
60 | ---------------------------
|
---|
61 |
|
---|
62 | The command "make test" (and possibly "make install") requires several
|
---|
63 | Unix-like tools, including an sh-like shell, sed, cp, and cmp. Only
|
---|
64 | dmake and GNU make are known to work on "make test".
|
---|
65 |
|
---|
66 | There are two methods for the install: Method 1 uses a typical Unix-like
|
---|
67 | approach and requires cat, cp, mkdir, sed, and sh; method 2 uses gawk
|
---|
68 | and batch files. See the configuration section of the makefile.
|
---|
69 |
|
---|
70 | The file test/Makefile will need some editing (especially for DOS). A
|
---|
71 | sample makefile with comments appears in pc/Makefile.tst, and can be
|
---|
72 | used to modify test/Makefile for your platform. In addition, some
|
---|
73 | files in the test directory may need to have their end-of-line markers
|
---|
74 | converted, as described in Makefile.tst.
|
---|
75 |
|
---|
76 | As with building gawk, the OS, shell, and long filename issues come into
|
---|
77 | play when testing, too. If you are testing gawk on a LFN aware system with
|
---|
78 | some LFN aware tools, you may have problems if the shell that you specify in
|
---|
79 | test/Makefile is not LFN aware. This problem will apply whether or not
|
---|
80 | you are building a LFN aware gawk. See the comments in pc/Makefile.tst
|
---|
81 | for more information on this.
|
---|
82 |
|
---|
83 | It is routine to install by hand, but note that the install target also
|
---|
84 | builds igawk.bat and igawk.cmd, which are used to add an include
|
---|
85 | facility to gawk (and which require sh).
|
---|
86 |
|
---|
87 |
|
---|
88 | Notes
|
---|
89 | -----
|
---|
90 |
|
---|
91 | 1. Collections containing gawk and various utilities for OS/2 or DOS
|
---|
92 | include the GNUish Project, Rommel's OS/2 collection at LEO, and the
|
---|
93 | djgpp collection.
|
---|
94 |
|
---|
95 | The GNUish Project was designed to bring GNU-like programs to small
|
---|
96 | systems running OS/2 and DOS. Binary distributions of gawk are
|
---|
97 | maintained in GNUish, and include 16bit OS/2 and DOS, 32bit djgpp,
|
---|
98 | and Windows32 versions. Information on GNUish is available via
|
---|
99 |
|
---|
100 | http://www.simtel.net/simtel.net/
|
---|
101 | or
|
---|
102 | ftp://ftp.simtel.net/simtelnet/gnu/gnuish
|
---|
103 |
|
---|
104 | Documentation appears in gnuish.htm (html) or gnuish.inf (info).
|
---|
105 |
|
---|
106 | Kai Uwe Rommel <rommel@leo.org> maintains a (mostly OS/2) collection at
|
---|
107 |
|
---|
108 | http://www.leo.org/archiv/os2 or ftp://ftp.leo.org
|
---|
109 |
|
---|
110 | It contains emx-compiled (32bit) versions of gawk for OS/2, DOS, and Windows32,
|
---|
111 | along with many OS/2 utilities.
|
---|
112 |
|
---|
113 | The djgpp collection at
|
---|
114 |
|
---|
115 | ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/
|
---|
116 |
|
---|
117 | contains a djgpp-compiled (32bit) version of gawk, along with many
|
---|
118 | djgpp-compiled utilities.
|
---|
119 |
|
---|
120 | The Mingw32 collection at http://www.mingw.org contains links to ported
|
---|
121 | software. The site by Jan-Jaap van der Heijden
|
---|
122 |
|
---|
123 | http://agnes.dida.physik.uni-essen.de/~janjaap/
|
---|
124 |
|
---|
125 | is apparently no longer maintained, but it was accessible as of Jan 2001
|
---|
126 | and may contain files of interest.
|
---|
127 |
|
---|
128 |
|
---|
129 | 2. The following table illustrates some of the differences among the various
|
---|
130 | compiled versions of gawk. For example, the djgpp version runs on all the
|
---|
131 | systems, but with differing capabilities: it supports long filenames under
|
---|
132 | Win-9x but not under NT, and it runs as a DPMI application under OS/2 (which
|
---|
133 | translates into "works in the DOS-box under OS/2, but not as a true OS/2
|
---|
134 | application").
|
---|
135 |
|
---|
136 | DOS Win/WfW Win9x NT OS/2
|
---|
137 | -------------------------------------------------------
|
---|
138 | djgpp | DPMI DPMI DPMI DPMI,NoLFN DPMI
|
---|
139 | emx(1) | N N N N OS2
|
---|
140 | emxbnd(2) | VCPI,DPMI DPMI DPMI,NoLFN DPMI,NoLFN DPMI,OS2
|
---|
141 | emxnt(3) | N N Windows32 Windows32 N
|
---|
142 | msc(4) | 16 16 16,NoLFN 16,NoLFN 16,DOS
|
---|
143 | msc6bnd | 16 16 16,NoLFN 16,NoLFN 16,DOS,OS2
|
---|
144 | msc6os2 | N N N N 16,OS2
|
---|
145 | vcWin32 | N N Windows32 Windows32 N
|
---|
146 | mingw32 | N N Windows32 Windows32 N
|
---|
147 |
|
---|
148 | (1) Requires emxrt.
|
---|
149 |
|
---|
150 | (2) May run as a DPMI app in plain DOS and in a DOS-shell under OS/2
|
---|
151 | or Windows, and as a true OS/2 application under OS/2. DPMI
|
---|
152 | requires rsxnt, and VCPI or use as an OS/2 app requires emxrt.
|
---|
153 |
|
---|
154 | (3) Requires rsxnt.
|
---|
155 |
|
---|
156 | (4) When compiling, MSC 8, when run in Windows 9x, will require that if
|
---|
157 | files are listed in #include statements with LFNs
|
---|
158 | (eg. <patchlevel.h>), that the file be named with the LFN.
|
---|
159 |
|
---|
160 | 16 16bit; limited capacity, especially under DOS.
|
---|
161 |
|
---|
162 | DOS Runs as a DOS application.
|
---|
163 |
|
---|
164 | DPMI Dos Protected Mode Interface; program runs as a DOS application.
|
---|
165 | Under plain DOS, a DPMI server (such as csdpmi from the djgpp
|
---|
166 | archives) is required. See also VCPI.
|
---|
167 |
|
---|
168 | emxrt The emx runtime, available from LEO.
|
---|
169 |
|
---|
170 | N Not supported.
|
---|
171 |
|
---|
172 | NoLFN No long filename support.
|
---|
173 |
|
---|
174 | OS2 Runs as an OS/2 application.
|
---|
175 |
|
---|
176 | rsxnt Runtimes for use with DPMI or Windows32.
|
---|
177 |
|
---|
178 | VCPI Virtual Control Program Interface; program runs as a DOS app.
|
---|
179 | Memory managers (such as emm386) may need adjustment. VCPI cannot
|
---|
180 | be used under OS/2, Win/WfW, Win-95, or NT. See also DPMI.
|
---|
181 |
|
---|
182 | Windows32 Uses/supports Windows32 features (such as long filenames).
|
---|
183 |
|
---|
184 | Reportedly, NTEmacs (another Windows32 program) can run programs such as
|
---|
185 | Windows32-gawk asynchronously. Similarly, as native OS/2 versions are a
|
---|
186 | plus under OS/2 even for command-line programs, native Windows32 versions
|
---|
187 | may be desired under NT and Win95.
|
---|
188 |
|
---|
189 | Users interested in Windows32 applications may also wish to examine the
|
---|
190 | Cygnus cygwin project at http://sources.redhat.com/cygwin/ or the
|
---|
191 | Mingw32 work at http://www.mingw.org. Windows32 gawk will often require
|
---|
192 | that utilities run from within gawk be Windows32 (e.g., the tests place this
|
---|
193 | requirement on the cat utility).
|
---|
194 |
|
---|
195 |
|
---|
196 | 3. An sh-like shell may be useful for awk programming (and is essential
|
---|
197 | for running "make test"). Stewartson's sh (OS/2 and DOS) is a good
|
---|
198 | choice, and may be found in GNUish.
|
---|
199 |
|
---|
200 | Stewartson's shell uses a configuration file (see "Command Line Building"
|
---|
201 | in the sh manual page), and it may be necessary to edit the entry for
|
---|
202 | gawk. The following entries are suggested:
|
---|
203 |
|
---|
204 | -- $(EXTENDED_LINE) -- -- Comment only, not part of file --
|
---|
205 | gawk = unix ignoretype # emxbnd
|
---|
206 | gawk = unix # djgpp; msc* with Stewartson's stdargv
|
---|
207 | # No entry for emx or for msc* without stdargv
|
---|
208 | gawk = ignoretype # if you want something which which always work
|
---|
209 | # --but without the use of @-include files.
|
---|
210 |
|
---|
211 | However, users of djgpp versions of gawk may prefer "dos" over "unix"
|
---|
212 | in the above, due to the way djgpp handles @-include files. Entries
|
---|
213 | for other other utilities (such as sed and wc) may need to be edited
|
---|
214 | in order to match your specific collection of programs.
|
---|
215 |
|
---|
216 | Daisuke Aoyama <jack@st.rim.or.jp> has ported Bash 1.14.7 to djgpp.
|
---|
217 | This version worked flawlessly in tests with djgpp gawk and make. bash
|
---|
218 | is now part of the djgpp collection; the older port may be found on
|
---|
219 |
|
---|
220 | http://www.neongenesis.com/~jack/djgpp-work/beta/index.html
|
---|
221 |
|
---|
222 | Under OS/2, bash should be a good choice; however, there has been some
|
---|
223 | trouble getting a solid version. As of Feb-95, there are two bash ports,
|
---|
224 | available at LEO under shells/gnu/.
|
---|
225 |
|
---|
226 | LEO also contains a Korn shell (ksh), tcsh, zsh, and a demo of
|
---|
227 | Hamilton's C shell, but these have not been tested with gawk by the
|
---|
228 | maintainers. Reports are welcomed.
|
---|
229 |
|
---|
230 | Users of the emx versions of gawk may wish to set EMXSHELL, which
|
---|
231 | overrides COMSPEC when running shells from emx programs. Similarly,
|
---|
232 | the djgpp version of gawk respects SHELL.
|
---|
233 |
|
---|
234 | Compatibility among shells and various utilities (including gawk)
|
---|
235 | continues to be a problem. Stewartson's shell may be the best choice
|
---|
236 | for emx-compiled programs (although djgpp-bash almost works with
|
---|
237 | emx on DOS). GNU make is recommended if using djgpp-bash.
|
---|
238 |
|
---|
239 | Beginning with 3.0.4, the MSC (DOS/Windows32) and Mingw32 versions write
|
---|
240 | pipe and system() commands to a temporary file, and then execute
|
---|
241 | with SHELL or COMSPEC. The current mechanism defaults to dos-style
|
---|
242 | shell conventions unless the shell is one of sh, bash, csh, tcsh, sh32,
|
---|
243 | sh16, or ksh.
|
---|
244 |
|
---|
245 |
|
---|
246 | 4. GNU make is available at LEO for OS/2, in the djgpp collection
|
---|
247 | for DOS, and in the Mingw32 collection for Windows32.
|
---|
248 |
|
---|
249 | dmake is by Dennis Vadura (dvadura@watdragon.uwaterloo.ca), CS
|
---|
250 | Dept., University of Waterloo. OS/2 and DOS versions can be found as
|
---|
251 | part of the GNUish project. Note that DOS users will need the DOS-only
|
---|
252 | version (due to the swap requirement).
|
---|
253 |
|
---|
254 | Ndmake is by D.G. Kneller. This ShareWare program was later released
|
---|
255 | as Opus Make (which is available for OS/2 and DOS). Ndmake 4.5 is
|
---|
256 | available at
|
---|
257 |
|
---|
258 | ftp://ftp.simtel.net/simtelnet/msdos/c/ndmake45.zip
|
---|
259 |
|
---|
260 |
|
---|
261 | 5. Stewartson's shell contains sources for a setargv-replacement
|
---|
262 | for MSC, which can add enhanced command-line processing capabilities
|
---|
263 | to gawk. See the makefile. Note that there is a fatal bug in
|
---|
264 | stdargv.c, triggered in the case of no closing quote. The following
|
---|
265 | patch treats this case as if a quote was inserted as the last
|
---|
266 | character on the command-line.
|
---|
267 |
|
---|
268 | 478,479c478,482
|
---|
269 | < else
|
---|
270 | < spos = &spos[strlen (cpos)];
|
---|
271 | ---
|
---|
272 | > else {
|
---|
273 | > /* No matching quote. Fake it. */
|
---|
274 | > spos = cpos + strlen (cpos) + 1;
|
---|
275 | > break;
|
---|
276 | > }
|
---|
277 |
|
---|
278 |
|
---|
279 | Known bugs
|
---|
280 | ----------
|
---|
281 |
|
---|
282 | 1. DJGPP version 1 has known problems with signals, and in the way it
|
---|
283 | handles command-lines. Older versions of this file contain notes on
|
---|
284 | other bugs, and on a few bugs uncovered in the v2 betas. Testing of
|
---|
285 | gawk with DJGPP v1 ended with gawk-3.0. djgpp-2.01 and djgpp ports of
|
---|
286 | GNU make 3.75 or later are strongly preferred, in part due to enhanced
|
---|
287 | support for sh-like shells.
|
---|
288 |
|
---|
289 | 2. emx does not support DST. On 2-Jan-96, Mattes writes:
|
---|
290 |
|
---|
291 | Quotation from ISO 9899-1990:
|
---|
292 |
|
---|
293 | 7.12.3.5 The strftime function
|
---|
294 | [...]
|
---|
295 | %Z is replaced by the time zone name or abbreviation, or by no
|
---|
296 | characters if no time zone is determinable.
|
---|
297 |
|
---|
298 | As emx does not yet support DST, it does not know which one of the two
|
---|
299 | time zones (with DST vs. without DST) applies. In consequence, `no
|
---|
300 | time zone is determinable'.
|
---|
301 |
|
---|
302 | As a workaround, it may be possible to edit do_strftime() of builtin.c
|
---|
303 | according to Mattes' recommendation:
|
---|
304 |
|
---|
305 | If you happen to know whether DST applies or not for a given struct
|
---|
306 | tm, just set its tm_isdst to a positive value or to zero, respectively.
|
---|
307 | Then, strftime() will replace %Z with the name of the time zone.
|
---|
308 |
|
---|
309 | However, this probably won't yield a generic solution given that the rules
|
---|
310 | for when DST starts and stops vary depending upon your location and the
|
---|
311 | rules have changed over time. Most versions of UNIX maintain this
|
---|
312 | information in a database (of sorts). In Solaris, for instance, it can be
|
---|
313 | found in /usr/share/zoneinfo/*. The setting of the TZ environment variable
|
---|
314 | (eg. TZ=US/Pacific) is then used to lookup the specifics for that locale.
|
---|
315 |
|
---|
316 | 3. The 16-bit DOS version can exhaust memory on scripts such as Henry
|
---|
317 | Spencer's "awf". Use GNU C versions if possible.
|
---|
318 |
|
---|
319 | 4. builtin.c of gawk-3.0.[1-6] triggers a bug in MSC 6.00A. The makefile
|
---|
320 | works around the bug by compiling builtin.c without optimizations (-Od).
|
---|
321 | In limited testing, it appears that inserting some dummy code in
|
---|
322 | builtin.c can provide a better solution than disabling optimizations.
|
---|
323 |
|
---|
324 | 5. There are problems with system() when using the rsx package with emx
|
---|
325 | programs (rsx is used in DPMI environments such as MS-Win). The djgpp
|
---|
326 | versions are preferred in this case.
|
---|
327 |
|
---|
328 | 6. In contrast to getpid() on UNIX, the getpid() in Microsoft C/C++ 1.52
|
---|
329 | (AKA 8.0) sometimes returns negative numbers. The DOS Gawk developers felt
|
---|
330 | that it was best to use Microsoft's built-in function; but at the same time,
|
---|
331 | we are placing this warning here, because this behavior will undoubtably be
|
---|
332 | surprising to many.
|
---|
333 |
|
---|
334 | 7. MSC 6 fails the strftlng test. The funstack test exhausts memory
|
---|
335 | on the 16bit DOS versions.
|
---|
336 |
|
---|
337 | 8. Eli Zaretskii writes: "Make can crash with SIGFPE after finishing all
|
---|
338 | the tests. This happens on Windows 95 only, and Gawk 3.0.3 does that as
|
---|
339 | well (as do older versions of Make). The cause for this is the log(-1)
|
---|
340 | call in the last test. Based on some limited testing, I'd say that the
|
---|
341 | problem is in sloppy Windows handling of the FPU: it doesn't clean up the
|
---|
342 | FPU after a program exits, so if Make has SIGFPE unmasked, it crashes."
|
---|
343 |
|
---|
344 | 9. gawk built from the mingw32 and vcWin32 targets continues to have
|
---|
345 | problems with pipes; in particular, the pipeio1 test fails.
|
---|
346 |
|
---|
347 | 10. As mentioned above, `|&' only works with cygwin.
|
---|
348 |
|
---|
349 |
|
---|
350 | Gawk thanks
|
---|
351 | -----------
|
---|
352 |
|
---|
353 | The DOS maintainers wish to express their thanks to Eli Zaretskii
|
---|
354 | <eliz@is.elta.co.il> for his work and for the many conversations
|
---|
355 | concerning gawk, make, and djgpp. His FAQ for djgpp is essential
|
---|
356 | reading, and he was always willing to answer our questions (even when
|
---|
357 | we didn't read the relevant portions of the FAQ :).
|
---|
358 |
|
---|
359 | We are indebted to Juan Grigera <juan@biophnet.unlp.edu.ar> for the
|
---|
360 | Visual C++ target, and for additional help on changes for Windows32.
|
---|
361 |
|
---|
362 |
|
---|
363 | ----
|
---|
364 | If you have any problems with the DOS or OS/2 versions of Gawk,
|
---|
365 | please send bug reports (along with the version and compiler used) to
|
---|
366 |
|
---|
367 | Scott Deifik, scottd@amgen.com (DOS versions)
|
---|
368 | or
|
---|
369 | gawk-maintainer@unixos2.org (OS/2 version)
|
---|
370 | Darrel Hankerson, hankedr@mail.auburn.edu
|
---|
371 |
|
---|
372 | Support for Windows32 started in gawk-3.0.3. Reports on
|
---|
373 | the Visual C++ version (vcWin32) may be sent to
|
---|
374 |
|
---|
375 | Juan Grigera, juan@biophnet.unlp.edu.ar (Visual C++ version)
|
---|
376 |
|
---|
377 | with a copy to Scott Deifik. Other Windows32 reports may go to Darrel
|
---|
378 | Hankerson.
|
---|