diff -urp Mesa-3.4.2/include/GL/fxmesa.h Mesa-3.4.2a/include/GL/fxmesa.h
--- Mesa-3.4.2/include/GL/fxmesa.h	1999-11-24 20:44:53.000000000 +0200
+++ Mesa-3.4.2a/include/GL/fxmesa.h	2015-10-05 05:55:00.000000000 +0300
@@ -89,6 +89,10 @@ GLAPI int GLAPIENTRY fxQueryHardware(voi
 
 GLAPI void GLAPIENTRY fxCloseHardware(void);
 
+#ifdef __MSDOS__ /* O.S. - added for DXE3 (DJGPP 2.04+) builds */
+typedef void (*fxMesaProc) ();
+fxMesaProc fxMesaGetProcAddress (const char * sym);
+#endif
 
 #if defined (__BEOS__)
 #pragma export off
diff -urp Mesa-3.4.2/src/config.c Mesa-3.4.2a/src/config.c
--- Mesa-3.4.2/src/config.c	2000-10-17 03:24:11.000000000 +0300
+++ Mesa-3.4.2a/src/config.c	2015-10-05 05:55:00.000000000 +0300
@@ -132,6 +132,16 @@ static void skip_comment( FILE *file )
 }
 
 
+static int cfg_isspace (int c)
+{
+   switch(c) {
+   case ' ': case '\t':
+   case '\n': case '\r':
+   case '\f': case '\v': return 1;
+   }
+   return 0;
+}
+
 static struct cnode *get_word( int line, FILE *file )
 {
    int sz = 16, len = 0;
@@ -141,7 +151,7 @@ static struct cnode *get_word( int line,
       int c = getc(file);
       if (len == sz)  
 	 text = (char *) realloc( text, sizeof(char) * (sz *= 2) );
-      if (c == EOF || isspace(c) || c == ')') {
+      if (c == EOF || cfg_isspace(c) || c == ')') {
 	 struct cnode *n = MALLOC_STRUCT(cnode);
 	 ungetc(c, file);
 	 text[len] = 0;
@@ -175,7 +185,7 @@ static struct cnode *get_list( int *line
 	 n = get_list( line, file );
 	 break;
       default: 
-	 if (isspace(c)) continue;
+	 if (cfg_isspace(c)) continue;
 	 ungetc(c, file); 
 	 n = get_word( *line, file );
 	 break;
diff -urp Mesa-3.4.2/src/X86/glapi_x86.S Mesa-3.4.2a/src/X86/glapi_x86.S
--- Mesa-3.4.2/src/X86/glapi_x86.S	2000-09-06 20:35:18.000000000 +0300
+++ Mesa-3.4.2a/src/X86/glapi_x86.S	2015-10-05 05:55:00.000000000 +0300
@@ -13,10 +13,14 @@
 #define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))
 
 #ifdef GNU_ASSEMBLER
+#ifndef __MSDOS__
 #define GLOBL_FN(x) GLOBL x ; .type x,@function
 #else
 #define GLOBL_FN(x) GLOBL x
 #endif
+#else
+#define GLOBL_FN(x) GLOBL x
+#endif
 
 
 ALIGNTEXT16
diff -urNp Mesa-3.4.2/src/FX/fxapi.c Mesa-3.4.2x/src/FX/fxapi.c
--- Mesa-3.4.2/src/FX/fxapi.c	2000-09-01 01:09:20.000000000 +0300
+++ Mesa-3.4.2x/src/FX/fxapi.c	2015-10-15 10:01:10.000000000 +0300
@@ -785,6 +785,7 @@ fxMesaContext GLAPIENTRY fxMesaCreateBes
   int res,aux;
   refresh=GR_REFRESH_75Hz;
 
+#if 0
   if(getenv("SST_SCREENREFRESH")) {
     if(!strcmp(getenv("SST_SCREENREFRESH"),"60"))
       refresh=GR_REFRESH_60Hz;
@@ -805,6 +806,7 @@ fxMesaContext GLAPIENTRY fxMesaCreateBes
     if(!strcmp(getenv("SST_SCREENREFRESH"),"120"))
       refresh=GR_REFRESH_120Hz;
   }
+#endif
 
   aux=0;
   for(i=0;attribList[i]!=FXMESA_NONE;i++)
@@ -1022,7 +1024,7 @@ fxMesaContext GLAPIENTRY fxMesaCreateCon
          useBGR =  GL_FALSE;
          system = "Voodoo3";
       }
-      if (getenv("MESA_FX_INFO")) { 
+      if (verbose) {
         printf("Voodoo: Texelfx: %d / FBI Rev.: %d / TMU Rev.: %d / TMU RAM: %d\n",
                voodoo->nTexelfx,
                voodoo->fbiRev,
@@ -1036,7 +1038,7 @@ fxMesaContext GLAPIENTRY fxMesaCreateCon
    }
 #endif /*FXMESA_USE_ARGB*/
 
-   if (getenv("MESA_FX_INFO")) 
+   if(verbose)
       printf("Voodoo pixel order: %s (%s)\n", useBGR ? "BGR" : "RGB", system);
 
    fxInitPixelTables(fxMesa, useBGR);
@@ -1057,7 +1059,7 @@ fxMesaContext GLAPIENTRY fxMesaCreateCon
    
    fxMesa->needClip = 0;
 
-   if(verbose)
+   if (verbose)
       fprintf(stderr,"Voodoo Glide screen size: %dx%d\n",
               (int)FX_grSstScreenWidth(),(int)FX_grSstScreenHeight());
 
diff -urNp Mesa-3.4.2/src/FX/fxdd.c Mesa-3.4.2x/src/FX/fxdd.c
--- Mesa-3.4.2/src/FX/fxdd.c	2001-05-16 23:33:08.000000000 +0300
+++ Mesa-3.4.2x/src/FX/fxdd.c	2015-10-15 10:01:10.000000000 +0300
@@ -780,10 +780,12 @@ int fxDDInitFxMesaContext( fxMesaContext
    else
       fxMesa->maxPendingSwapBuffers=2;
    
+#if 0 /* our caller fxMesaCreateContext() already does this */
    if(getenv("MESA_FX_INFO"))
       fxMesa->verbose=GL_TRUE;
    else
       fxMesa->verbose=GL_FALSE;
+#endif
 
    fxMesa->color=0xffffffff;
    fxMesa->clearC=0;
diff -urNp Mesa-3.4.2/src/FX/fxddtex.c Mesa-3.4.2a/src/FX/fxddtex.c
--- Mesa-3.4.2/src/FX/fxddtex.c	2001-05-14 20:57:00.000000000 +0300
+++ Mesa-3.4.2a/src/FX/fxddtex.c	2015-10-05 05:55:00.000000000 +0300
@@ -217,6 +217,7 @@ _mesa_unconvert_teximage(GLint mesaForma
 }
 
 
+#if 0
 void fxPrintTextureData(tfxTexInfo *ti)
 {
   fprintf(stderr, "Texture Data:\n");
@@ -247,6 +248,7 @@ void fxPrintTextureData(tfxTexInfo *ti)
   fprintf(stderr, "\t%s\n", (ti->fixedPalette)?"Fixed palette":"Non fixed palette");
   fprintf(stderr, "\t%s\n", (ti->validated)?"Validated":"Not validated");
 }
+#endif
 
 
 /************************************************************************/
@@ -1251,6 +1253,7 @@ GLboolean fxDDTexSubImage2D(GLcontext *c
 }
 
 
+#if 0
 static void PrintTexture(int w, int h, int c, const GLubyte *data)
 {
   int i, j;
@@ -1265,6 +1268,7 @@ static void PrintTexture(int w, int h, i
     printf("\n");
   }
 }
+#endif
 
 
 GLvoid *fxDDGetTexImage(GLcontext *ctx, GLenum target, GLint level,
diff -urNp Mesa-3.4.2/src/FX/fxdrv.h Mesa-3.4.2a/src/FX/fxdrv.h
--- Mesa-3.4.2/src/FX/fxdrv.h	2000-11-05 23:24:02.000000000 +0200
+++ Mesa-3.4.2a/src/FX/fxdrv.h	2015-10-05 05:55:00.000000000 +0300
@@ -563,7 +563,9 @@ extern void fxDDClipInit(void);
 extern void fxUpdateDDSpanPointers(GLcontext *);
 extern void fxSetupDDSpanPointers(GLcontext *);
 
+#if 0
 extern void fxPrintTextureData(tfxTexInfo *ti);
+#endif
 extern GLboolean fxDDTexImage2D(GLcontext *ctx, GLenum target, GLint level,
                               GLenum format, GLenum type, const GLvoid *pixels,
                               const struct gl_pixelstore_attrib *packing,

diff -urNp Mesa-3.4.2/src/mmath.h Mesa-3.4.2x/src/mmath.h
--- Mesa-3.4.2/src/mmath.h	2000-12-13 02:57:46.000000000 +0200
+++ Mesa-3.4.2x/src/mmath.h	2015-10-11 07:55:10.000000000 +0300
@@ -239,17 +239,25 @@ do {						\
 #define IEEE_ONE 0x3f7f0000
 #endif
 
+#if defined(__GNUC__) && (__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 3))
+typedef GLint  __attribute__((__may_alias__)) __GLint_a;
+typedef GLuint __attribute__((__may_alias__)) __GLuint_a;
+#else
+typedef GLint  __GLint_a;
+typedef GLuint __GLuint_a;
+#endif
+
 #if defined(USE_IEEE) && !defined(DEBUG)
 
 #define CLAMP_FLOAT_COLOR(f)			\
 	do {					\
-	   if (*(GLuint *)&f >= IEEE_ONE)	\
-	      f = (*(GLint *)&f < 0) ? 0 : 1;	\
+	   if (*(__GLuint_a *)&f >= IEEE_ONE)	\
+	      f = (*(__GLint_a *)&f < 0) ? 0 : 1;	\
 	} while(0)
 
 #define CLAMP_FLOAT_COLOR_VALUE(f)		\
-    ( (*(GLuint *)&f >= IEEE_ONE)		\
-      ? ((*(GLint *)&f < 0) ? 0 : 1)		\
+    ( (*(__GLuint_a *)&f >= IEEE_ONE)		\
+      ? ((*(__GLint_a *)&f < 0) ? 0 : 1)		\
       : f )
 
 /* 
diff -urNp Mesa-3.4.2/src/vbfill.c Mesa-3.4.2x/src/vbfill.c
--- Mesa-3.4.2/src/vbfill.c	2001-03-23 18:28:00.000000000 +0200
+++ Mesa-3.4.2x/src/vbfill.c	2015-10-11 07:55:10.000000000 +0300
@@ -702,8 +702,8 @@ _mesa_Indexubv( const GLubyte *c )
    GET_IMMEDIATE;						\
    count = IM->Count;						\
    IM->Flag[count] |= VERT_NORM;				\
-   normal = (GLint *)IM->Normal[count];				\
-   ASSIGN_3V(normal, *(int*)&(x), *(int*)&(y), *(int*)&(z));	\
+   normal = (__GLint_a *)IM->Normal[count];				\
+   ASSIGN_3V(normal, *(__GLint_a*)&(x), *(__GLint_a*)&(y), *(__GLint_a*)&(z));	\
 }
 #else
 #define NORMALF NORMAL
@@ -834,9 +834,9 @@ _mesa_Normal3sv( const GLshort *v )
    GET_IMMEDIATE;				\
    count = IM->Count;				\
    IM->Flag[count] |= VERT_TEX0_12;		\
-   tc = (GLint *)IM->TexCoord[0][count];	\
-   *tc = *(int *)&(s);				\
-   *(tc+1) = *(int *)&(t);			\
+   tc = (__GLint_a *)IM->TexCoord[0][count];	\
+   *tc = *(__GLint_a *)&(s);				\
+   *(tc+1) = *(__GLint_a *)&(t);			\
    *(tc+2) = 0;					\
    *(tc+3) = IEEE_ONE;				\
 }
@@ -1108,13 +1108,13 @@ _mesa_TexCoord4sv( const GLshort *v )
 #define VERTEX3F(IM,x,y,z)			\
 {						\
    GLuint count = IM->Count++;			\
-   GLint *dest = (GLint *)IM->Obj[count];	\
+   __GLint_a *dest = (__GLint_a *)IM->Obj[count];	\
    IM->Flag[count] |= VERT_OBJ_23;		\
-   dest[0] = *(int *)&(x);			\
-   dest[1] = *(int *)&(y);			\
-   dest[2] = *(int *)&(z);			\
+   dest[0] = *(__GLint_a *)&(x);			\
+   dest[1] = *(__GLint_a *)&(y);			\
+   dest[2] = *(__GLint_a *)&(z);			\
    dest[3] = IEEE_ONE;				\
-   if (dest == (GLint *)IM->Obj[VB_MAX-1])	\
+   if (dest == (__GLint_a *)IM->Obj[VB_MAX-1])	\
       IM->maybe_transform_vb( IM );		\
 }
 #else
@@ -1402,9 +1402,9 @@ _mesa_Vertex4sv( const GLshort *v )
    GLint *tc;					\
    count = IM->Count;				\
    IM->Flag[count] |= IM->TF2[texSet];		\
-   tc = (GLint *)IM->TexCoord[texSet][count];	\
-   tc[0] = *(int *)&(s);			\
-   tc[1] = *(int *)&(t);			\
+   tc = (__GLint_a *)IM->TexCoord[texSet][count];	\
+   tc[0] = *(__GLint_a *)&(s);			\
+   tc[1] = *(__GLint_a *)&(t);			\
    tc[2] = 0;					\
    tc[3] = IEEE_ONE;				\
 }

diff -urNp Mesa-3.4.2/src/FX/fxdos.c Mesa-3.4.2a/src/FX/fxdos.c
--- Mesa-3.4.2/src/FX/fxdos.c	1970-01-01 02:00:00.000000000 +0200
+++ Mesa-3.4.2a/src/FX/fxdos.c	2015-10-05 05:55:00.000000000 +0300
@@ -0,0 +1,149 @@
+/* -*- mode: C; tab-width:8;  -*- */
+
+/*
+ * Mesa 3-D graphics library
+ * Version:  3.3
+ *
+ * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Mesa / 3Dfx device driver (C) 1999 David Bucciarelli, by the
+ * terms stated above.
+ *
+ * Thank you for your contribution, David!
+ *
+ * Please make note of the above copyright/license statement.  If you
+ * contributed code or bug fixes to this code under the previous (GNU
+ * Library) license and object to the new license, your code will be
+ * removed at your request.  Please see the Mesa docs/COPYRIGHT file
+ * for more information.
+ *
+ * Additional Mesa/3Dfx driver developers:
+ *   Daryll Strauss <daryll@precisioninsight.com>
+ *   Keith Whitwell <keith@precisioninsight.com>
+ *
+ * See fxapi.h for more revision/author details.
+ */
+
+
+/* fxdos.c -- for MSDOS */
+
+
+#ifdef HAVE_CONFIG_H
+#include "conf.h"
+#endif
+
+#if defined(FX) && defined(__MSDOS__)
+#include "fxdrv.h"
+#include "GL/gl.h"
+#include "GL/fxmesa.h"
+
+/* copied from fxwgl.c */
+
+struct __extensions__
+{
+  fxMesaProc  proc;
+  char  *name;
+};
+
+static struct __extensions__   ext[] = {
+#ifdef GL_EXT_polygon_offset
+   { (fxMesaProc)glPolygonOffsetEXT,			"glPolygonOffsetEXT"		},
+#endif
+   { (fxMesaProc)glBlendEquationEXT,			"glBlendEquationEXT"		},
+   { (fxMesaProc)glBlendColorEXT,			"glBlendColorExt"		},
+   { (fxMesaProc)glVertexPointerEXT,			"glVertexPointerEXT"		},
+   { (fxMesaProc)glNormalPointerEXT,			"glNormalPointerEXT"		},
+   { (fxMesaProc)glColorPointerEXT,			"glColorPointerEXT"		},
+   { (fxMesaProc)glIndexPointerEXT,			"glIndexPointerEXT"		},
+   { (fxMesaProc)glTexCoordPointerEXT,		"glTexCoordPointer"		},
+   { (fxMesaProc)glEdgeFlagPointerEXT,		"glEdgeFlagPointerEXT"		},
+   { (fxMesaProc)glGetPointervEXT,			"glGetPointervEXT"		},
+   { (fxMesaProc)glArrayElementEXT,			"glArrayElementEXT"		},
+   { (fxMesaProc)glDrawArraysEXT,			"glDrawArrayEXT"		},
+   { (fxMesaProc)glAreTexturesResidentEXT,		"glAreTexturesResidentEXT"	},
+   { (fxMesaProc)glBindTextureEXT,			"glBindTextureEXT"		},
+   { (fxMesaProc)glDeleteTexturesEXT,			"glDeleteTexturesEXT"		},
+   { (fxMesaProc)glGenTexturesEXT,			"glGenTexturesEXT"		},
+   { (fxMesaProc)glIsTextureEXT,			"glIsTextureEXT"		},
+   { (fxMesaProc)glPrioritizeTexturesEXT,		"glPrioritizeTexturesEXT"	},
+   { (fxMesaProc)glCopyTexSubImage3DEXT,		"glCopyTexSubImage3DEXT"	},
+   { (fxMesaProc)glTexImage3DEXT,			"glTexImage3DEXT"		},
+   { (fxMesaProc)glTexSubImage3DEXT,			"glTexSubImage3DEXT"		},
+   { (fxMesaProc)glColorTableEXT,			"glColorTableEXT"		},
+   { (fxMesaProc)glColorSubTableEXT,			"glColorSubTableEXT"		},
+   { (fxMesaProc)glGetColorTableEXT,			"glGetColorTableEXT"		},
+   { (fxMesaProc)glGetColorTableParameterfvEXT,	"glGetColorTableParameterfvEXT"	},
+   { (fxMesaProc)glGetColorTableParameterivEXT,	"glGetColorTableParameterivEXT"	},
+   { (fxMesaProc)glPointParameterfEXT,		"glPointParameterfEXT"		},
+   { (fxMesaProc)glPointParameterfvEXT,		"glPointParameterfvEXT"		},
+/* { (fxMesaProc)glBlendFuncSeparateINGR,		"glBlendFuncSeparateINGR"	},*/
+   { (fxMesaProc)glActiveTextureARB,                  "glActiveTextureARB"		},
+   { (fxMesaProc)glClientActiveTextureARB,            "glClientActiveTextureARB"	},
+   { (fxMesaProc)glMultiTexCoord1dARB,                "glMultiTexCoord1dARB"		},
+   { (fxMesaProc)glMultiTexCoord1dvARB,               "glMultiTexCoord1dvARB"		},
+   { (fxMesaProc)glMultiTexCoord1fARB,                "glMultiTexCoord1fARB"		},
+   { (fxMesaProc)glMultiTexCoord1fvARB,               "glMultiTexCoord1fvARB"		},
+   { (fxMesaProc)glMultiTexCoord1iARB,                "glMultiTexCoord1iARB"		},
+   { (fxMesaProc)glMultiTexCoord1ivARB,               "glMultiTexCoord1ivARB"		},
+   { (fxMesaProc)glMultiTexCoord1sARB,                "glMultiTexCoord1sARB"		},
+   { (fxMesaProc)glMultiTexCoord1svARB,               "glMultiTexCoord1svARB"		},
+   { (fxMesaProc)glMultiTexCoord2dARB,                "glMultiTexCoord2dARB"		},
+   { (fxMesaProc)glMultiTexCoord2dvARB,               "glMultiTexCoord2dvARB"		},
+   { (fxMesaProc)glMultiTexCoord2fARB,                "glMultiTexCoord2fARB"		},
+   { (fxMesaProc)glMultiTexCoord2fvARB,               "glMultiTexCoord2fvARB"		},
+   { (fxMesaProc)glMultiTexCoord2iARB,                "glMultiTexCoord2iARB"		},
+   { (fxMesaProc)glMultiTexCoord2ivARB,               "glMultiTexCoord2ivARB"		},
+   { (fxMesaProc)glMultiTexCoord2sARB,                "glMultiTexCoord2sARB"		},
+   { (fxMesaProc)glMultiTexCoord2svARB,               "glMultiTexCoord2svARB"		},
+   { (fxMesaProc)glMultiTexCoord3dARB,                "glMultiTexCoord3dARB"		},
+   { (fxMesaProc)glMultiTexCoord3dvARB,               "glMultiTexCoord3dvARB"		},
+   { (fxMesaProc)glMultiTexCoord3fARB,                "glMultiTexCoord3fARB"		},
+   { (fxMesaProc)glMultiTexCoord3fvARB,               "glMultiTexCoord3fvARB"		},
+   { (fxMesaProc)glMultiTexCoord3iARB,                "glMultiTexCoord3iARB"		},
+   { (fxMesaProc)glMultiTexCoord3ivARB,               "glMultiTexCoord3ivARB"		},
+   { (fxMesaProc)glMultiTexCoord3sARB,                "glMultiTexCoord3sARB"		},
+   { (fxMesaProc)glMultiTexCoord3svARB,               "glMultiTexCoord3svARB"		},
+   { (fxMesaProc)glMultiTexCoord4dARB,                "glMultiTexCoord4dARB"		},
+   { (fxMesaProc)glMultiTexCoord4dvARB,               "glMultiTexCoord4dvARB"		},
+   { (fxMesaProc)glMultiTexCoord4fARB,                "glMultiTexCoord4fARB"		},
+   { (fxMesaProc)glMultiTexCoord4fvARB,               "glMultiTexCoord4fvARB"		},
+   { (fxMesaProc)glMultiTexCoord4iARB,                "glMultiTexCoord4iARB"		},
+   { (fxMesaProc)glMultiTexCoord4ivARB,               "glMultiTexCoord4ivARB"		},
+   { (fxMesaProc)glMultiTexCoord4sARB,                "glMultiTexCoord4sARB"		},
+   { (fxMesaProc)glMultiTexCoord4svARB,               "glMultiTexCoord4svARB"		},
+   { (fxMesaProc)glLockArraysEXT,			"glLockArraysEXT"		},
+   { (fxMesaProc)glUnlockArraysEXT,			"glUnlockArraysEXT"		}
+};
+
+static const int qt_ext = sizeof(ext) / sizeof(ext[0]);
+
+fxMesaProc fxMesaGetProcAddress(const char * sym)
+{
+  int           i;
+
+  for(i = 0;i < qt_ext;i++) {
+    if(!strcmp(sym,ext[i].name))
+      return(ext[i].proc);
+  }
+  return NULL;
+}
+
+#endif
diff -urNp Mesa-3.4.2/src/FX/glide3x_dxe.c Mesa-3.4.2a/src/FX/glide3x_dxe.c
--- Mesa-3.4.2/src/FX/glide3x_dxe.c	1970-01-01 02:00:00.000000000 +0200
+++ Mesa-3.4.2a/src/FX/glide3x_dxe.c	2015-10-05 05:55:00.000000000 +0300
@@ -0,0 +1,176 @@
+/* C source for generating a dummy glide3x.dxe to be used when
+ * generating an import library for a dxe depending on glide3x.
+ *
+ * gcc -Wall -c glide3x.c -o glide3x.o
+ * dxe3gen -o glide3x.dxe -E _gr -E _gu -U glide3x.o
+ */
+
+/* common gr and gu symbols exported by all
+ * sst1, sst96, cvg, h3 and h5 glide3x.dxe:
+ */
+void grAADrawTriangle () {}
+void grAlphaBlendFunction () {}
+void grAlphaCombine () {}
+void grAlphaControlsITRGBLighting () {}
+void grAlphaTestFunction () {}
+void grAlphaTestReferenceValue () {}
+void grBufferClear () {}
+void grBufferSwap () {}
+void grCheckForRoom () {}
+void grChromakeyMode () {}
+void grChromakeyValue () {}
+void grClipWindow () {}
+void grColorCombine () {}
+void grColorMask () {}
+void grConstantColorValue () {}
+void grCoordinateSpace () {}
+void grCullMode () {}
+void grDepthBiasLevel () {}
+void grDepthBufferFunction () {}
+void grDepthBufferMode () {}
+void grDepthMask () {}
+void grDepthRange () {}
+void grDisable () {}
+void grDisableAllEffects () {}
+void grDitherMode () {}
+void grDrawLine () {}
+void grDrawPoint () {}
+void grDrawTriangle () {}
+void grDrawVertexArray () {}
+void grDrawVertexArrayContiguous () {}
+void grEnable () {}
+void grErrorSetCallback () {}
+void grFinish () {}
+void grFlush () {}
+void grFogColorValue () {}
+void grFogMode () {}
+void grFogTable () {}
+void grGet () {}
+void grGetProcAddress () {}
+void grGetRegistryOrEnvironmentString () {}
+void grGetString () {}
+void grGlideGetState () {}
+void grGlideGetVersion () {}
+void grGlideGetVertexLayout () {}
+void grGlideInit () {}
+void grGlideSetState () {}
+void grGlideSetVertexLayout () {}
+void grGlideShutdown () {}
+void grLfbConstantAlpha () {}
+void grLfbConstantDepth () {}
+void grLfbLock () {}
+void grLfbReadRegion () {}
+void grLfbUnlock () {}
+void grLfbWriteColorFormat () {}
+void grLfbWriteColorSwizzle () {}
+void grLfbWriteRegion () {}
+void grLoadGammaTable () {}
+void grQueryResolutions () {}
+void grRenderBuffer () {}
+void grReset () {}
+void grSelectContext () {}
+void grSetNumPendingBuffers () {}
+void grSplash () {}
+void grSstOrigin () {}
+void grSstSelect () {}
+void grSstVidMode () {}
+void grSstWinClose () {}
+void grSstWinOpen () {}
+void grTexCalcMemRequired () {}
+void grTexClampMode () {}
+void grTexCombine () {}
+void grTexDetailControl () {}
+void grTexDownloadMipMap () {}
+void grTexDownloadMipMapLevel () {}
+void grTexDownloadMipMapLevelPartial () {}
+void grTexDownloadTable () {}
+void grTexDownloadTableExt () {}
+void grTexDownloadTablePartial () {}
+void grTexFilterMode () {}
+void grTexLodBiasValue () {}
+void grTexMaxAddress () {}
+void grTexMinAddress () {}
+void grTexMipMapMode () {}
+void grTexMultibase () {}
+void grTexMultibaseAddress () {}
+void grTexNCCTable () {}
+void grTexSource () {}
+void grTexTextureMemRequired () {}
+void grTriStats () {}
+void grVertexLayout () {}
+void grViewport () {}
+void gu3dfGetInfo () {}
+void gu3dfLoad () {}
+void guFogGenerateExp () {}
+void guFogGenerateExp2 () {}
+void guFogGenerateLinear () {}
+void guFogTableIndexToW () {}
+void guGammaCorrectionRGB () {}
+
+/* external libc symbols required by all of
+ * sst1, sst96, cvg, h3 and h5 glide3x.dxe:
+ */
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <assert.h>
+#include <errno.h>
+#include <unistd.h>
+#include <time.h>
+#include <signal.h>
+#include <dos.h>
+#include <dpmi.h>
+#include <sys/nearptr.h>
+#include <setjmp.h>
+#include <crt0.h>
+long EXTSYM0000 = (long) &_crt0_startup_flags;
+long EXTSYM0001 = (long) &__dj_assert;
+long EXTSYM0002 = (long) &__djgpp_base_address;
+long EXTSYM0003 = (long) &__djgpp_nearptr_disable;
+long EXTSYM0004 = (long) &__djgpp_nearptr_enable;
+long EXTSYM0005 = (long) &__dj_stderr;
+long EXTSYM0006 = (long) &__dj_stdout;
+long EXTSYM0007 = (long) &__dpmi_free_physical_address_mapping;
+long EXTSYM0008 = (long) &__dpmi_physical_address_mapping;
+long EXTSYM0009 = (long) &atof;
+long EXTSYM0010 = (long) &atoi;
+long EXTSYM0011 = (long) &atol;
+long EXTSYM0012 = (long) &clock;
+long EXTSYM0013 = (long) &exit;
+long EXTSYM0014 = (long) &fclose;
+long EXTSYM0015 = (long) &fflush;
+long EXTSYM0016 = (long) &fgetc;
+long EXTSYM0017 = (long) &fgets;
+long EXTSYM0018 = (long) &fopen;
+long EXTSYM0019 = (long) &fprintf;
+long EXTSYM0020 = (long) &fread;
+long EXTSYM0021 = (long) &free;
+long EXTSYM0022 = (long) &fwrite;
+long EXTSYM0023 = (long) &getc;
+long EXTSYM0024 = (long) &getenv;
+long EXTSYM0025 = (long) &int86;
+long EXTSYM0026 = (long) &longjmp;
+long EXTSYM0027 = (long) &malloc;
+long EXTSYM0028 = (long) &memcpy;
+long EXTSYM0029 = (long) &memset;
+long EXTSYM0030 = (long) &pow;
+long EXTSYM0031 = (long) &printf;
+long EXTSYM0032 = (long) &putenv;
+long EXTSYM0033 = (long) &puts;
+long EXTSYM0034 = (long) &setjmp;
+long EXTSYM0035 = (long) &signal;
+long EXTSYM0036 = (long) &sprintf;
+long EXTSYM0037 = (long) &sscanf;
+long EXTSYM0038 = (long) &strcat;
+long EXTSYM0039 = (long) &strchr;
+long EXTSYM0040 = (long) &strcmp;
+long EXTSYM0041 = (long) &strcpy;
+long EXTSYM0042 = (long) &strncat;
+long EXTSYM0043 = (long) &strncpy;
+long EXTSYM0044 = (long) &strtok;
+long EXTSYM0045 = (long) &strtoul;
+long EXTSYM0046 = (long) &usleep;
+long EXTSYM0047 = (long) &vfprintf;
+long EXTSYM0048 = (long) &vsprintf;
+
diff -urNp Mesa-3.4.2/src/Makefile.dxe Mesa-3.4.2a/src/Makefile.dxe
--- Mesa-3.4.2/src/Makefile.dxe	1970-01-01 02:00:00.000000000 +0200
+++ Mesa-3.4.2a/src/Makefile.dxe	2015-10-05 05:55:10.000000000 +0300
@@ -0,0 +1,186 @@
+# Mesa 3-D graphics library
+# Version:  3.4
+# Copyright (C) 1995-2000  Brian Paul
+
+# Makefile for fxMesa gl.dxe (DJGPP 2.04 and newer)
+
+.INTERMEDIATE: glide3x.dxe
+
+INCDIR = ../include
+LIBDIR = ../lib
+G3DIR  = ../glide3
+
+GL_LIB = libgl.a
+GL_DXE = gl.dxe
+GL_IMP = libigl.a
+LIBNAME="fxMesa-v3.4"
+
+CC = gcc
+AR = ar
+
+CFLAGS = -O2 -mtune=i586 -ffast-math -fomit-frame-pointer \
+	-DFX -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_KATMAI_ASM -IFX/X86 \
+	-DFX_GLIDE3 -I$(G3DIR)/include -I. -I$(INCDIR)
+
+ARFLAGS = rus
+
+CORE_SOURCES = \
+	aatriangle.c \
+	accum.c \
+	alpha.c \
+	alphabuf.c \
+	attrib.c \
+	bbox.c \
+	bitmap.c \
+	blend.c \
+	buffers.c \
+	clip.c \
+	colortab.c \
+	config.c \
+	context.c \
+	copypix.c \
+	cva.c \
+	debug_xform.c \
+	depth.c \
+	dispatch.c \
+	dlist.c \
+	drawpix.c \
+	enable.c \
+	enums.c \
+	eval.c \
+	extensions.c \
+	feedback.c \
+	fog.c \
+	get.c \
+	glapi.c \
+	glapinoop.c \
+	glthread.c \
+	hash.c \
+	hint.c \
+	image.c \
+	imaging.c \
+	light.c \
+	lines.c \
+	logic.c \
+	masking.c \
+	matrix.c \
+	mem.c \
+	mmath.c \
+	pb.c \
+	pipeline.c \
+	pixel.c \
+	pixeltex.c \
+	points.c \
+	polygon.c \
+	quads.c \
+	rastpos.c \
+	readpix.c \
+	rect.c \
+	scissor.c \
+	shade.c \
+	span.c \
+	stages.c \
+	state.c \
+	stencil.c \
+	texformat.c \
+	teximage.c \
+	texobj.c \
+	texstate.c \
+	texture.c \
+	texutil.c \
+	translate.c \
+	triangle.c \
+	varray.c \
+	vb.c \
+	vbcull.c \
+	vbfill.c \
+	vbindirect.c \
+	vbrender.c \
+	vbxform.c \
+	vector.c \
+	vertices.c \
+	winpos.c \
+	xform.c \
+	zoom.c \
+	X86/x86.c \
+	X86/common_x86.c \
+	X86/3dnow.c \
+	X86/katmai.c
+
+DRIVER_SOURCES = \
+	FX/fxapi.c \
+	FX/fxdos.c \
+	FX/fxclip.c \
+	FX/fxcva.c \
+	FX/fxdd.c \
+	FX/fxddspan.c \
+	FX/fxddtex.c \
+	FX/fxfastpath.c \
+	FX/fxpipeline.c \
+	FX/fxrender.c \
+	FX/fxsanity.c \
+	FX/fxsetup.c \
+	FX/fxtexman.c \
+	FX/fxtrifuncs.c \
+	FX/fxvsetup.c \
+	FX/fxglidew.c
+
+ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \
+	X86/x86_xform_raw2.S X86/x86_xform_raw3.S \
+	X86/x86_xform_raw4.S X86/x86_xform_masked2.S \
+	X86/x86_xform_masked3.S X86/x86_xform_masked4.S \
+	X86/x86_cliptest.S X86/x86_vertex.S \
+	X86/mmx_blend.S \
+	X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \
+	X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \
+	X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \
+	X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \
+	X86/3dnow_norm_raw.S X86/3dnow_vertex.S \
+	FX/X86/fx_3dnow_fastpath.S \
+	X86/katmai_xform_raw1.S X86/katmai_xform_masked1.S \
+	X86/katmai_xform_raw2.S X86/katmai_xform_masked2.S \
+	X86/katmai_xform_raw3.S X86/katmai_xform_masked3.S \
+	X86/katmai_xform_raw4.S X86/katmai_xform_masked4.S \
+	X86/katmai_norm_raw.S X86/katmai_vertex.S
+
+ADDITIONAL_OBJ =
+
+OBJECTS = $(ASM_SOURCES:.S=.o) \
+	$(CORE_SOURCES:.c=.o) \
+	$(DRIVER_SOURCES:.c=.o) \
+	$(ADDITIONAL_OBJ)
+
+
+##### RULES #####
+
+.c.o:
+	$(CC) -c $(CFLAGS) $< -o $@
+.S.o:
+	$(CC) -c $(CFLAGS) $< -o $@
+
+##### TARGETS #####
+
+all: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP)
+
+clean:
+	rm -f *.o X86/*.o FX/*.o FX/X86/*.o
+realclean: clean
+	rm -f $(LIBDIR)/*.a $(LIBDIR)/*.dxe
+
+$(LIBDIR):
+	-mkdir $(LIBDIR)
+
+$(LIBDIR)/$(GL_LIB): $(LIBDIR) $(OBJECTS)
+	$(AR) $(ARFLAGS) $@  $(OBJECTS)
+
+$(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP): $(LIBDIR) $(OBJECTS)
+$(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP): glide3x.dxe
+	-dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -X _gl_ -E _fxMesa -E _fxQuery -E _fxClose -P glide3x.dxe -U $(OBJECTS)
+
+# dxe3gen needs glide3x.dxe when generating the import lib libigl.a.
+# so we generate a dummy glide3x.dxe to cover common glide3x exports
+# and all possible libc dependencies:
+FX/glide3x_dxe.o: FX/glide3x_dxe.c
+	$(CC) -O0 -Wall -o $@ -c $<
+glide3x.dxe: FX/glide3x_dxe.o
+	-dxe3gen -o glide3x.dxe -E _gr -E _gu -U $<
