Only in Mesa-3.4.2x: glide
Only in Mesa-3.4.2x: glide3/lib
diff -urNp Mesa-3.4.2/glide3/include/3dfx.h Mesa-3.4.2x/glide3/include/3dfx.h
--- Mesa-3.4.2/glide3/include/3dfx.h	2015-08-20 05:55:00.000000000 +0300
+++ Mesa-3.4.2x/glide3/include/3dfx.h	2015-11-11 07:11:00.000000000 +0200
@@ -30,7 +30,7 @@ typedef unsigned char   FxU8;
 typedef signed   char   FxI8;
 typedef unsigned short  FxU16;
 typedef signed   short  FxI16;
-#ifdef __DJGPP__
+#if defined(__DJGPP__)||defined(_WIN32)
 typedef signed   long   FxI32;
 typedef unsigned long   FxU32;
 #else
diff -urNp Mesa-3.4.2/include/GL/gl.h Mesa-3.4.2x/include/GL/gl.h
--- Mesa-3.4.2/include/GL/gl.h	2001-03-21 17:59:49.000000000 +0200
+++ Mesa-3.4.2x/include/GL/gl.h	2016-05-02 01:55:50.000000000 +0300
@@ -49,9 +49,9 @@
 #endif
 
 #if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
-#  if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
+#  if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
 #    define GLAPI __declspec(dllexport)
-#  elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
+#  elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
 #    define GLAPI __declspec(dllimport)
 #  else /* for use with static link lib build of Win32 edition only */
 #    define GLAPI extern
@@ -64,7 +64,7 @@
 #endif /* WIN32 / CYGWIN bracket */
 
 #if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__)
-#include <gl/mesa_wgl.h>
+#include <GL/mesa_wgl.h>
 #endif
 
 #if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
diff -urNp Mesa-3.4.2/include/GL/mesa_wgl.h Mesa-3.4.2x/include/GL/mesa_wgl.h
--- Mesa-3.4.2/include/GL/mesa_wgl.h	2000-11-20 19:31:51.000000000 +0200
+++ Mesa-3.4.2x/include/GL/mesa_wgl.h	2016-05-02 01:55:50.000000000 +0300
@@ -33,7 +33,7 @@
 
 
 #include <windows.h>
-#include <gl/gl.h>
+#include <GL/gl.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -41,10 +41,10 @@ extern "C" {
 
 
 #if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__))
-#  if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
+#  if (defined(_MSC_VER)||defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
 #    define GLAPI __declspec(dllexport)
 #    define WGLAPI __declspec(dllexport)
-#  elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
+#  elif (defined(_MSC_VER)||defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
 #    define GLAPI __declspec(dllimport)
 #    define WGLAPI __declspec(dllimport)
 #  else /* for use with static link lib build of Win32 edition only */
