diff --git a/src/post_modules/GL/acconfig.h b/src/post_modules/GL/acconfig.h
index ff07be63b13c7636cb42bea5de20465ef4b112f0..927f4849bbe0682f501fd3284053983a03c6bc94 100644
--- a/src/post_modules/GL/acconfig.h
+++ b/src/post_modules/GL/acconfig.h
@@ -1,8 +1,16 @@
-/* $Id: acconfig.h,v 1.2 1999/07/18 15:05:12 marcus Exp $ */
+/* $Id: acconfig.h,v 1.3 1999/08/17 20:59:11 marcus Exp $ */
 
 /* Define if you have libGL */
 #undef HAVE_LIBGL
 
+/* Define if you have libOpenGL */
+#undef HAVE_LIBOPENGL
+
+/* Define if you have libOpenGL32 */
+#undef HAVE_LIBOPENGL32
+
 /* Define if you have libMesaGL */
 #undef HAVE_LIBMESAGL
 
+/* Define if you have GL */
+#undef HAVE_GL
diff --git a/src/post_modules/GL/auto.c.in b/src/post_modules/GL/auto.c.in
index 69b069f1b2a37fb67e84ed8ffec815b64da84e85..e281d3d4ef2580b67e83d2e33c0b64e13b43ebdd 100644
--- a/src/post_modules/GL/auto.c.in
+++ b/src/post_modules/GL/auto.c.in
@@ -1,5 +1,5 @@
 /*
- * $Id: auto.c.in,v 1.11 1999/07/29 21:59:54 marcus Exp $
+ * $Id: auto.c.in,v 1.12 1999/08/17 20:59:12 marcus Exp $
  *
  */
 
@@ -7,7 +7,7 @@
 
 #include "config.h"
 
-RCSID("$Id: auto.c.in,v 1.11 1999/07/29 21:59:54 marcus Exp $");
+RCSID("$Id: auto.c.in,v 1.12 1999/08/17 20:59:12 marcus Exp $");
 #include "stralloc.h"
 #include "pike_macros.h"
 #include "object.h"
@@ -19,7 +19,15 @@ RCSID("$Id: auto.c.in,v 1.11 1999/07/29 21:59:54 marcus Exp $");
 #include "operators.h"
 #include "mapping.h"
 
+#ifdef HAVE_WINDEF_H
+#include <windef.h>
+#endif /* HAVE_WINDEF_H */
+#ifdef HAVE_WINGDI_H
+#include <wingdi.h>
+#endif /* HAVE_WINGDI_H */
+#ifdef HAVE_GL_GL_H
 #include <GL/gl.h>
+#endif /* HAVE_GL_GL_H */
 
 #define ZT_INT    1
 #define ZT_FLOAT  2
diff --git a/src/post_modules/GL/configure.in b/src/post_modules/GL/configure.in
index a6cbd3b946d45b5e5be45960bf16881b8c41398c..d5f62be9158ffca6098b78ca8be9a1977ce558bd 100755
--- a/src/post_modules/GL/configure.in
+++ b/src/post_modules/GL/configure.in
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.4 1999/08/07 20:52:24 marcus Exp $
+# $Id: configure.in,v 1.5 1999/08/17 20:59:13 marcus Exp $
 AC_INIT(top.c)
 AC_CONFIG_HEADER(config.h)
 
@@ -17,16 +17,72 @@ AC_PATH_XTRA()
 AC_ARG_WITH(lib-GL,     [  --with-lib-GL           use '-lGL'])
 AC_ARG_WITH(lib-MesaGL, [  --with-lib-MesaGL       use '-lMesaGL'])
 
+AC_CHECK_HEADERS(windef.h wingdi.h GL/gl.h GL/glx.h)
+
 AC_CHECK_LIB(GL, glOrtho, AC_DEFINE_UNQUOTED(HAVE_LIBGL),,[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS])
 AC_CHECK_LIB(MesaGL, glOrtho, AC_DEFINE_UNQUOTED(HAVE_LIBMESAGL),,[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS])
