-dnl defines USE_THREADS if thread support is activated. (GL)
-
-dnl ----------------------------------------------------------------
-dnl search for opengl
-dnl ----------------------------------------------------------------
-
-OPENGL_INCLUDE=
-OPENGL_LIBRARY=
-OPENGL_LINK=
-
-if test "$USE_OPENGL" = 1; then
- dnl checking OPENGL includes
- AC_MSG_CHECKING(for OpenGL includes)
- AC_PATH_FIND_INCLUDES($SEARCH_INCLUDE,GL/gl.h)
- if test "$ac_find_includes" != "" ; then
- OPENGL_INCLUDE="-I$ac_find_includes"
- AC_MSG_RESULT(found $ac_find_includes)
- dnl checking OPENGL libraries
- AC_MSG_CHECKING(for OpenGL library)
- AC_PATH_FIND_LIBRARIES($SEARCH_LIB,GL)
- if test "$ac_find_libraries" != "" ; then
- AC_INCLUDE_PATH_EXIST($ac_find_includes,$CHECK_INCLUDE)
- AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB)
- CHECK_LINK="$CHECK_INCLUDE $ac_path_to_link"
- CHECK_INCLUDE="$CHECK_INCLUDE $ac_path_to_include"
- OPENGL_LIBRARY="$ac_path_to_link"
- OPENGL_INCLUDE="$ac_path_to_include"
- OPENGL_LINK="-lGL"
- AC_MSG_RESULT(found OpenGL at $ac_find_libraries)
- else
- AC_PATH_FIND_LIBRARIES($SEARCH_LIB,MesaGL)
- if test "$ac_find_libraries" != "" ; then
- AC_INCLUDE_PATH_EXIST($ac_find_includes,$CHECK_INCLUDE)
- AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB)
- CHECK_LINK="$CHECK_INCLUDE $ac_path_to_link"
- CHECK_INCLUDE="$CHECK_INCLUDE $ac_path_to_include"
- OPENGL_LIBRARY="$ac_path_to_link"
- OPENGL_INCLUDE="$ac_path_to_include"
- OPENGL_LINK="-lMesaGL"
- AC_MSG_RESULT(found MESA at $ac_find_libraries)
- else
- AC_MSG_ERROR(no)
- fi
- fi
- else
- AC_MSG_ERROR(no)
- fi
-fi
-
-dnl ----------------------------------------------------------------
-dnl left-over
-dnl ----------------------------------------------------------------
-
-USE_GLX=$USE_OPENGL
-if test "$USE_OPENGL" != 1; then
- OPENGL_LIBRARIES=
- OPENGL_INCLUDE=
- OPENGL_LINK=
- GLCANVAS=NONE
-fi
-
-AC_DEFINE_UNQUOTED(USE_GLX,$USE_GLX)
-AC_SUBST(OPENGL_INCLUDE)
-AC_SUBST(OPENGL_LIBRARY)
-AC_SUBST(OPENGL_LINK)
-AC_SUBST(GLCANVAS)