diff --git a/.gitattributes b/.gitattributes
index d959e0ea08eef360a7a332dff44a4b0777e4a76d..b65cc0ad86db31205cdc54d3fbc54dc658012bb6 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -8,6 +8,7 @@
 # Remove the corresponding line before committing
 # changes to these files.
 /src/post_modules/GL/Makefile.in foreign_ident
+/src/post_modules/GL/acconfig.h foreign_ident
 /src/post_modules/GL/auto.c.in foreign_ident
 /src/post_modules/GL/configure.in foreign_ident
 /src/post_modules/GL/top.c foreign_ident
diff --git a/src/post_modules/GL/Makefile.in b/src/post_modules/GL/Makefile.in
index fce3e3a76e1e97c38fb31602cf25d46ca566a5cc..f4e1f7a1852f83e32aa22374c29958f9e2e9aff4 100644
--- a/src/post_modules/GL/Makefile.in
+++ b/src/post_modules/GL/Makefile.in
@@ -1,9 +1,10 @@
-# $Id: Makefile.in,v 1.1 1998/11/02 23:54:33 marcus Exp $
+# $Id: Makefile.in,v 1.2 1999/07/16 20:01:12 marcus Exp $
 SRCDIR=@srcdir@
 VPATH=@srcdir@:@srcdir@/../..:../..
 OBJS=top.o auto.o
 MODULE_LDFLAGS=@LDFLAGS@ @X_LIBS@ @X_PRE_LIBS@ -lX11 @X_EXTRA_LIBS@ @LIBS@
 MODULE_CFLAGS=@X_CFLAGS@
+CONFIG_HEADERS=@CONFIG_HEADERS@
 
 @dynamic_module_makefile@
 
diff --git a/src/post_modules/GL/acconfig.h b/src/post_modules/GL/acconfig.h
new file mode 100644
index 0000000000000000000000000000000000000000..4003b95ef6ce5c3ce5e24e0f60379ba3cceacc78
--- /dev/null
+++ b/src/post_modules/GL/acconfig.h
@@ -0,0 +1 @@
+/* $Id: acconfig.h,v 1.1 1999/07/16 20:01:12 marcus Exp $ */
diff --git a/src/post_modules/GL/auto.c.in b/src/post_modules/GL/auto.c.in
index 2e48e756b4a014a30b92275e469d4ed0ca625d97..7061db035694d3953a400f15999844174d7300d9 100644
--- a/src/post_modules/GL/auto.c.in
+++ b/src/post_modules/GL/auto.c.in
@@ -1,11 +1,13 @@
 /*
- * $Id: auto.c.in,v 1.4 1998/11/03 01:08:18 marcus Exp $
+ * $Id: auto.c.in,v 1.5 1999/07/16 20:01:26 marcus Exp $
  *
  */
 
 #include "global.h"
 
-RCSID("$Id: auto.c.in,v 1.4 1998/11/03 01:08:18 marcus Exp $");
+#include "config.h"
+
+RCSID("$Id: auto.c.in,v 1.5 1999/07/16 20:01:26 marcus Exp $");
 #include "stralloc.h"
 #include "pike_macros.h"
 #include "object.h"
diff --git a/src/post_modules/GL/configure.in b/src/post_modules/GL/configure.in
index 28b3e33b8f47e14fa5967bd1966c8e3196838fb7..df0712002fe281325787ae99d26c0b2f7ba79524 100755
--- a/src/post_modules/GL/configure.in
+++ b/src/post_modules/GL/configure.in
@@ -1,11 +1,15 @@
-# $Id: configure.in,v 1.1 1998/11/02 23:54:36 marcus Exp $
+# $Id: configure.in,v 1.2 1999/07/16 20:01:12 marcus Exp $
 AC_INIT(top.c)
+AC_CONFIG_HEADER(config.h)
 
 AC_MODULE_INIT()
 
 AC_PATH_XTRA()
 
-AC_CHECK_LIB(GL, glOrtho,,,[$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
+AC_CHECK_LIB(GL, glOrtho,,,[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS])
+if test x"$ac_cv_lib_GL_glOrtho" != yes; then
+  AC_CHECK_LIB(MesaGL, glOrtho,,,[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS])
+fi
 AC_CHECK_FUNC(glXChooseVisual)
 
 AC_OUTPUT(Makefile,echo FOO >stamp-h )
diff --git a/src/post_modules/GL/top.c b/src/post_modules/GL/top.c
index b20c4088e4d3586ec8cc32b092057ef260566e1a..4ad4bf47e5294b00cda93ca8616b007a5c539066 100644
--- a/src/post_modules/GL/top.c
+++ b/src/post_modules/GL/top.c
@@ -1,5 +1,5 @@
 /*
- * $Id: top.c,v 1.2 1998/11/03 18:08:17 marcus Exp $
+ * $Id: top.c,v 1.3 1999/07/16 20:02:27 marcus Exp $
  *
  */
 
@@ -10,7 +10,9 @@
 
 #include "global.h"
 
-RCSID("$Id: top.c,v 1.2 1998/11/03 18:08:17 marcus Exp $");
+#include "config.h"
+
+RCSID("$Id: top.c,v 1.3 1999/07/16 20:02:27 marcus Exp $");
 #include "stralloc.h"
 #include "pike_macros.h"
 #include "object.h"