+oldLIBS="$LIBS"
+AC_MSG_CHECKING(for glOrtho in -lOpenGL)
+AC_CACHE_VAL(pike_cv_lib_OpenGL, [
+  LIBS="$oldLIBS -lOpenGL"
+  AC_TRY_LINK([
+#ifdef HAVE_WINDEF_H
+#include <windef.h>
+#endif /* HAVE_WINDEF_H */
+#ifdef HAVE_WINGDI_H
+#include <wingdi.h>
+#endif /* HAVE_WINGDI_H */
+#ifdef HAVE_GL_GL_H
+#include <GL/gl.h>
+#endif /* HAVE_GL_GL_H */
+], [ glOrtho(0.0,0.0,0.0,0.0,0.0,0.0); ], [ pike_cv_lib_OpenGL=yes ], [ pike_cv_lib_OpenGL=no ])
+])
+if test x"$pike_cv_lib_OpenGL" = xyes; then
+  AC_MSG_RESULT(yes)
+  AC_DEFINE_UNQUOTED(HAVE_LIBOPENGL)
+else
+  AC_MSG_RESULT(no)
+fi
+AC_MSG_CHECKING(for glOrtho in -lOpenGL32)
+AC_CACHE_VAL(pike_cv_lib_OpenGL32, [
+  LIBS="$oldLIBS -lOpenGL32"
+  AC_TRY_LINK([
+#ifdef HAVE_WINDEF_H
+#include <windef.h>
+#endif /* HAVE_WINDEF_H */
+#ifdef HAVE_WINGDI_H
+#include <wingdi.h>
+#endif /* HAVE_WINGDI_H */
+#ifdef HAVE_GL_GL_H
+#include <GL/gl.h>
+#endif /* HAVE_GL_GL_H */
+], [ glOrtho(0.0,0.0,0.0,0.0,0.0,0.0); ], [ pike_cv_lib_OpenGL32=yes ], [ pike_cv_lib_OpenGL32=no ])
+])
+if test x"$pike_cv_lib_OpenGL32" = xyes; then
+  AC_MSG_RESULT(yes)
+  AC_DEFINE_UNQUOTED(HAVE_LIBOPENGL32)
+else
+  AC_MSG_RESULT(no)
+fi
+LIBS="$oldLIBS"
 
 if test x"$with_lib_GL" = "xyes" -a x"$ac_cv_lib_GL_glOrtho" = xyes; then
   LIBS="-lGL $LIBS"
   AC_DEFINE(HAVE_GL)
+elif test x"$with_lib_GL" = "xyes" -a x"$pike_cv_lib_OpenGL" = xyes; then
+  LIBS="-lOpenGL $LIBS"
+  AC_DEFINE(HAVE_GL)
+elif test x"$with_lib_GL" = "xyes" -a x"$pike_cv_lib_OpenGL32" = xyes; then
+  LIBS="-lOpenGL32 $LIBS"
+  AC_DEFINE(HAVE_GL)
 elif test x"$with_lib_MesaGL" = "xyes" -a x"$ac_cv_lib_MesaGL_glOrtho" = xyes; then
   LIBS="-lMesaGL $LIBS"
 elif test x"$ac_cv_lib_GL_glOrtho" = xyes; then
   LIBS="-lGL $LIBS"
+elif test x"$pike_cv_lib_OpenGL" = xyes; then
+  LIBS="-lOpenGL $LIBS"
+elif test x"$pike_cv_lib_OpenGL32" = xyes; then
+  LIBS="-lOpenGL32 $LIBS"
 elif test x"$ac_cv_lib_MesaGL_glOrtho" = xyes; then
   LIBS="-lMesaGL $LIBS"
 else
diff --git a/src/post_modules/GL/top.c b/src/post_modules/GL/top.c
index a72ebf15ef864f03727825c0f641cbefb9c12e9f..87bfcbf1fb2fa936d58b6002090c4c4bf3f6ea73 100644
--- a/src/post_modules/GL/top.c
+++ b/src/post_modules/GL/top.c
@@ -1,5 +1,5 @@
 /*
- * $Id: top.c,v 1.10 1999/08/07 21:29:10 marcus Exp $
+ * $Id: top.c,v 1.11 1999/08/17 20:59:14 marcus Exp $
  *
  */
 
@@ -7,15 +7,25 @@
 
 #ifdef HAVE_GL
 
+#ifdef HAVE_WINDEF_H
+#include <windef.h>
+#endif /* HAVE_WINDEF_H */
+#ifdef HAVE_WINGDI_H
+#include <wingdi.h>
+#endif /* HAVE_WINGDI_H */
+#ifdef HAVE_GL_GL_H
 #include <GL/gl.h>
+#endif /* HAVE_GL_GL_H */
+#ifdef HAVE_GL_GLX_H
 #include <GL/glx.h>
+#endif /* HAVE_GL_GLX_H */
 
 #endif /* HAVE_GL */
 
 
 #include "global.h"
 
-RCSID("$Id: top.c,v 1.10 1999/08/07 21:29:10 marcus Exp $");
+RCSID("$Id: top.c,v 1.11 1999/08/17 20:59:14 marcus Exp $");
 #include "stralloc.h"
 #include "pike_macros.h"
 #include "object.h"