source: trunk/essentials/sys-apps/gawk/README_d/README.pc

Last change on this file was 3076, checked in by bird, 18 years ago

gawk 3.1.5

File size: 15.8 KB
Line 
1This 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
4the GNU development tools from DJ Delorie (DJGPP; DOS with special
5support for long filenames under Win95), Eberhard Mattes (EMX; OS/2,
6DOS, 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
8version for Windows 9x/NT, and MSC can be used to build 16-bit versions
9for DOS and OS/2. (As of 3.1.2, the MSC version doesn't work, but the
10maintainer for it is working on fixing it.)
11
12 The cygwin environment (http://www.cygwin.com) may also be used
13to compile and run gawk under Windows. For cygwin, building and
14installation 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
20The `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
27Building gawk
28-------------
29
30Building on DOS or Windows environments can be troublesome, in part due
31to shell limitations, the long filename issue, and various Windows32 pipe
32considerations. The situation is somewhat better on OS/2. The general
33recommendation is to use tools (especially make) which are compatible
34or built with the compiler to be used on gawk.
35
36Building versions which do not understand long filenames on systems
37that offer long names is a special case. The maintainers unpack the
38distribution and process using utilities (unzip, make, cmp) which do not
39use long filenames. (For example, the djgpp tools will work if LFN=n is
40set in the environment.)
41
42Copy the files in the `pc' directory (EXCEPT for `ChangeLog') to the
43directory with the rest of the gawk sources. (The subdirectories of
44`pc' need not be copied.) The makefile contains a configuration
45section with comments, and may need to be edited in order to work
46with your make utility.
47
48The "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
50gawk will be installed under $(prefix)/lib/awk (e.g., /gnu/lib/awk),
51it is convenient to have this directory in DEFPATH of config.h.
52
53The makefile contains a number of targets for building various DOS and
54OS/2 versions. A list of targets will be printed if the make command is
55given without a target. As an example, to build gawk using the djgpp
56tools, enter "make djgpp".
57
58
59Testing and installing gawk
60---------------------------
61
62The command "make test" (and possibly "make install") requires several
63Unix-like tools, including an sh-like shell, sed, cp, and cmp. Only
64dmake and GNU make are known to work on "make test".
65
66There are two methods for the install: Method 1 uses a typical Unix-like
67approach and requires cat, cp, mkdir, sed, and sh; method 2 uses gawk
68and batch files. See the configuration section of the makefile.
69
70The file test/Makefile will need some editing (especially for DOS). A
71sample makefile with comments appears in pc/Makefile.tst, and can be
72used to modify test/Makefile for your platform. In addition, some
73files in the test directory may need to have their end-of-line markers
74converted, as described in Makefile.tst.
75
76As with building gawk, the OS, shell, and long filename issues come into
77play when testing, too. If you are testing gawk on a LFN aware system with
78some LFN aware tools, you may have problems if the shell that you specify in
79test/Makefile is not LFN aware. This problem will apply whether or not
80you are building a LFN aware gawk. See the comments in pc/Makefile.tst
81for more information on this.
82
83It is routine to install by hand, but note that the install target also
84builds igawk.bat and igawk.cmd, which are used to add an include
85facility to gawk (and which require sh).
86
87
88Notes
89-----
90
911. Collections containing gawk and various utilities for OS/2 or DOS
92include the GNUish Project, Rommel's OS/2 collection at LEO, and the
93djgpp collection.
94
95The GNUish Project was designed to bring GNU-like programs to small
96systems running OS/2 and DOS. Binary distributions of gawk are
97maintained in GNUish, and include 16bit OS/2 and DOS, 32bit djgpp,
98and Windows32 versions. Information on GNUish is available via
99
100 http://www.simtel.net/simtel.net/
101or
102 ftp://ftp.simtel.net/simtelnet/gnu/gnuish
103
104Documentation appears in gnuish.htm (html) or gnuish.inf (info).
105
106Kai 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
110It contains emx-compiled (32bit) versions of gawk for OS/2, DOS, and Windows32,
111along with many OS/2 utilities.
112
113The djgpp collection at
114
115 ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/
116
117contains a djgpp-compiled (32bit) version of gawk, along with many
118djgpp-compiled utilities.
119
120The Mingw32 collection at http://www.mingw.org contains links to ported
121software. The site by Jan-Jaap van der Heijden
122
123 http://agnes.dida.physik.uni-essen.de/~janjaap/
124
125is apparently no longer maintained, but it was accessible as of Jan 2001
126and may contain files of interest.
127
128
1292. The following table illustrates some of the differences among the various
130compiled versions of gawk. For example, the djgpp version runs on all the
131systems, but with differing capabilities: it supports long filenames under
132Win-9x but not under NT, and it runs as a DPMI application under OS/2 (which
133translates into "works in the DOS-box under OS/2, but not as a true OS/2
134application").
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
182Windows32 Uses/supports Windows32 features (such as long filenames).
183
184Reportedly, NTEmacs (another Windows32 program) can run programs such as
185Windows32-gawk asynchronously. Similarly, as native OS/2 versions are a
186plus under OS/2 even for command-line programs, native Windows32 versions
187may be desired under NT and Win95.
188
189Users interested in Windows32 applications may also wish to examine the
190Cygnus cygwin project at http://sources.redhat.com/cygwin/ or the
191Mingw32 work at http://www.mingw.org. Windows32 gawk will often require
192that utilities run from within gawk be Windows32 (e.g., the tests place this
193requirement on the cat utility).
194
195
1963. An sh-like shell may be useful for awk programming (and is essential
197for running "make test"). Stewartson's sh (OS/2 and DOS) is a good
198choice, and may be found in GNUish.
199
200Stewartson's shell uses a configuration file (see "Command Line Building"
201in the sh manual page), and it may be necessary to edit the entry for
202gawk. 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
211However, users of djgpp versions of gawk may prefer "dos" over "unix"
212in the above, due to the way djgpp handles @-include files. Entries
213for other other utilities (such as sed and wc) may need to be edited
214in order to match your specific collection of programs.
215
216Daisuke Aoyama <jack@st.rim.or.jp> has ported Bash 1.14.7 to djgpp.
217This version worked flawlessly in tests with djgpp gawk and make. bash
218is 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
222Under OS/2, bash should be a good choice; however, there has been some
223trouble getting a solid version. As of Feb-95, there are two bash ports,
224available at LEO under shells/gnu/.
225
226LEO also contains a Korn shell (ksh), tcsh, zsh, and a demo of
227Hamilton's C shell, but these have not been tested with gawk by the
228maintainers. Reports are welcomed.
229
230Users of the emx versions of gawk may wish to set EMXSHELL, which
231overrides COMSPEC when running shells from emx programs. Similarly,
232the djgpp version of gawk respects SHELL.
233
234Compatibility among shells and various utilities (including gawk)
235continues to be a problem. Stewartson's shell may be the best choice
236for emx-compiled programs (although djgpp-bash almost works with
237emx on DOS). GNU make is recommended if using djgpp-bash.
238
239Beginning with 3.0.4, the MSC (DOS/Windows32) and Mingw32 versions write
240pipe and system() commands to a temporary file, and then execute
241with SHELL or COMSPEC. The current mechanism defaults to dos-style
242shell conventions unless the shell is one of sh, bash, csh, tcsh, sh32,
243sh16, or ksh.
244
245
2464. GNU make is available at LEO for OS/2, in the djgpp collection
247for DOS, and in the Mingw32 collection for Windows32.
248
249dmake is by Dennis Vadura (dvadura@watdragon.uwaterloo.ca), CS
250Dept., University of Waterloo. OS/2 and DOS versions can be found as
251part of the GNUish project. Note that DOS users will need the DOS-only
252version (due to the swap requirement).
253
254Ndmake is by D.G. Kneller. This ShareWare program was later released
255as Opus Make (which is available for OS/2 and DOS). Ndmake 4.5 is
256available at
257
258 ftp://ftp.simtel.net/simtelnet/msdos/c/ndmake45.zip
259
260
2615. Stewartson's shell contains sources for a setargv-replacement
262for MSC, which can add enhanced command-line processing capabilities
263to gawk. See the makefile. Note that there is a fatal bug in
264stdargv.c, triggered in the case of no closing quote. The following
265patch treats this case as if a quote was inserted as the last
266character on the command-line.
267
268478,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
279Known bugs
280----------
281
2821. DJGPP version 1 has known problems with signals, and in the way it
283handles command-lines. Older versions of this file contain notes on
284other bugs, and on a few bugs uncovered in the v2 betas. Testing of
285gawk with DJGPP v1 ended with gawk-3.0. djgpp-2.01 and djgpp ports of
286GNU make 3.75 or later are strongly preferred, in part due to enhanced
287support for sh-like shells.
288
2892. 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
302As a workaround, it may be possible to edit do_strftime() of builtin.c
303according 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
309However, this probably won't yield a generic solution given that the rules
310for when DST starts and stops vary depending upon your location and the
311rules have changed over time. Most versions of UNIX maintain this
312information in a database (of sorts). In Solaris, for instance, it can be
313found 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
3163. The 16-bit DOS version can exhaust memory on scripts such as Henry
317Spencer's "awf". Use GNU C versions if possible.
318
3194. builtin.c of gawk-3.0.[1-6] triggers a bug in MSC 6.00A. The makefile
320works around the bug by compiling builtin.c without optimizations (-Od).
321In limited testing, it appears that inserting some dummy code in
322builtin.c can provide a better solution than disabling optimizations.
323
3245. There are problems with system() when using the rsx package with emx
325programs (rsx is used in DPMI environments such as MS-Win). The djgpp
326versions are preferred in this case.
327
3286. 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
330that it was best to use Microsoft's built-in function; but at the same time,
331we are placing this warning here, because this behavior will undoubtably be
332surprising to many.
333
3347. MSC 6 fails the strftlng test. The funstack test exhausts memory
335on the 16bit DOS versions.
336
3378. Eli Zaretskii writes: "Make can crash with SIGFPE after finishing all
338the tests. This happens on Windows 95 only, and Gawk 3.0.3 does that as
339well (as do older versions of Make). The cause for this is the log(-1)
340call in the last test. Based on some limited testing, I'd say that the
341problem is in sloppy Windows handling of the FPU: it doesn't clean up the
342FPU after a program exits, so if Make has SIGFPE unmasked, it crashes."
343
3449. gawk built from the mingw32 and vcWin32 targets continues to have
345problems with pipes; in particular, the pipeio1 test fails.
346
34710. As mentioned above, `|&' only works with cygwin.
348
349
350Gawk thanks
351-----------
352
353The DOS maintainers wish to express their thanks to Eli Zaretskii
354<eliz@is.elta.co.il> for his work and for the many conversations
355concerning gawk, make, and djgpp. His FAQ for djgpp is essential
356reading, and he was always willing to answer our questions (even when
357we didn't read the relevant portions of the FAQ :).
358
359We are indebted to Juan Grigera <juan@biophnet.unlp.edu.ar> for the
360Visual C++ target, and for additional help on changes for Windows32.
361
362
363----
364If you have any problems with the DOS or OS/2 versions of Gawk,
365please send bug reports (along with the version and compiler used) to
366
367 Scott Deifik, scottd@amgen.com (DOS versions)
368or
369 gawk-maintainer@unixos2.org (OS/2 version)
370 Darrel Hankerson, hankedr@mail.auburn.edu
371
372Support for Windows32 started in gawk-3.0.3. Reports on
373the Visual C++ version (vcWin32) may be sent to
374
375 Juan Grigera, juan@biophnet.unlp.edu.ar (Visual C++ version)
376
377with a copy to Scott Deifik. Other Windows32 reports may go to Darrel
378Hankerson.
Note: See TracBrowser for help on using the repository browser.