+# Check for glut for example plugin
+AC_CHECK_LIB(glut, glutSolidTeapot, GLUT_LIBS="-lglut")
+AM_CONDITIONAL(HAVE_GLUT, test "$GLUT_LIBS" != "")
+AC_SUBST(GLUT_LIBS)
+
+# Test for Windows vs. Unix
+case "${host}" in
+ *mingw32*) WIN32="yes" ;;
+ *cygwin*) WIN32="yes" ;;
+ *) WIN32="no" ;;
+esac
+if test "$WIN32" = yes; then
+ ac_default_prefix="/"
+fi
+AM_CONDITIONAL([WIN32], test "$WIN32" = "yes")
+AM_CONDITIONAL([NOTWIN32], test "$WIN32" = "no")
+
+# Configure GL flags
+if test "$WIN32" = yes; then
+ GL_CFLAGS=""
+ GL_LIBS="-lglu32 -lopengl32"
+else
+ GL_CFLAGS=""
+ GL_LIBS="-lGL -lGLU"
+fi
+AC_SUBST([GL_CFLAGS])
+AC_SUBST([GL_LIBS])
+