diff --git a/build/bakefiles/config.bkl b/build/bakefiles/config.bkl
index c8e241faa9..f1e0b5be5c 100644
--- a/build/bakefiles/config.bkl
+++ b/build/bakefiles/config.bkl
@@ -315,7 +315,7 @@ it if SHARED=1 unless you know what you are doing.
WINCE
MSW
- DOS
+ MGL
PM
$(TOOLKIT.lower())
@@ -428,4 +428,9 @@ Set the version of your Mingw installation here.
0
+
+
+ 1
+
+
diff --git a/build/bakefiles/expat.bkl b/build/bakefiles/expat.bkl
index cd783e312e..6e6925e5da 100644
--- a/build/bakefiles/expat.bkl
+++ b/build/bakefiles/expat.bkl
@@ -1,4 +1,6 @@
+
+
@@ -32,6 +34,9 @@
OS2_32
+
+ __MSDOS__
+
-w-8004 -w-8008 -w-8012 -w-8057 -w-8066
src/expat/lib/xmlparse.c
diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl
index a24db7b10e..64002664cd 100644
--- a/build/bakefiles/files.bkl
+++ b/build/bakefiles/files.bkl
@@ -1544,6 +1544,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
wx/mgl/app.h
wx/mgl/bitmap.h
wx/mgl/brush.h
+ wx/mgl/chkconf.h
wx/mgl/clipbrd.h
wx/mgl/colour.h
wx/mgl/cursor.h
diff --git a/build/bakefiles/tiff.bkl b/build/bakefiles/tiff.bkl
index bf322798cd..7a15de891a 100644
--- a/build/bakefiles/tiff.bkl
+++ b/build/bakefiles/tiff.bkl
@@ -1,4 +1,6 @@
+
+
@@ -43,6 +45,7 @@
-w-8004 -w-8012 -w-8057 -w-8060 -w-8066
-w2
OS2_32
+ __MSDOS__
$(TIFF_PLATFORM_SRC)
src/tiff/tif_aux.c
diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h
index d5766c93d3..48677540e1 100644
--- a/include/wx/chkconf.h
+++ b/include/wx/chkconf.h
@@ -25,6 +25,8 @@
# include "wx/mac/chkconf.h"
#elif defined(__OS2__)
# include "wx/os2/chkconf.h"
+#elif defined(__WXMGL__)
+# include "wx/mgl/chkconf.h"
#elif defined(__WXMOTIF__)
# include "wx/motif/chkconf.h"
#endif
diff --git a/include/wx/mgl/chkconf.h b/include/wx/mgl/chkconf.h
new file mode 100644
index 0000000000..c8664d4b73
--- /dev/null
+++ b/include/wx/mgl/chkconf.h
@@ -0,0 +1,81 @@
+/*
+ * Name: wx/mgl/chkconf.h
+ * Purpose: Compiler-specific configuration checking
+ * Author: Julian Smart
+ * Modified by:
+ * Created: 01/02/97
+ * RCS-ID: $Id$
+ * Copyright: (c) Julian Smart
+ * Licence: wxWindows licence
+ */
+
+/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
+
+#ifndef _WX_MGL_CHKCONF_H_
+#define _WX_MGL_CHKCONF_H_
+
+#ifdef __WATCOMC__
+
+/* Watcom builds for MGL port are setup.h driven and setup.h is
+ automatically generated from include/wx/setup_inc.h so we have
+ to disable here features not supported currently or enable
+ features required */
+
+#if wxUSE_STACKWALKER
+# undef wxUSE_STACKWALKER
+# define wxUSE_STACKWALKER 0
+#endif /* wxUSE_STACKWALKER */
+
+#if wxUSE_ACCEL
+# undef wxUSE_ACCEL
+# define wxUSE_ACCEL 0
+#endif /* wxUSE_ACCEL */
+
+#if wxUSE_DYNLIB_CLASS
+# undef wxUSE_DYNLIB_CLASS
+# define wxUSE_DYNLIB_CLASS 0
+#endif /* wxUSE_DYNLIB_CLASS */
+
+#if wxUSE_DYNAMIC_LOADER
+# undef wxUSE_DYNAMIC_LOADER
+# define wxUSE_DYNAMIC_LOADER 0
+#endif /* wxUSE_DYNAMIC_LOADER */
+
+#if wxUSE_ODBC
+# undef wxUSE_ODBC
+# define wxUSE_ODBC 0
+#endif /* wxUSE_ODBC */
+
+#if wxUSE_DATAOBJ
+# undef wxUSE_DATAOBJ
+# define wxUSE_DATAOBJ 0
+#endif
+
+#if wxUSE_CLIPBOARD
+# undef wxUSE_CLIPBOARD
+# define wxUSE_CLIPBOARD 0
+#endif /* wxUSE_CLIPBOARD */
+
+#if wxUSE_SOCKETS
+# undef wxUSE_SOCKETS
+# define wxUSE_SOCKETS 0
+#endif /* wxUSE_SOCKETS */
+
+#if wxUSE_PROTOCOL
+# undef wxUSE_PROTOCOL
+# define wxUSE_PROTOCOL 0
+#endif /* wxUSE_PROTOCOL */
+
+#if wxUSE_URL
+# undef wxUSE_URL
+# define wxUSE_URL 0
+#endif /* wxUSE_URL */
+
+#if wxUSE_FS_INET
+# undef wxUSE_FS_INET
+# define wxUSE_FS_INET 0
+#endif /* wxUSE_FS_INET */
+
+#endif /* __WATCOM__ */
+
+#endif /* _WX_MGL_CHKCONF_H_ */
diff --git a/include/wx/wxprec.h b/include/wx/wxprec.h
index abdb7d02a2..69178254fa 100644
--- a/include/wx/wxprec.h
+++ b/include/wx/wxprec.h
@@ -55,6 +55,11 @@
# include "wx/os2/private.h"
#endif
+// include mgl headers
+#ifdef __WXMGL__
+# include "wx/mgl/private.h"
+#endif
+
// include the most common wx headers
#include "wx/wx.h"
diff --git a/src/expat/lib/dosconfig.h b/src/expat/lib/dosconfig.h
new file mode 100644
index 0000000000..accde34e1f
--- /dev/null
+++ b/src/expat/lib/dosconfig.h
@@ -0,0 +1,25 @@
+/*================================================================
+** Copyright 2000, Clark Cooper
+** All rights reserved.
+**
+** This is free software. You are permitted to copy, distribute, or modify
+** it under the terms of the MIT/X license (contained in the COPYING file
+** with this distribution.)
+*/
+
+#ifndef DOSCONFIG_H
+#define DOSCONFIG_H
+
+#include
+#include
+
+#define XML_NS 1
+#define XML_DTD 1
+#define XML_CONTEXT_BYTES 1024
+
+/* we will assume all DOS platforms are little endian */
+#define BYTEORDER 1234
+
+#define HAVE_BCOPY
+
+#endif /* ndef DOSCONFIG_H */
diff --git a/src/expat/lib/xmlparse.c b/src/expat/lib/xmlparse.c
index 561d09523e..7dbabe8124 100644
--- a/src/expat/lib/xmlparse.c
+++ b/src/expat/lib/xmlparse.c
@@ -15,6 +15,11 @@
#include "os2config.h"
#include "expat.h"
+#elif defined(__MSDOS__)
+
+#include "dosconfig.h"
+#include "expat.h"
+
#elif defined(MACOS_CLASSIC)
#include "macconfig.h"
diff --git a/src/expat/lib/xmlrole.c b/src/expat/lib/xmlrole.c
index 73c3ae95f2..79d12d53aa 100644
--- a/src/expat/lib/xmlrole.c
+++ b/src/expat/lib/xmlrole.c
@@ -6,6 +6,8 @@
#include "winconfig.h"
#elif defined(OS2_32)
#include "os2config.h"
+#elif defined(__MSDOS__)
+#include "dosconfig.h"
#elif defined(MACOS_CLASSIC)
#include "macconfig.h"
#else
diff --git a/src/expat/lib/xmltok.c b/src/expat/lib/xmltok.c
index 9188afebf1..9ed6d0333d 100644
--- a/src/expat/lib/xmltok.c
+++ b/src/expat/lib/xmltok.c
@@ -6,6 +6,8 @@
#include "winconfig.h"
#elif defined(OS2_32)
#include "os2config.h"
+#elif defined(__MSDOS__)
+#include "dosconfig.h"
#elif defined(MACOS_CLASSIC)
#include "macconfig.h"
#else