21.07.2015 Views

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix B: Installing gawk 271libraries under ‘/usr/share/awk’, manual pages under ‘/usr/man’, Texinfo documentationunder ‘/usr/info’ and NLS files under ‘/usr/share/locale’. If you already have a file‘/usr/info/dir’ from another package do not overwrite it! Instead enter the followingcommands at your prompt (replace ‘x:’ by your installation drive):install-info --info-dir=x:/usr/info x:/usr/info/gawk.infoinstall-info --info-dir=x:/usr/info x:/usr/info/gawkinet.infoHowever, the files can be installed anywhere provided <strong>AWK</strong>PATH is set properly.The binary distribution may contain a separate file containing additional or more detailedinstallation instructions.B.3.1.2 Compiling gawk for PC Operating Systemsgawk can be compiled for MS-DOS, Windows32, and OS/2 using the GNU developmenttools from DJ Delorie (DJGPP; MS-DOS only) or Eberhard Mattes (EMX; MS-DOS, Windows32and OS/2). Microsoft Visual C/C++ can be used to build a Windows32 version,and Microsoft C/C++ can be used to build 16-bit versions for MS-DOS and OS/2. (As ofgawk 3.1.2, the MSC version doesn’t work. However, the maintainer is working on fixingit.) The file ‘README_d/README.pc’ in the gawk distribution contains additional notes, and‘pc/Makefile’ contains important information on compilation options.To build gawk for MS-DOS, Windows32, and OS/2 (16 bit only; for 32 bit (EMX) youcan use the configure script and skip the following paragraphs; for details see below), copythe files in the ‘pc’ directory (except for ‘ChangeLog’) to the directory with the rest of thegawk sources. The ‘Makefile’ contains a configuration section with comments and mayneed to be edited in order to work with your make utility.The ‘Makefile’ contains a number of targets for building various MS-DOS, Windows32,and OS/2 versions. A list of targets is printed if the make command is given without atarget. As an example, to build gawk using the DJGPP tools, enter ‘make djgpp’. (TheDJGPP tools may be found at ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/.)Using make to run the standard tests and to install gawk requires additional Unix-liketools, including sh, sed, and cp. In order to run the tests, the ‘test/*.ok’ files may need tobe converted so that they have the usual DOS-style end-of-line markers. Most of the testswork properly with Stewartson’s shell along with the companion utilities or appropriateGNU utilities. However, some editing of ‘test/Makefile’ is required. It is recommendedthat you copy the file ‘pc/Makefile.tst’ over the file ‘test/Makefile’ as a replacement.Details can be found in ‘README_d/README.pc’ and in the file ‘pc/Makefile.tst’.The 32 bit EMX version of gawk works “out of the box” under OS/2. In principle, it ispossible to compile gawk the following way:$ ./configure$ makeThis is not recommended, though. To get an OMF executable you should use thefollowing commands at your sh prompt:$ CPPFLAGS="-D__ST_MT_ERRNO__"$ export CPPFLAGS$ CFLAGS="-O2 -Zomf -Zmt"$ export CFLAGS

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!