OS/2 EMX -Zmtd build of expat library v1.95.6 for parsing of HTML.

---------------------------------------------------  INSTALL Procedure

Extract to d:/emx directory or an equivalent:

  unzip expat-1-95-6.zip -d d:/emx

One needs to edit the configuration files to correct /usr/local to the actual
install directory.  One possible way (requires sh and perl): edit install_dir=
line in

 try-relocate.cmd

(with the above example, it should be install_dir=d:/emx), then run the script.

---------------------------------------------------  BUILD Procedure

The Perl script convert_configure is available from ilyaz.org/software/os2.

# Apply the patch at the end of this file (in the build directory)
gnupatch -p1 < README-expat
convert_configure
(sh configure --disable-shared && make && make tests) |& tee 00c1
os2\make-dll.cmd
cd xmlwf
for %a in (*.o) do emxomf %a
gcc -Zomf -Zmtd -s -O2 -o xmlwf.exe *.obj -L../.libs -lexpat-dyn

Bug fixed: would produce .def with SINGLE (=shared initialized global data).

The bug in expat.h
 http://sourceforge.net/tracker/index.php?func=detail&aid=676844&group_id=10127&atid=110127
is also fixed.

--- ./os2/make-dll.cmd.orig	Tue Oct  7 23:46:16 2003
+++ ./os2/make-dll.cmd	Tue Oct  7 23:31:02 2003
@@ -0,0 +1,27 @@
+rem One needs to: make "CC=gcc -Zmtd" |& tee 00m2
+
+rem Run at the root of the distribution, FOO.def-base.in should be in ./os2
+
+set _A=.a
+
+rem THIS_DLL should match the name in os2/%THIS_LIB%.def-base; 8 chars max
+set THIS_DLL=expatmtd
+set THIS_LIB=expat
+set THIS_LIB_DIR=.
+set LIBS=-lz -lsocket -liconv
+
+sh config.status --file os2/%THIS_LIB%.def-base
+cp os2/%THIS_LIB%.def-base os2/%THIS_LIB%.def
+cp %THIS_LIB_DIR%/.libs/%THIS_LIB%%_A% os2/%THIS_LIB%-static%_A%
+if exist os2\%THIS_LIB%-static%_A% emxomf -p 128 os2/%THIS_LIB%-static%_A%
+emxexp os2/%THIS_LIB%-static.lib >>os2\%THIS_LIB%.def
+gcc -s -Zdll -Zomf -Zmtd -o os2/%THIS_DLL%.dll -Los2 -l%THIS_LIB%-static os2/%THIS_LIB%.def %LIBS%
+lxlite os2/%THIS_DLL%.dll
+emximp -o %THIS_LIB_DIR%/.libs/%THIS_LIB%-dyn.a   os2/%THIS_LIB%.def
+emximp -o %THIS_LIB_DIR%/.libs/%THIS_LIB%-dyn.lib os2/%THIS_LIB%.def
+
+echo To build test .exe files, rename
+echo ren %THIS_LIB_DIR%/.libs/%THIS_LIB%-dyn%_A% %THIS_LIB_DIR%/.libs/%THIS_LIB%%_A%
+echo and move DLLs in ./os2 to a directory on LIBPATH.
+echo Then remove .exe's, and rebuild like this (unless already -Zmtd or -Zcrtdll):
+echo make "CC=gcc -Zmtd -s"
--- ./os2/expat.def-base.in.orig	Tue Oct  7 23:46:16 2003
+++ ./os2/expat.def-base.in	Tue Oct  7 23:29:12 2003
@@ -0,0 +1,6 @@
+LIBRARY 'expatmtd' INITINSTANCE TERMINSTANCE
+DESCRIPTION '@#www.libexpat.org/:@PACKAGE_VERSION@#@Expat XML parser.  Built for EMX -Zmtd'
+STACKSIZE 32768
+CODE LOADONCALL
+DATA LOADONCALL NONSHARED MULTIPLE
+EXPORTS
