simplify detection of gl engines

SVN revision: 31202
This commit is contained in:
doursse 2007-08-07 10:18:51 +00:00 committed by doursse
parent 9c17b01d0b
commit e16d7525c9
1 changed files with 54 additions and 68 deletions

View File

@ -531,90 +531,67 @@ fi
#######################################
## Check if we should build the gl_x11 engine
have_evas_gl_common="no"
have_evas_gl_x11="no";
## Automatic check...
AC_CHECK_HEADER(GL/gl.h,
[
AC_CHECK_HEADER(X11/X.h,
[ have_evas_gl_x11="yes" ],
[ have_evas_gl_x11="no" ]
)
],
[ have_evas_gl_x11="no" ]
AC_CHECK_HEADERS(GL/gl.h GL/glu.h X11/X.h,
[ have_evas_gl_x11="yes" ],
[ have_evas_gl_x11="no" ]
)
## manually disable gl engine by default - not auto detected.
have_evas_gl_x11="no"
## Manual override
AC_MSG_CHECKING(whether gl x11 backend is to be built)
AC_ARG_ENABLE(gl-x11, [ --enable-gl-x11 enable the OpenGL X11 display engine], [
if test x"$enableval" = x"yes" ; then
AC_MSG_RESULT(yes)
have_evas_gl_x11="yes"
else
AC_MSG_RESULT(no)
have_evas_gl_x11="no"
fi
], [
AC_MSG_RESULT($have_evas_gl_x11)
]
)
if test "x$have_evas_gl_x11" = "xyes"; then
AC_CHECK_HEADER(GL/gl.h,
[
AC_CHECK_HEADER(GL/glu.h,
[
AC_CHECK_HEADER(X11/X.h,
[
AM_CONDITIONAL(BUILD_ENGINE_GL_X11, true)
AC_DEFINE(BUILD_ENGINE_GL_X11, 1, [OpenGL X11 Rendering Backend])
AM_CONDITIONAL(BUILD_ENGINE_GL_COMMON, true)
AC_DEFINE(BUILD_ENGINE_GL_COMMON, 1, [Generic OpenGL Rendering Support])
x_dir=${x_dir:-/usr/X11R6};
x_cflags=${x_cflags:--I$x_dir/include}
x_libs="${x_libs:--L$x_dir/lib -lX11 -lXext}"
gl_cflags="-I/usr/include"
gl_libs="-lGL -lGLU -lpthread"
gl_dir=""
], [
AM_CONDITIONAL(BUILD_ENGINE_GL_X11, false)
AM_CONDITIONAL(BUILD_ENGINE_GL_COMMON, false)
AC_MSG_RESULT(disabling GL X11 engine)
have_evas_gl_x11="no"
]
)
], [
AM_CONDITIONAL(BUILD_ENGINE_GL_X11, false)
AM_CONDITIONAL(BUILD_ENGINE_GL_COMMON, false)
AC_MSG_RESULT(disabling GL X11 engine)
have_evas_gl_x11="no"
]
)
], [
AM_CONDITIONAL(BUILD_ENGINE_GL_X11, false)
AM_CONDITIONAL(BUILD_ENGINE_GL_COMMON, false)
AC_MSG_RESULT(disabling GL X11 engine)
have_evas_gl_x11="no"
]
)
AC_MSG_CHECKING(whether gl x11 backend is to be built)
AC_MSG_RESULT($have_evas_gl_x11)
if test "x$have_evas_gl_x11" = "xyes"; then
AC_CHECK_HEADERS(GL/gl.h GL/glu.h,
[ have_evas_gl_common="yes" ],
[ have_evas_gl_x11="no" ]
)
else
AM_CONDITIONAL(BUILD_ENGINE_GL_X11, false)
AM_CONDITIONAL(BUILD_ENGINE_GL_COMMON, false)
have_evas_gl_x11="no"
if test "x$have_evas_gl_common" = "xyes"; then
AC_CHECK_HEADER(X11/X.h,
[
AC_DEFINE(BUILD_ENGINE_GL_X11, 1, [OpenGL X11 Rendering Backend])
AC_DEFINE(BUILD_ENGINE_GL_COMMON, 1, [Generic OpenGL Rendering Support])
x_dir=${x_dir:-/usr/X11R6};
x_cflags=${x_cflags:--I$x_dir/include}
x_libs="${x_libs:--L$x_dir/lib -lX11 -lXext}"
gl_cflags="-I/usr/include"
gl_libs="-lGL -lGLU -lpthread"
gl_dir=""
],
[
have_evas_gl_x11="no"
have_evas_gl_common="no"
]
)
fi
fi
AM_CONDITIONAL(BUILD_ENGINE_GL_COMMON, test "x$have_evas_gl_common" = "xyes")
AM_CONDITIONAL(BUILD_ENGINE_GL_X11, test "x$have_evas_gl_x11" = "xyes")
#######################################
## Check if we should build the gl_glew engine
have_evas_gl_glew="no";
## Automatic check...
AC_CHECK_HEADERS(GL/glew.h,
AC_CHECK_HEADERS(GL/gl.h GL/glu.h GL/glew.h,
[ have_evas_gl_glew="yes" ],
[ have_evas_gl_glew="no" ]
)
## manually disable gl engine by default - not auto detected.
have_evas_gl_glew="no"
## Manual override
AC_MSG_CHECKING(whether gl glew backend is to be built)
AC_ARG_ENABLE(gl-glew, [ --enable-gl-glew enable the OpenGL Glew display engine], [
if test x"$enableval" = x"yes" ; then
have_evas_gl_glew="yes"
@ -623,22 +600,31 @@ AC_ARG_ENABLE(gl-glew, [ --enable-gl-glew enable the OpenGL Gle
fi
]
)
AC_MSG_CHECKING(whether gl glew backend is to be built)
AC_MSG_RESULT($have_evas_gl_glew)
if test "x$have_evas_gl_glew" = "xyes"; then
AC_CHECK_HEADER(GL/glew.h,
[
AC_DEFINE(BUILD_ENGINE_GL_GLEW, 1, [OpenGL Glew Rendering Backend])
AC_DEFINE(BUILD_ENGINE_GL_COMMON, 1, [Generic OpenGL Rendering Support])
glew_libs="-lglew32 -lopengl32 -lgdi32"
gl_libs="-lglu32"
], [
have_evas_gl_glew="no"
]
if test "x$have_evas_gl_glew" = "xyes" ; then
AC_CHECK_HEADERS(GL/gl.h GL/glu.h,
[ have_evas_gl_common="yes" ],
[ have_evas_gl_glew="no" ]
)
if test "x$have_evas_gl_common" = "xyes" ; then
AC_CHECK_HEADER(GL/glew.h,
[
AC_DEFINE(BUILD_ENGINE_GL_GLEW, 1, [OpenGL Glew Rendering Backend])
AC_DEFINE(BUILD_ENGINE_GL_COMMON, 1, [Generic OpenGL Rendering Support])
glew_libs="-lglew32 -lopengl32 -lgdi32"
gl_libs="-lglu32"
],
[
have_evas_gl_glew="no"
have_evas_gl_common="no"
]
)
fi
fi
AM_CONDITIONAL(BUILD_ENGINE_GL_COMMON, test "x$have_evas_gl_common" = "xyes")
AM_CONDITIONAL(BUILD_ENGINE_GL_GLEW, test "x$have_evas_gl_glew" = "xyes")
AM_CONDITIONAL(BUILD_ENGINE_GL_COMMON, test "x$have_evas_gl_glew" = "xyes" -o "x$have_evas_gl_x11" = "xyes")