dnl ---- configure.ac for gb.opengl

m4_include([../version.m4])
AC_INIT([gambas3-gb-opengl],[GB_VERSION],[GB_MAIL],[],[GB_URL])
AC_CONFIG_MACRO_DIR([m4])

GB_INIT(gb.opengl)
LT_INIT
PKG_PROG_PKG_CONFIG

AC_MSG_CHECKING(for 'libepoxy')
$PKG_CONFIG epoxy
if test $? -eq 0; then
	GB_OPENGL_GLEW=epoxy
	AC_DEFINE_UNQUOTED(USE_EPOXY, 1, [Using 'libepoxy' to detect OpenGL extensions])
	AC_MSG_RESULT([found. Using 'libepoxy' to detect OpenGL extensions])
else
	GB_OPENGL_GLEW=glew
	AC_DEFINE_UNQUOTED(USE_GLEW, 1, [Using 'GLEW' to detect OpenGL extensions])
	AC_MSG_RESULT([not found. Using 'GLEW' to detect OpenGL extensions])
fi

GB_COMPONENT_PKG_CONFIG(
  opengl, OPENGL, gb.opengl, [src],
  [gl $GB_OPENGL_GLEW])

GB_COMPONENT_PKG_CONFIG(
  glsl, GLSL, gb.opengl.glsl, [glsl],
  [gl $GB_OPENGL_GLEW])

GB_COMPONENT_PKG_CONFIG(
  glu, GLU, gb.opengl.glu, [glu],
  [glu])

GB_COMPONENT_PKG_CONFIG(
  sge, SGE, gb.opengl.sge, [sge],
	[gl $GB_OPENGL_GLEW])

AC_CONFIG_FILES([\
Makefile \
src/Makefile \
src/glu/Makefile \
src/glsl/Makefile \
src/sge/Makefile
])
AC_OUTPUT

GB_PRINT_MESSAGES