diff -urNp Mesa-3.4.2/include/GL/wmesa.h Mesa-3.4.2x/include/GL/wmesa.h
--- Mesa-3.4.2/include/GL/wmesa.h	1999-08-19 03:55:40.000000000 +0300
+++ Mesa-3.4.2x/include/GL/wmesa.h	2016-05-02 01:55:50.000000000 +0300
@@ -69,7 +69,7 @@ extern "C" {
 #endif
 
 
-#include "gl\gl.h"
+#include "GL/gl.h"
 
 #pragma warning (disable:4273)
 #pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
diff -urNp Mesa-3.4.2/src/context.c Mesa-3.4.2x/src/context.c
--- Mesa-3.4.2/src/context.c	2016-03-18 18:01:10.000000000 +0200
+++ Mesa-3.4.2x/src/context.c	2016-05-02 01:55:50.000000000 +0300
@@ -1670,7 +1670,7 @@ gl_destroy_context( GLcontext *ctx )
 void
 gl_context_initialize( GLcontext *ctx )
 {
-#ifndef __MSDOS__
+#if !(defined(__MSDOS__) || defined(_WIN32))
    gl_read_config_file( ctx );
 #endif
 }
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	2016-05-02 01:55:50.000000000 +0300
+++ Mesa-3.4.2x/src/FX/fxapi.c	2016-05-02 01:56:00.000000000 +0300
@@ -1375,7 +1375,7 @@ int GLAPIENTRY fxQueryHardware(void)
     glbGlideInitialized = 1;
 
 #if defined(__WIN32__)
-    onexit((_onexit_t)cleangraphics);
+    _onexit((_onexit_t)cleangraphics);
 #elif defined(__linux__)
     /* Only register handler if environment variable is not defined. */
     if (!getenv("MESA_FX_NO_SIGNALS")) {
diff -urNp Mesa-3.4.2/src/FX/fx.rc Mesa-3.4.2x/src/FX/fx.rc
--- Mesa-3.4.2/src/FX/fx.rc	1970-01-01 02:00:00.000000000 +0200
+++ Mesa-3.4.2x/src/FX/fx.rc	2016-05-02 01:55:50.000000000 +0300
@@ -0,0 +1,40 @@
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#define PRODNAME                "Mesa 3.4"
+#define CONTACTSTR              "http://www.mesa3d.org"
+#define HWSTR                   "3dfx Voodoo Graphics, Voodoo Rush, Voodoo^2, Voodoo Banshee, Velocity 100/200, Voodoo3, Voodoo4, Voodoo5"
+#define COPYRIGHTSTR            "Copyright \251 Brian E. Paul"
+
+#define VERSIONSTR              "3.4.0.3"
+#define MANVERSION              3
+#define MANREVISION             4
+#define BUILD_NUMBER            3
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION MANVERSION, MANREVISION, 0, BUILD_NUMBER
+ PRODUCTVERSION MANVERSION, MANREVISION, 0, BUILD_NUMBER
+ FILEFLAGSMASK 0x0030003FL
+
+ FILEOS VOS_DOS_WINDOWS32
+ FILETYPE VFT_DRV
+ FILESUBTYPE VFT2_DRV_INSTALLABLE
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904E4"
+        BEGIN
+            VALUE "FileDescription", PRODNAME
+            VALUE "FileVersion", VERSIONSTR
+            VALUE "LegalCopyright", COPYRIGHTSTR
+            VALUE "ProductName", PRODNAME
+            VALUE "Graphics Subsystem", HWSTR
+            VALUE "Contact", CONTACTSTR
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        /* the following line should be extended for localized versions */
+        VALUE "Translation", 0x409, 1252
+    END
+END
diff -urNp Mesa-3.4.2/src/FX/fxwgl.c Mesa-3.4.2x/src/FX/fxwgl.c
--- Mesa-3.4.2/src/FX/fxwgl.c	2016-03-27 07:11:10.000000000 +0300
+++ Mesa-3.4.2x/src/FX/fxwgl.c	2016-05-05 07:11:00.000000000 +0300
@@ -156,7 +156,7 @@ static struct __extensions__   ext[] = {
 
 static int qt_ext = sizeof(ext) / sizeof(ext[0]);
 
-struct __pixelformat__  pix[] =
+static struct __pixelformat__  pix[] =
 {
   /* None */
   {
@@ -255,10 +255,10 @@ static BITMAPINFO  *dibBMI;
 static HBITMAP     dibHBM;
 static HWND        dibWnd;
 
-LONG GLAPIENTRY __wglMonitor(HWND hwnd,UINT message,UINT wParam,LONG lParam)
-
+static LRESULT WINAPI
+__wglMonitor(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
-  long ret; /* Now gives the resized window at the end to hWNDOldProc */
+  LRESULT  ret; /* Now gives the resized window at the end to hWNDOldProc */
 
   if(ctx && hwnd == hWND) {
     switch(message) {
@@ -267,6 +267,7 @@ LONG GLAPIENTRY __wglMonitor(HWND hwnd,U
       break;
     case WM_DISPLAYCHANGE:
     case WM_SIZE:
+#ifndef FX_GLIDE3
       if (wParam != SIZE_MINIMIZED) {
         static int moving = 0;
         if (!moving) {
@@ -281,13 +282,13 @@ LONG GLAPIENTRY __wglMonitor(HWND hwnd,U
               }
             }
           }
-
           /* Do the clipping in the glide library */
           FX_grClipWindow(0,0,FX_grSstScreenWidth(),FX_grSstScreenHeight());
           /* And let the new size set in the context */
           fxMesaUpdateScreenSize(ctx);
         }
       }
+#endif
       break;
     case WM_ACTIVATE:
       if((fxQueryHardware()==GR_SSTTYPE_VOODOO) &&
@@ -326,12 +327,14 @@ LONG GLAPIENTRY __wglMonitor(HWND hwnd,U
   return(ret);
 }
 
-BOOL GLAPIENTRY wglCopyContext(HGLRC hglrcSrc,HGLRC hglrcDst,UINT mask)
+GLAPI BOOL GLAPIENTRY
+wglCopyContext(HGLRC hglrcSrc,HGLRC hglrcDst,UINT mask)
 {
   return(FALSE);
 }
 
-HGLRC GLAPIENTRY wglCreateContext(HDC hdc)
+GLAPI HGLRC GLAPIENTRY
+wglCreateContext(HDC hdc)
 {
   HWND hWnd;
   WNDPROC oldProc;
@@ -447,13 +450,15 @@ HGLRC GLAPIENTRY wglCreateContext(HDC hd
   return((HGLRC)1);
 }
 
-HGLRC GLAPIENTRY wglCreateLayerContext(HDC hdc,int iLayerPlane)
+GLAPI HGLRC GLAPIENTRY
+wglCreateLayerContext(HDC hdc,int iLayerPlane)
 {
   SetLastError(0);
   return(NULL);
 }
 
-BOOL GLAPIENTRY wglDeleteContext(HGLRC hglrc)
+GLAPI BOOL GLAPIENTRY
+wglDeleteContext(HGLRC hglrc)
 {
   if(ctx && hglrc == (HGLRC)1) {
     if (gdiWindowHackEna) {
@@ -480,7 +485,8 @@ BOOL GLAPIENTRY wglDeleteContext(HGLRC h
   return(FALSE);
 }
 
-HGLRC GLAPIENTRY wglGetCurrentContext(VOID)
+GLAPI HGLRC GLAPIENTRY
+wglGetCurrentContext(VOID)
 {
   if(ctx)
     return((HGLRC)1);
@@ -489,7 +495,8 @@ HGLRC GLAPIENTRY wglGetCurrentContext(VO
   return(NULL);
 }
 
-HDC GLAPIENTRY wglGetCurrentDC(VOID)
+GLAPI HDC GLAPIENTRY
+wglGetCurrentDC(VOID)
 {
   if(ctx)
     return(hDC);
@@ -498,7 +505,8 @@ HDC GLAPIENTRY wglGetCurrentDC(VOID)
   return(NULL);
 }
 
-PROC GLAPIENTRY wglGetProcAddress(LPCSTR lpszProc)
+GLAPI PROC GLAPIENTRY
+wglGetProcAddress(LPCSTR lpszProc)
 {
   int           i;
 
@@ -516,7 +524,8 @@ PROC GLAPIENTRY wglGetProcAddress(LPCSTR
   return(NULL);
 }
 
-BOOL GLAPIENTRY wglMakeCurrent(HDC hdc,HGLRC hglrc)
+GLAPI BOOL GLAPIENTRY
+wglMakeCurrent(HDC hdc,HGLRC hglrc)
 {
   if((hdc==NULL) && (hglrc==NULL))
     return(TRUE);
@@ -533,7 +542,8 @@ BOOL GLAPIENTRY wglMakeCurrent(HDC hdc,H
   return(TRUE);
 }
 
-BOOL GLAPIENTRY wglShareLists(HGLRC hglrc1,HGLRC hglrc2)
+GLAPI BOOL GLAPIENTRY
+wglShareLists(HGLRC hglrc1,HGLRC hglrc2)
 {
   if(!ctx || hglrc1 != (HGLRC)1 || hglrc1 != hglrc2) {
     SetLastError(0);
@@ -543,7 +553,8 @@ BOOL GLAPIENTRY wglShareLists(HGLRC hglr
   return(TRUE);
 }
 
-BOOL GLAPIENTRY wglUseFontBitmaps(HDC fontDevice, DWORD firstChar, DWORD numChars, DWORD listBase)
+GLAPI BOOL GLAPIENTRY
+wglUseFontBitmaps(HDC fontDevice, DWORD firstChar, DWORD numChars, DWORD listBase)
 {
 #define VERIFY(a) a
 
@@ -645,31 +656,35 @@ BOOL GLAPIENTRY wglUseFontBitmaps(HDC fo
 #undef VERIFY
 }
 
-BOOL GLAPIENTRY wglUseFontBitmapsW(HDC hdc,DWORD first,DWORD count,DWORD listBase)
+GLAPI BOOL GLAPIENTRY
+wglUseFontBitmapsW(HDC hdc,DWORD first,DWORD count,DWORD listBase)
 {
   return(FALSE);
 }
 
-BOOL GLAPIENTRY wglUseFontOutlinesA(HDC hdc,DWORD first,DWORD count,
-                                  DWORD listBase,FLOAT deviation,
-                                  FLOAT extrusion,int format,
-                                  LPGLYPHMETRICSFLOAT lpgmf)
+GLAPI BOOL GLAPIENTRY
+wglUseFontOutlinesA(HDC hdc,DWORD first,DWORD count,
+                    DWORD listBase,FLOAT deviation,
+                    FLOAT extrusion,int format,
+                    LPGLYPHMETRICSFLOAT lpgmf)
 {
   SetLastError(0);
   return(FALSE);
 }
 
-BOOL GLAPIENTRY wglUseFontOutlinesW(HDC hdc,DWORD first,DWORD count,
-                                  DWORD listBase,FLOAT deviation,
-                                  FLOAT extrusion,int format,
-                                  LPGLYPHMETRICSFLOAT lpgmf)
+GLAPI BOOL GLAPIENTRY
+wglUseFontOutlinesW(HDC hdc,DWORD first,DWORD count,
+                    DWORD listBase,FLOAT deviation,
+                    FLOAT extrusion,int format,
+                    LPGLYPHMETRICSFLOAT lpgmf)
 {
   SetLastError(0);
   return(FALSE);
 }
 
 
-BOOL GLAPIENTRY wglSwapLayerBuffers(HDC hdc,UINT fuPlanes)
+GLAPI BOOL GLAPIENTRY
+wglSwapLayerBuffers(HDC hdc,UINT fuPlanes)
 {
   if(ctx && WindowFromDC(hdc) == hWND) {
     fxMesaSwapBuffers();
@@ -681,8 +696,8 @@ BOOL GLAPIENTRY wglSwapLayerBuffers(HDC 
   return(FALSE);
 }
 
-int GLAPIENTRY wglChoosePixelFormat(HDC hdc,
-                                  CONST PIXELFORMATDESCRIPTOR *ppfd)
+GLAPI int GLAPIENTRY
+wglChoosePixelFormat(HDC hdc, CONST PIXELFORMATDESCRIPTOR *ppfd)
 {
   int i,best=-1,qt_valid_pix;
 
@@ -729,14 +744,15 @@ int GLAPIENTRY wglChoosePixelFormat(HDC 
   return(best);
 }
 
-int GLAPIENTRY ChoosePixelFormat(HDC hdc,
-			       CONST PIXELFORMATDESCRIPTOR *ppfd)
+GLAPI int GLAPIENTRY
+ChoosePixelFormat(HDC hdc, CONST PIXELFORMATDESCRIPTOR *ppfd)
 {
   return wglChoosePixelFormat(hdc,ppfd);
 }
 
-int GLAPIENTRY wglDescribePixelFormat(HDC hdc,int iPixelFormat,UINT nBytes,
-                                    LPPIXELFORMATDESCRIPTOR ppfd)
+GLAPI int GLAPIENTRY
+wglDescribePixelFormat(HDC hdc,int iPixelFormat,UINT nBytes,
+                       LPPIXELFORMATDESCRIPTOR ppfd)
 {
   int qt_valid_pix;
 
@@ -754,13 +770,14 @@ int GLAPIENTRY wglDescribePixelFormat(HD
   return(qt_valid_pix);
 }
 
-int GLAPIENTRY DescribePixelFormat(HDC hdc,int iPixelFormat,UINT nBytes,
-				 LPPIXELFORMATDESCRIPTOR ppfd)
+GLAPI int GLAPIENTRY
+DescribePixelFormat(HDC hdc,int iPixelFormat,UINT nBytes,
+		    LPPIXELFORMATDESCRIPTOR ppfd)
 {
   return wglDescribePixelFormat(hdc,iPixelFormat,nBytes,ppfd);
 }
 
-int GLAPIENTRY wglGetPixelFormat(HDC hdc)
+GLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc)
 {
   if(curPFD == 0) {
     SetLastError(0);
@@ -770,13 +787,14 @@ int GLAPIENTRY wglGetPixelFormat(HDC hdc
   return(curPFD);
 }
 
-int GLAPIENTRY GetPixelFormat(HDC hdc)
+GLAPI int GLAPIENTRY GetPixelFormat(HDC hdc)
 {
   return wglGetPixelFormat(hdc);
 }
 
-BOOL GLAPIENTRY wglSetPixelFormat(HDC hdc,int iPixelFormat,
-                                CONST PIXELFORMATDESCRIPTOR *ppfd)
+GLAPI BOOL GLAPIENTRY
+wglSetPixelFormat(HDC hdc,int iPixelFormat,
+                  CONST PIXELFORMATDESCRIPTOR *ppfd)
 {
   int qt_valid_pix;
 
@@ -791,7 +809,7 @@ BOOL GLAPIENTRY wglSetPixelFormat(HDC hd
   return(TRUE);
 }
 
-BOOL GLAPIENTRY wglSwapBuffers(HDC hdc)
+GLAPI BOOL GLAPIENTRY wglSwapBuffers(HDC hdc)
 {
   if(!ctx) {
     SetLastError(0);
@@ -856,13 +874,14 @@ BOOL GLAPIENTRY wglSwapBuffers(HDC hdc)
   return(TRUE);
 }
 
-BOOL GLAPIENTRY SetPixelFormat(HDC hdc, int iPixelFormat,
-                             CONST PIXELFORMATDESCRIPTOR *ppfd)
+GLAPI BOOL GLAPIENTRY
+SetPixelFormat(HDC hdc, int iPixelFormat,
+               CONST PIXELFORMATDESCRIPTOR *ppfd)
 {
   return wglSetPixelFormat(hdc,iPixelFormat,ppfd);
 }
 
-BOOL GLAPIENTRY SwapBuffers(HDC hdc)
+GLAPI BOOL GLAPIENTRY SwapBuffers(HDC hdc)
 {
   return wglSwapBuffers(hdc);
 }
diff -urNp Mesa-3.4.2/src/glheader.h Mesa-3.4.2x/src/glheader.h
--- Mesa-3.4.2/src/glheader.h	2000-12-13 02:54:57.000000000 +0200
+++ Mesa-3.4.2x/src/glheader.h	2016-05-02 01:55:50.000000000 +0300
@@ -90,10 +90,10 @@
 #    pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */
 #    pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
 #  endif
-#  if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
+#  if (defined(_MSC_VER)||defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
 #    define GLAPI __declspec(dllexport)
 #    define WGLAPI __declspec(dllexport)
-#  elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
+#  elif (defined(_MSC_VER)||defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
 #    define GLAPI __declspec(dllimport)
 #    define WGLAPI __declspec(dllimport)
 #  else /* for use with static link lib build of Win32 edition only */
@@ -156,7 +156,7 @@ typedef struct tagLAYERPLANEDESCRIPTOR L
 typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
 typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
 #if !defined(GLX_USE_MESA)
-#include <gl/mesa_wgl.h>
+#include <GL/mesa_wgl.h>
 #endif
 #endif
 
diff -urNp Mesa-3.4.2/src/Makefile.win32 Mesa-3.4.2x/src/Makefile.win32
--- Mesa-3.4.2/src/Makefile.win32	1970-01-01 02:00:00.000000000 +0200
+++ Mesa-3.4.2x/src/Makefile.win32	2016-05-02 01:55:50.000000000 +0300
@@ -0,0 +1,196 @@
+# Mesa 3-D graphics library
+# Version:  3.4
+# Copyright (C) 1995-2000  Brian Paul
+
+# standalone Makefile for fxMesa opengl32.dll
+# builds normally for Glide3x
+# to build for Glide2x:  make GLIDE3=0
+
+INCDIR = ../include
+LIBDIR = ../lib
+#build for glide3
+GLIDE3 = 1
+ifneq ($(GLIDE3),1)
+GLIDEDIR=../glide
+GLIDELIB=glide2x
+else
+GLIDEDIR=../glide3
+GLIDELIB=glide3x
+endif
+
+GL_LIB = opengl32.dll
+
+CC = gcc
+RC = windres
+LD = $(CC)
+
+CFLAGS = -O2 -mtune=i586 -ffast-math -fomit-frame-pointer \
+	-DBUILD_GL32 -DFX_SILENT -DNO_PARALLEL -DNO_STEREO \
+	-DFX -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_KATMAI_ASM -IFX/X86 \
+	-I$(GLIDEDIR)/include -I. -I$(INCDIR)
+CFLAGS+= -DNDEBUG
+ifeq ($(GLIDE3),1)
+CFLAGS+= -DFX_GLIDE3
+endif
+RCFLAGS= --output-format=coff
+
+LDFLAGS = -shared -mwindows -Wl,--no-undefined -Wl,--enable-auto-image-base -Wl,--kill-at -Wl,-enable-stdcall-fixup
+LDLIBS = -L$(GLIDEDIR)/lib -l$(GLIDELIB)
+
+CORE_SOURCES = \
+	aatriangle.c \
+	accum.c \
+	alpha.c \
+	alphabuf.c \
+	attrib.c \
+	bitmap.c \
+	blend.c \
+	buffers.c \
+	clip.c \
+	colortab.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
+#	bbox.c 
+#	config.c 
+
+DRIVER_SOURCES = \
+	OSmesa/osmesa.c \
+	FX/fxapi.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 \
+	FX/fxwgl.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
+
+RESOURCE= FX/fx.rc
+DLL_DEF = FX/fxopengl.def
+
+ADDITIONAL_OBJ =
+
+OBJECTS = $(ASM_SOURCES:.S=.o) \
+	$(CORE_SOURCES:.c=.o) \
+	$(DRIVER_SOURCES:.c=.o) \
+	$(RESOURCE:.rc=.res) \
+	$(ADDITIONAL_OBJ)
+
+
+##### RULES #####
+
+.c.o:
+	$(CC) -c $(CFLAGS) $< -o $@
+.S.o:
+	$(CC) -c $(CFLAGS) $< -o $@
+
+##### TARGETS #####
+
+all: $(LIBDIR)/$(GL_LIB)
+
+clean:
+	rm -f *.o X86/*.o FX/*.o FX/X86/*.o FX/*.res Windows/*.o OSmesa/*.o
+realclean: clean
+	rm -f $(LIBDIR)/*.a $(LIBDIR)/*.dll
+
+$(LIBDIR):
+	-mkdir $(LIBDIR)
+
+$(LIBDIR)/$(GL_LIB): $(LIBDIR) $(OBJECTS) $(DLL_DEF)
+	$(LD) $(LDFLAGS) -o $@ $(OBJECTS) $(DLL_DEF) $(LDLIBS)
+
+FX/fx.res: FX/fx.rc
+	$(RC) $(RCFLAGS) -o $@ $<
+
diff -urNp Mesa-3.4.2/src/OSmesa/osmesa.c Mesa-3.4.2x/src/OSmesa/osmesa.c
--- Mesa-3.4.2/src/OSmesa/osmesa.c	2001-02-09 01:51:27.000000000 +0200
+++ Mesa-3.4.2x/src/OSmesa/osmesa.c	2016-05-02 01:55:50.000000000 +0300
@@ -1201,7 +1201,7 @@ static void flat_rgba_line( GLcontext *c
 #define PLOT(X,Y) { GLuint *ptr4 = PIXELADDR4(X,Y); *ptr4 = pixel; }
 
 #ifdef WIN32
-#include "..\linetemp.h"
+#include "../linetemp.h"
 #else
 #include "linetemp.h"
 #endif
@@ -1230,7 +1230,7 @@ static void flat_rgba_z_line( GLcontext 
 	}
 
 #ifdef WIN32
-#include "..\linetemp.h"
+#include "../linetemp.h"
 #else
 #include "linetemp.h"
 #endif
@@ -1266,7 +1266,7 @@ static void flat_blend_rgba_line( GLcont
    }
 
 #ifdef WIN32
-#include "..\linetemp.h"
+#include "../linetemp.h"
 #else
 #include "linetemp.h"
 #endif
@@ -1305,7 +1305,7 @@ static void flat_blend_rgba_z_line( GLco
 	}
 
 #ifdef WIN32
-#include "..\linetemp.h"
+#include "../linetemp.h"
 #else
 #include "linetemp.h"
 #endif
@@ -1345,7 +1345,7 @@ static void flat_blend_rgba_z_line_write
 	}
 
 #ifdef WIN32
-#include "..\linetemp.h"
+#include "../linetemp.h"
 #else
 #include "linetemp.h"
 #endif
@@ -1489,7 +1489,7 @@ static void smooth_rgba_z_triangle( GLco
    }								\
 }
 #ifdef WIN32
-#include "..\tritemp.h"
+#include "../tritemp.h"
 #else
 #include "tritemp.h"
 #endif
@@ -1528,7 +1528,7 @@ static void flat_rgba_z_triangle( GLcont
    }					\
 }
 #ifdef WIN32
-#include "..\tritemp.h"
+#include "../tritemp.h"
 #else
 #include "tritemp.h"
 #endif
diff -urNp Mesa-3.4.2/src/Windows/colors.h Mesa-3.4.2x/src/Windows/colors.h
--- Mesa-3.4.2/src/Windows/colors.h	1999-08-19 03:55:42.000000000 +0300
+++ Mesa-3.4.2x/src/Windows/colors.h	2016-05-02 01:55:50.000000000 +0300
@@ -496,4 +496,4 @@ char unsigned const aWinGHalftoneTransla
   225,
   226,
   255,
-};
\ No newline at end of file
+};
diff -urNp Mesa-3.4.2/src/Windows/mesa_extend.h Mesa-3.4.2x/src/Windows/mesa_extend.h
--- Mesa-3.4.2/src/Windows/mesa_extend.h	1999-08-19 03:55:42.000000000 +0300
+++ Mesa-3.4.2x/src/Windows/mesa_extend.h	2016-05-02 01:55:50.000000000 +0300
@@ -13,7 +13,7 @@
 #include <windows.h>
 #include <winbase.h>
 
-typedef enum SHIFT{ SHIFT_NONE, SHIFT_LEFT,SHIFT_RIGHT,SHIFT_UP,SHIFT_DOWN,SHIFT_FAR,SHIFT_NEAR};
+enum { SHIFT_NONE, SHIFT_LEFT,SHIFT_RIGHT,SHIFT_UP,SHIFT_DOWN,SHIFT_FAR,SHIFT_NEAR};
 
 extern GLfloat deltaView ;
 
diff -urNp Mesa-3.4.2/src/Windows/wmesaBackup.c Mesa-3.4.2x/src/Windows/wmesaBackup.c
--- Mesa-3.4.2/src/Windows/wmesaBackup.c	1999-08-19 03:55:42.000000000 +0300
+++ Mesa-3.4.2x/src/Windows/wmesaBackup.c	2016-05-02 01:55:50.000000000 +0300
@@ -71,7 +71,7 @@
 
 #if !defined(NO_STEREO)
 
-#include "gl\glu.h"
+#include "GL/glu.h"
 #include "stereo.h"
 
 #endif
diff -urNp Mesa-3.4.2/src/Windows/wmesa.c Mesa-3.4.2x/src/Windows/wmesa.c
--- Mesa-3.4.2/src/Windows/wmesa.c	2015-10-05 05:50:00.000000000 +0300
+++ Mesa-3.4.2x/src/Windows/wmesa.c	2016-05-02 01:55:50.000000000 +0300
@@ -53,7 +53,7 @@
 
 #if !defined(NO_STEREO)
 
-#include "gl\glu.h"
+#include "GL/glu.h"
 #include "stereo.h"
 
 #endif
@@ -76,6 +76,7 @@ GLint stereo_flag = 0 ;
 static PWMC Current = NULL;
 WMesaContext WC = NULL;
 
+#undef assert
 #ifdef NDEBUG
 #define assert(ignore)  ((void) 0)
 #else
@@ -2354,7 +2355,7 @@ static void flat_5R6G5B_z_triangle( GLco
 #else
 
 	#ifdef WIN32
-		#include "..\tritemp.h"
+		#include "../tritemp.h"
 	#else
 		#include "tritemp.h"
 	#endif
diff -urNp Mesa-3.4.2/src/Windows/wmesadef.h Mesa-3.4.2x/src/Windows/wmesadef.h
--- Mesa-3.4.2/src/Windows/wmesadef.h	1999-08-19 03:55:42.000000000 +0300
+++ Mesa-3.4.2x/src/Windows/wmesadef.h	2016-05-02 01:55:50.000000000 +0300
@@ -58,7 +58,7 @@
 #define DDMESADEF_H
 
 #include <windows.h>
-#include <GL\gl.h>
+#include <GL/gl.h>
 #include "context.h"
 #ifdef DDRAW
 	#include <ddraw.h>
diff -urNp Mesa-3.4.2/src/Windows/wmesaOld.c Mesa-3.4.2x/src/Windows/wmesaOld.c
--- Mesa-3.4.2/src/Windows/wmesaOld.c	1999-08-19 03:55:42.000000000 +0300
+++ Mesa-3.4.2x/src/Windows/wmesaOld.c	2016-05-02 01:55:50.000000000 +0300
@@ -64,7 +64,7 @@
 
 #if !defined(NO_STEREO)
 
-	#include "gl\glu.h"
+	#include "GL/glu.h"
 	#include "stereo.h"
 
 #endif
diff -urNp Mesa-3.4.2/src/Windows/wmesa_stereo.c Mesa-3.4.2x/src/Windows/wmesa_stereo.c
--- Mesa-3.4.2/src/Windows/wmesa_stereo.c	2000-09-29 01:39:43.000000000 +0300
+++ Mesa-3.4.2x/src/Windows/wmesa_stereo.c	2016-05-02 01:55:50.000000000 +0300
@@ -14,7 +14,7 @@
 #include <stdlib.h>
 #include <wmesadef.h>
 
-#include <GL\wmesa.h>
+#include <GL/wmesa.h>
 #include "context.h"
 #include "dd.h"
 #include "xform.h"
@@ -35,7 +35,7 @@
 
 #if !defined(NO_STEREO)
 
-	#include "gl\glu.h"
+	#include "GL/glu.h"
 	#include "stereo.h"
 
 	PBYTE Buffer_Stereo;
diff -urNp Mesa-3.4.2/src-glu/gluP.h Mesa-3.4.2x/src-glu/gluP.h
--- Mesa-3.4.2/src-glu/gluP.h	2000-11-20 19:37:06.000000000 +0200
+++ Mesa-3.4.2x/src-glu/gluP.h	2016-05-02 01:55:50.000000000 +0300
@@ -110,7 +110,7 @@ typedef unsigned long COLORREF;
 typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
 typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
 typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
-#include <gl/mesa_wgl.h>
+#include <GL/mesa_wgl.h>
 #endif
 
 

