OpenGL detection overhaul. 1) Fix some bad quoting 2) More consistent formatting 3) Add GLU detection 4) Rewrite GLEW detection from scratch and move it to opengl.m4 where it belongs.
This commit is contained in:
+29
-5
@@ -8,14 +8,38 @@ AC_DEFUN([SM_OPENGL],
|
||||
|
||||
GL_LIBS=""
|
||||
|
||||
AX_CHECK_LIB_USING_HEADER(GL, 'glBegin(GL_POINTS)', GL/gl.h, [GL_LIBS="-lGL"])
|
||||
AX_CHECK_LIB_USING_HEADER(GL, glBegin(GL_POINTS), GL/gl.h, [GL_LIBS="-lGL"])
|
||||
|
||||
if test "$GL_LIBS" = ""; then
|
||||
AX_CHECK_LIB_USING_HEADER(opengl32, 'glBegin(GL_POINTS)', GL/gl.h, [GL_LIBS="-lopengl32"])
|
||||
fi
|
||||
if test "$GL_LIBS" = ""; then
|
||||
AC_MSG_ERROR("No usable OpenGL library found.")
|
||||
AX_CHECK_LIB_USING_HEADER(opengl32, glBegin(GL_POINTS), GL/gl.h, [GL_LIBS="-lopengl32"])
|
||||
fi
|
||||
|
||||
if test "$GL_LIBS" = ""; then
|
||||
AC_MSG_ERROR("No usable OpenGL library found.")
|
||||
fi
|
||||
|
||||
AX_CHECK_LIB_USING_HEADER(GLU, gluGetString(GLU_VERSION), GL/glu.h, [GLU_LIBS="-lGLU"])
|
||||
|
||||
if test "$GLU_LIBS" = ""; then
|
||||
AX_CHECK_LIB_USING_HEADER(glu32, gluGetString(GLU_VERSION), GL/glu.h, [GLU_LIBS="-lglu32"])
|
||||
fi
|
||||
|
||||
if test "$GLU_LIBS" = ""; then
|
||||
AC_MSG_ERROR("No usable GLU library found.")
|
||||
fi
|
||||
|
||||
AX_CHECK_LIB_USING_HEADER(GLEW, glewInit(), GL/glew.h, [GLEW_LIBS="$LIBS -lGLEW"])
|
||||
|
||||
if test "$GLEW_LIBS" = ""; then
|
||||
AX_CHECK_LIB_USING_HEADER(glew32, glewInit(), GL/glew.h, [GLEW_LIBS="$LIBS -lglew32"])
|
||||
fi
|
||||
|
||||
if test "$GLEW_LIBS" = ""; then
|
||||
AC_MSG_ERROR("No usable version of GLEW found.")
|
||||
fi
|
||||
|
||||
AC_CHECK_DECL(GLEW_VERSION_2_1, , AC_MSG_ERROR("GLEW 1.3.5 or newer is required."), [#include <GL/glew.h>])
|
||||
|
||||
GL_LIBS="$GL_LIBS $GLU_LIBS $GLEW_LIBS"
|
||||
AC_SUBST(GL_LIBS)
|
||||
])
|
||||
Reference in New Issue
Block a user