-if test "x$ac_cv_lib_glut_glutGameModeString" = "xno"; then
- echo
- echo "Your version of glut doesn't support game mode."
- echo "You need to install the latest version. If your distribution doesn't"
- echo "provide a newer version, you can get the latest source code from:"
- echo
- echo " http://reality.sgi.com/opengl/glut3/glut3.html"
- exit 1
-fi
+*-apple-darwin*)
+ dnl Mac OS X
+
+ LIBS="$LIBS -framework GLUT -framework OpenGL -framework Carbon -lobjc"
+ ;;
+
+*)
+ dnl X-Windows based machines
+
+ dnl Skip X11 library tests if requested.
+ if test "x$no_x" != "xyes"; then
+ AC_SEARCH_LIBS(XCreateWindow, X11)
+ AC_SEARCH_LIBS(XShmCreateImage, Xext)
+ AC_SEARCH_LIBS(XGetExtensionVersion, Xi)
+ AC_SEARCH_LIBS(IceOpenConnection, ICE)
+ AC_SEARCH_LIBS(SmcOpenConnection, SM)
+ AC_SEARCH_LIBS(XtMalloc, Xt)
+ AC_SEARCH_LIBS(XmuLookupStandardColormap, Xmu)
+ fi
+
+ AC_SEARCH_LIBS(glNewList, [ GL GLcore MesaGL ])
+ if test "x$ac_cv_search_glNewList" = "x-lGLcore"; then
+ dnl if GLcore found, then also check for GL
+ AC_SEARCH_LIBS(glXCreateContext, GL)
+ fi
+
+ dnl if using mesa, check for xmesa.h
+ if test "x$ac_cv_search_glNewList" = "x-lMesaGL"; then
+ AC_CHECK_HEADER(GL/fxmesa.h)
+ if test "x$ac_cv_header_GL_fxmesa_h" = "xyes"; then
+ AC_DEFINE([XMESA], 1, [Define for fxmesa])
+ AC_DEFINE([FX], 1, [Define for fxmesa])
+ fi
+ fi
+
+ AC_SEARCH_LIBS(gluLookAt, [ GLU MesaGLU ])
+ AC_SEARCH_LIBS(glutGetModifiers, [ glut freeglut ])
+ ;;
+
+esac