1dnl Checks for OpenGL
2AC_ARG_ENABLE(opengltest,
3	[  --disable-opengltest    Do not try to compile and run a test OpenGL program],
4		    , enable_opengltest=yes)
5AC_MSG_CHECKING(for OpenGL support)
6have_opengl=yes
7if test "x$enable_opengltest" = "xyes" ; then
8	AC_TRY_COMPILE([
9		#include <GL/gl.h>
10		#include <GL/glu.h>
11		],[
12		],[
13		have_opengl=yes
14		],[
15		have_opengl=no
16	])
17fi
18
19AC_MSG_RESULT($have_opengl)
20if test x$have_opengl != xyes; then
21    AC_MSG_ERROR([*** Can't find the OpenGL library Try: http://www.opengl.org])
22fi
23
24if test `uname -s` = FreeBSD; then
25    GL_LIBS="-lGL -lGLU -lGLEW"
26else
27    if test `uname -s` = Darwin; then
28        GL_LIBS="-framework OpenGL"
29    else
30        GL_LIBS="-lGL -lGLU -lpthread"
31    fi
32fi
33if test `uname -s` = DragonFly; then
34    GL_LIBS="-lGL -lGLU -lGLEW"
35fi
36
37AC_SUBST(GL_LIBS)
38
39