How to build XMLgawk in Windows

For XMLgawk version 3.1.4 (patch 2004-09-20)

This file describes how to build XMLgawk from sources in a Windows machine. Successful builds have been achieved with several compilers. Each one requires some manual intervention in addition to the instructions given in the gawk/XMLgawk distribution.

You must have a working environment for either DJGPP, Cygwin or MinGW/MSYS to follow these instructions. If not, please install one of them first.

You need to install gcc, make, bash and some other common utilities. I've not compiled a detailed set of requirements. A warning/error message while attempting to build will tell you if something is missed.

Common steps (do it first)

  1. Get the gawk-3.1.4 sources from a GNU site:
       ftp://ftp.gnu.org/gnu/gawk/gawk-3.1.4.tar.gz 
    Unarchive them on a dedicated directory, say C:\BUILDDIR (in what follows, replace C:\BUILDDIR with the directory of your choice).
     
  2. Get the XMLgawk source distribution (a patch for gawk):
       http://home.vrweb.de/~Juergen.Kahrs/patch_3.1.4__xml_20040920 
    Put it also in C:\BUILDDIR. Now you should have:
       C:\BUILDDIR\
          |-- gawk-3.1.4\
          |   '-- ...
          '-- patch_3.1.4__xml_20040920 
  3. CD to C:\BUILDDIR and apply the patch:
       C:\BUILDDIR> patch -p1 < patch_3.1.4__xml_20040920 

Building with DJGPP

  1. Get the Expat sources from the Expat website (get sources for 1.95.8 - NOT binaries):
       http://sourceforge.net/projects/expat/
    Unarchive them on C:\BUILDDIR. Now you should have:
       C:\BUILDDIR\
          |-- expat-1.95.8\
          |   '-- ...
          |-- gawk-3.1.4\
          |   '-- ...
          '-- patch_3.1.4__xml_20040920 
  2. Start a bash shell, goto to the Expat directory and compile and build it:
       bash-2.04$ cd C:/BUILDDIR/expat-1.95.8
       bash-2.04$ ./configure
       bash-2.04$ make 
  3. Manually copy the Expat library to your DJGPP installation. If it's on C:\DJGPP:
       bash-2.04$ cp .libs/* c./djgpp/lib
       bash-2.04$ cp lib/expat*.h c:/djgpp/include 
  4. Follow the instructions on C:\BUILDDIR\gawk-3.1.4\README_d\README.pc:  
  5. Now you should have: awk.exe, gawk.exe and pgawk.exe

Building with Cygwin

  1. Open the file C:\BUILDDIR\gawk-3.1.4\Makefile.in in a text editor that preserve tabs and change the line 206:
       from:  LIBS = @LIBS@ -lexpat
       to  :  LIBS = @LIBS@ -lexpat -liconv 
  2. Start a bash shell, goto to the `gawk' directory, and compile and build XMLgawk:
       username@host ~
       $ cd C:/BUILDDIR/gawk-3.1.4
       username@host /cygdrive/C/BUILDDIR/gawk-3.1.4
       $ ./configure
       username@host /cygdrive/C/BUILDDIR/gawk-3.1.4
       $ make 
  3. Now you should have: gawk.exe and pgawk.exe

Building with MinGW/MSYS

  1. Open the file C:\BUILDDIR\gawk-3.1.4\pc\Makefile in a text editor that preserve tabs and change the line 189:
       from:  «tab» LNK=LMINGW32 PLNK=PLMINGW32 LF=-s RSP=
       to  :  «tab» LNK=LMINGW32 PLNK=PLMINGW32 LF=-s LF2='-lm -lexpat -liconv' RSP= 
  2. Follow the instructions on C:\BUILDDIR\gawk-3.1.4\README_d\README.pc:  
  3. Now you should have: gawk.exe and pgawk.exe

Copyright © 2004 Manuel Collado: mcollado@fi.upm.es
Last updated: 2004-11-08