Restructured DirectDraw. Split into X11 and DGA driver, and multiple
files/dirs for easier maintenance. Cleaned up structs and include
files. Reindented the code. Started the same for Direct3D.  Driver
inclusion now done by using configure/Makefile/ELF constructor tricks.

diff --git a/configure.in b/configure.in
index ead21fa..f369738 100644
--- a/configure.in
+++ b/configure.in
@@ -110,6 +110,12 @@
 	)
 )
 AC_SUBST(XLIB)
+AC_SUBST(X_SRCS)
+X_SRCS=""
+AC_SUBST(DGA_SRCS)
+DGA_SRCS=""
+AC_SUBST(MESA_SRCS)
+MESA_SRCS=""
 if test "$have_x" = "yes"
 then
     XLIB="-lXext -lX11"
@@ -149,10 +155,19 @@
     then 
          AC_CHECK_LIB(Xxf86dga,
 	              XDGAQueryExtension,
-		      AC_DEFINE(HAVE_LIBXXF86DGA2) AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
+		      	AC_DEFINE(HAVE_LIBXXF86DGA2)
+			AC_DEFINE(HAVE_LIBXXF86DGA)
+			X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
+	 		DGA_SRCS='$(DGA_SRCS)'
+			,,$X_LIBS -lXext -lX11 $X_EXTRA_LIBS
+	 )
 	 if test "$ac_cv_lib_Xxf86dga_XDGAQueryExtension" = "no"
 	 then
-           AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
+           AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,
+		AC_DEFINE(HAVE_LIBXXF86DGA)
+		X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
+		DGA_SRCS='$(DGA_SRCS)'
+		,,$X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
 	 fi
     fi
 
@@ -191,10 +206,20 @@
         if test "$wine_cv_mesa_version_OK" = "yes" -a "$wine_cv_mesa_version_threadsafe" = "no"
         then
 	    dnl Check for the presense of the library
-            AC_CHECK_LIB(GL,glXCreateContext,AC_DEFINE(HAVE_LIBMESAGL) X_PRE_LIBS="$X_PRE_LIBS -lGL",,$X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
+            AC_CHECK_LIB(GL,glXCreateContext,
+		AC_DEFINE(HAVE_LIBMESAGL)
+		X_PRE_LIBS="$X_PRE_LIBS -lGL"
+		MESA_SRCS='$(MESA_SRCS)'
+		,,
+		$X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
 	    if test "$ac_cv_lib_GL_glXCreateContext" = "no"
 	    then
-		AC_CHECK_LIB(MesaGL,glXCreateContext,AC_DEFINE(HAVE_LIBMESAGL) X_PRE_LIBS="$X_PRE_LIBS -lMesaGL",,$X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
+		AC_CHECK_LIB(MesaGL,glXCreateContext,
+		    AC_DEFINE(HAVE_LIBMESAGL)
+		    X_PRE_LIBS="$X_PRE_LIBS -lMesaGL"
+		    MESA_SRCS='$(MESA_SRCS)'
+		    ,,
+		    $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
 	    fi
 
 	    dnl Check for the Color Table and Paletted Texture extensions
@@ -215,6 +240,7 @@
     fi
 
     CPPFLAGS="$ac_save_CPPFLAGS"
+    X_SRCS='$(X_SRCS)'
 else
     XLIB=""
     X_CFLAGS=""