1 AC_DEFUN([RFX_CHECK_OPENGL],
3 OLDCPPFLAGS="${CPPFLAGS}"
6 AC_CHECK_LIB(GL, glBegin)
7 AC_CHECK_LIB(GLU, gluBeginSurface)
8 AC_CHECK_LIB(glut, glutInit)
9 AC_CHECK_HEADERS(GL/gl.h GL/glut.h)
11 cat > conftest.c << EOF
16 int main(int argc, char*argv[])
18 glutInit(&argc, argv);
19 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
20 glutInitWindowSize(320,200);
21 glutInitWindowPosition(0,0);
22 glutCreateWindow("main");
23 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
24 glShadeModel(GL_SMOOTH);
25 glEnable (GL_LINE_SMOOTH);
26 glEnable (GL_POLYGON_SMOOTH);
28 glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
29 glHint (GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
30 glHint (GL_POLYGON_SMOOTH_HINT, GL_DONT_CARE);
34 AC_MSG_CHECKING([whether we can compile the opengl test program])
36 ac_link='$CC $CPPFLAGS $CFLAGS conftest.c $LDFLAGS $LIBS -o conftest${ac_exeext}'
37 if { (eval echo opengl.m4:71: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
40 AC_DEFINE([HAVE_OPENGL], [1], [Defined if opengl is available])
42 echo "configure: failed program was:" >&5
49 # if the above didn't work out, reset all changes to the compiler variables.
50 if test "x${HAVE_OPENGL}" "!=" "x1"; then