rem One needs to: make "CC=gcc -Zmtd" |& tee 00m2

sh config.status --file os2/xml2.def-base
cp os2/xml2.def-base .libs/xml2.def
set _A=.lib
cp .libs/xml2%_A% .libs/xml2-static%_A%
if exist .libs\xml2-static.a emxomf -p 64 .libs/xml2-static.a
emxexp .libs/xml2-static.lib >>.libs\xml2.def
gcc -s -Zdll -Zomf -Zmtd -o .libs/xml2_mtd.dll -L.libs -lxml2-static .libs/xml2.def -lz -lsocket -liconv
lxlite .libs/xml2_mtd.dll
emximp -o .libs/xml2-dyn.a .libs/xml2.def
emximp -o .libs/xml2-dyn.lib .libs/xml2.def

echo To build test .exe files, rename .libs/xml2-dyn.a to .libs/xml2.a
echo (same for .lib) and move .libs/xml2_mtd.dll 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"
