diff --git a/build/bakefiles/expat.bkl b/build/bakefiles/expat.bkl
index 578e011bd0..ef4f4e9f47 100644
--- a/build/bakefiles/expat.bkl
+++ b/build/bakefiles/expat.bkl
@@ -19,6 +19,9 @@
$(LIBDIRNAME)
$(LIBDIRNAME)
$(BUILDDIR)/src/expat
+
+ COMPILED_FROM_DSP
+
src/expat/lib/xmlparse.c
src/expat/lib/xmlrole.c
diff --git a/build/makefile.bcc b/build/makefile.bcc
index d23dc6fc0b..56848a0f25 100644
--- a/build/makefile.bcc
+++ b/build/makefile.bcc
@@ -112,7 +112,7 @@ OBJS = \
WXEXPAT_CFLAGS = $(CPPFLAGS) $(__RUNTIME_LIBS) $(__DEBUGFLAG) $(__OPTIMIZEFLAG) \
-tWM \
-I..\lib\bcc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) \
- $(CFLAGS)
+ -DCOMPILED_FROM_DSP $(CFLAGS)
WXJPEG_CFLAGS = $(CPPFLAGS) $(__RUNTIME_LIBS) $(__DEBUGFLAG) $(__OPTIMIZEFLAG) \
-tWM \
-I..\lib\bcc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) \
diff --git a/build/makefile.gcc b/build/makefile.gcc
index f14850353a..85d6af1c15 100644
--- a/build/makefile.gcc
+++ b/build/makefile.gcc
@@ -27,7 +27,7 @@ MONODLL_CXXFLAGS = $(CPPFLAGS) $(__DEBUGFLAG) $(__OPTIMIZEFLAG) $(GCCFLAGS) -DHA
MONOLIB_CFLAGS = $(CPPFLAGS) $(__DEBUGFLAG) $(__OPTIMIZEFLAG) $(GCCFLAGS) -DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__UNICODE_DEFINE_p) -I..\include -I..\lib\gcc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) -I..\src\tiff -I..\src\jpeg -I..\src\png -I..\src\zlib -I..\src\regex -DwxUSE_BASE=1 $(CFLAGS)
MONOLIB_CXXFLAGS = $(CPPFLAGS) $(__DEBUGFLAG) $(__OPTIMIZEFLAG) $(GCCFLAGS) -DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__UNICODE_DEFINE_p) -I..\include -I..\lib\gcc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) -I..\src\tiff -I..\src\jpeg -I..\src\png -I..\src\zlib -I..\src\regex -DwxUSE_BASE=1 $(CXXFLAGS)
OBJS = gcc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)
-WXEXPAT_CFLAGS = $(CPPFLAGS) $(__DEBUGFLAG) $(__OPTIMIZEFLAG) $(GCCFLAGS) -DHAVE_W32API_H -I..\lib\gcc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) $(CFLAGS)
+WXEXPAT_CFLAGS = $(CPPFLAGS) $(__DEBUGFLAG) $(__OPTIMIZEFLAG) $(GCCFLAGS) -DHAVE_W32API_H -I..\lib\gcc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) -DCOMPILED_FROM_DSP $(CFLAGS)
WXJPEG_CFLAGS = $(CPPFLAGS) $(__DEBUGFLAG) $(__OPTIMIZEFLAG) $(GCCFLAGS) -DHAVE_W32API_H -I..\lib\gcc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) $(CFLAGS)
WXPNG_CFLAGS = $(CPPFLAGS) $(__DEBUGFLAG) $(__OPTIMIZEFLAG) $(GCCFLAGS) -DHAVE_W32API_H -I..\src\zlib $(CFLAGS)
WXREGEX_CFLAGS = $(CPPFLAGS) $(__DEBUGFLAG) $(__OPTIMIZEFLAG) $(GCCFLAGS) -DHAVE_W32API_H $(CFLAGS)
diff --git a/build/makefile.vc b/build/makefile.vc
index 8f0506a0d5..bc58bc7c37 100644
--- a/build/makefile.vc
+++ b/build/makefile.vc
@@ -27,7 +27,7 @@ MONODLL_CXXFLAGS = $(CPPFLAGS) /M$(__RUNTIME_LIBS)$(__DEBUGFLAG_34) $(__DEBUGFLA
MONOLIB_CFLAGS = $(CPPFLAGS) /M$(__RUNTIME_LIBS)$(__DEBUGFLAG_34) $(__DEBUGFLAG_33) /Fd..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)\wx$(PORTNAME)$(WXUNIVNAME)25$(WXUNICODEFLAG)$(WXDEBUGFLAG).pdb $(__OPTIMIZEFLAG) /D__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__UNICODE_DEFINE_p) /I..\include /I..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) /I..\src\tiff /I..\src\jpeg /I..\src\png /I..\src\zlib /I..\src\regex /Fp$(OBJS)\wxprec_monolib.pch /DwxUSE_BASE=1 $(CFLAGS)
MONOLIB_CXXFLAGS = $(CPPFLAGS) /M$(__RUNTIME_LIBS)$(__DEBUGFLAG_34) $(__DEBUGFLAG_33) /Fd..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)\wx$(PORTNAME)$(WXUNIVNAME)25$(WXUNICODEFLAG)$(WXDEBUGFLAG).pdb $(__OPTIMIZEFLAG) /D__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__UNICODE_DEFINE_p) /I..\include /I..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) /I..\src\tiff /I..\src\jpeg /I..\src\png /I..\src\zlib /I..\src\regex /Fp$(OBJS)\wxprec_monolib.pch /DwxUSE_BASE=1 $(CXXFLAGS) /Yuwx/wxprec.h
OBJS = vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)
-WXEXPAT_CFLAGS = $(CPPFLAGS) /M$(__RUNTIME_LIBS)$(__DEBUGFLAG_34) $(__DEBUGFLAG_33) /Fd..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)\wxexpat$(WXDEBUGFLAG).pdb $(__OPTIMIZEFLAG) /I..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) $(CFLAGS)
+WXEXPAT_CFLAGS = $(CPPFLAGS) /M$(__RUNTIME_LIBS)$(__DEBUGFLAG_34) $(__DEBUGFLAG_33) /Fd..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)\wxexpat$(WXDEBUGFLAG).pdb $(__OPTIMIZEFLAG) /I..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) /DCOMPILED_FROM_DSP $(CFLAGS)
WXJPEG_CFLAGS = $(CPPFLAGS) /M$(__RUNTIME_LIBS)$(__DEBUGFLAG_34) $(__DEBUGFLAG_33) /Fd..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)\wxjpeg$(WXDEBUGFLAG).pdb $(__OPTIMIZEFLAG) /I..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) $(CFLAGS)
WXPNG_CFLAGS = $(CPPFLAGS) /M$(__RUNTIME_LIBS)$(__DEBUGFLAG_34) $(__DEBUGFLAG_33) /Fd..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)\wxpng$(WXDEBUGFLAG).pdb $(__OPTIMIZEFLAG) /I..\src\zlib $(CFLAGS)
WXREGEX_CFLAGS = $(CPPFLAGS) /M$(__RUNTIME_LIBS)$(__DEBUGFLAG_34) $(__DEBUGFLAG_33) /Fd..\lib\vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)\wxregex$(WXDEBUGFLAG).pdb $(__OPTIMIZEFLAG) $(CFLAGS)
diff --git a/build/makefile.wat b/build/makefile.wat
index 76c0765630..672747c316 100644
--- a/build/makefile.wat
+++ b/build/makefile.wat
@@ -263,7 +263,7 @@ MONODLL_CXXFLAGS = $(CPPFLAGS) /fh=$(OBJS)\wxprec_monodll.pch -bd $(__DEBUGFLAG_
MONOLIB_CFLAGS = $(CPPFLAGS) /fh=$(OBJS)\wxprec_monolib.pch $(__DEBUGFLAG_19) $(__OPTIMIZEFLAG) -bm $(__RUNTIME_LIBS) -d__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__UNICODE_DEFINE_p) -i=..\include -i=..\lib\wat_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) -i=..\src\tiff -i=..\src\jpeg -i=..\src\png -i=..\src\zlib -i=..\src\regex -dwxUSE_BASE=1 $(CFLAGS)
MONOLIB_CXXFLAGS = $(CPPFLAGS) /fh=$(OBJS)\wxprec_monolib.pch $(__DEBUGFLAG_19) $(__OPTIMIZEFLAG) -bm $(__RUNTIME_LIBS) -d__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__UNICODE_DEFINE_p) -i=..\include -i=..\lib\wat_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) -i=..\src\tiff -i=..\src\jpeg -i=..\src\png -i=..\src\zlib -i=..\src\regex -dwxUSE_BASE=1 $(CXXFLAGS)
OBJS = wat_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)
-WXEXPAT_CFLAGS = $(CPPFLAGS) $(__DEBUGFLAG_19) $(__OPTIMIZEFLAG) -bm $(__RUNTIME_LIBS) -i=..\lib\wat_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) $(CFLAGS)
+WXEXPAT_CFLAGS = $(CPPFLAGS) $(__DEBUGFLAG_19) $(__OPTIMIZEFLAG) -bm $(__RUNTIME_LIBS) -i=..\lib\wat_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) -dCOMPILED_FROM_DSP $(CFLAGS)
WXJPEG_CFLAGS = $(CPPFLAGS) $(__DEBUGFLAG_19) $(__OPTIMIZEFLAG) -bm $(__RUNTIME_LIBS) -i=..\lib\wat_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) $(CFLAGS)
WXPNG_CFLAGS = $(CPPFLAGS) $(__DEBUGFLAG_19) $(__OPTIMIZEFLAG) -bm $(__RUNTIME_LIBS) -i=..\src\zlib $(CFLAGS)
WXREGEX_CFLAGS = $(CPPFLAGS) $(__DEBUGFLAG_19) $(__OPTIMIZEFLAG) -bm $(__RUNTIME_LIBS) $(CFLAGS)