Various fixes to enable building SDL/OpenGLES
authorxcomputerman <xcomputerman@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 29 Jan 2010 06:12:35 +0000 (06:12 +0000)
committerxcomputerman <xcomputerman@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 29 Jan 2010 06:12:35 +0000 (06:12 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@45692 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.ac
m4/evas_check_engine.m4
src/modules/engines/Makefile.am
src/modules/engines/gl_common/evas_gl_common.h
src/modules/engines/gl_sdl/evas_engine.h

index f045277..5594b89 100644 (file)
@@ -508,20 +508,26 @@ EVAS_CHECK_ENGINE([software-16-wince], [${want_evas_engine_software_16_wince}],
 
 # common gl
 have_evas_engine_gl_common="no"
-if test "x$have_evas_engine_gl_x11" = "xyes" -o "x$have_evas_engine_gl_glew" = "xyes" \
-   -o "x$have_evas_gl_sdl" ="xyes"; then
-   AC_DEFINE(BUILD_ENGINE_GL_COMMON, 1, [Generic OpenGL Rendering Support])
+if test "x$have_evas_engine_gl_x11" = "xyes"; then
    have_evas_engine_gl_common="yes"
-   evas_engine_gl_common_libs=""
 fi
 
-if test "x$have_evas_engine_gl_glew" = "xyes" ; then
+if test "x$have_evas_engine_gl_glew" = "xyes"; then
    have_evas_engine_gl_common="yes"
+fi
+
+if test "x$have_evas_engine_gl_sdl" = "xyes"; then
+   have_evas_engine_gl_common="yes"
+fi
+
+if test "x$have_evas_engine_gl_common" = "xyes"; then
    evas_engine_gl_common_libs=""
+   AC_DEFINE(BUILD_ENGINE_GL_COMMON, [1], [Generic OpenGL Rendering Support])
 fi
+
 AC_SUBST([evas_engine_gl_common_libs])
 
-AM_CONDITIONAL(BUILD_ENGINE_GL_COMMON, test "x$have_evas_engine_gl_common" = "xyes")
+AM_CONDITIONAL(BUILD_ENGINE_GL_COMMON, [test "x$have_evas_engine_gl_common" = "xyes"])
 
 # gl_sdl
 if test "x$have_evas_engine_gl_sdl" = "xyes"; then
@@ -1345,7 +1351,12 @@ echo "Engines:"
 echo "  Software Memory Buffer.....: $have_evas_engine_buffer"
 echo "  Software X11...............: $have_evas_engine_software_x11 (Xlib: $have_evas_engine_software_xlib) (XCB: $have_evas_engine_software_xcb)"
 echo "  XRender X11................: $have_evas_engine_xrender_x11 (XCB: $have_evas_engine_xrender_xcb)"
-echo "  OpenGL X11.................: $have_evas_engine_gl_x11 (GLES: $gl_flavor_gles) (SGX: $gles_variety_sgx) (s3c6410: $gles_variety_s3c6410)"
+echo -n "  OpenGL X11.................: $have_evas_engine_gl_x11 "
+if test "x$have_evas_engine_gl_x11" = "xyes"; then
+   echo "(GLES: $gl_flavor_gles) (SGX: $gles_variety_sgx) (s3c6410: $gles_variety_s3c6410)"
+else
+   echo
+fi
 #echo "  Cairo X11..................: $have_evas_engine_cairo_x11"
 echo "  Software GDI...............: $have_evas_engine_software_gdi"
 echo "  Software DirectDraw........: $have_evas_engine_software_ddraw"
@@ -1353,7 +1364,12 @@ echo "  Direct3d...................: $have_evas_engine_direct3d"
 echo "  Quartz.....................: $have_evas_engine_quartz"
 echo "  OpenGL Glew................: $have_evas_engine_gl_glew"
 echo "  Software SDL...............: $have_evas_engine_software_sdl (primitive: $sdl_primitive)"
-echo "  OpenGL SDL.................: $have_evas_engine_gl_sdl"
+echo -n "  OpenGL SDL.................: $have_evas_engine_gl_sdl "
+if test "x$have_evas_engine_gl_sdl" = "xyes"; then
+   echo "(GLES: $gl_flavor_gles) (SGX: $gles_variety_sgx) (s3c6410: $gles_variety_s3c6410)"
+else
+   echo
+fi
 echo "  Software Framebuffer.......: $have_evas_engine_fb"
 echo "  DirectFB...................: $have_evas_engine_directfb"
 #echo "  Software Qtopia............: $have_evas_engine_software_qtopia"
index 416cf90..d507222 100644 (file)
@@ -520,7 +520,7 @@ if test "x${have_dep}" = "xyes" ; then
    evas_engine_[]$1[]_libs="${SDL_LIBS} -lGL -lpthread"
    evas_engine_gl_common_libs="-lGL -lpthread"
 else
-   AC_CHECK_HEADERS([EGL/egl.h], [have_egl="yes"])
+   AC_CHECK_HEADERS([SDL/SDL_opengles.h EGL/egl.h], [have_egl="yes"])
    if test "x${have_egl}" = "xyes" ; then
       AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL -lpthread -lm)
       if test "x${have_glesv2}" = "xyes" ; then
index 7a20c88..1db0e21 100644 (file)
@@ -23,6 +23,9 @@ endif
 if !EVAS_STATIC_BUILD_GL_X11
 SUBDIRS += gl_common gl_x11
 endif
+if !EVAS_STATIC_BUILD_GL_SDL
+SUBDIRS += gl_common gl_sdl
+endif
 if !EVAS_STATIC_BUILD_QUARTZ
 SUBDIRS += quartz
 endif
index 8ec2b2b..13df063 100644 (file)
 # include <OpenGL/gl.h>
 # include <OpenGL/glext.h>
 #else
-# if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
-#  if defined(GLES_VARIETY_S3C6410)
-#   include <GLES2/gl2.h>
-#  elif defined(GLES_VARIETY_SGX)
-#   include <GLES2/gl2.h>
-#   include <GLES2/gl2ext.h>
-#  endif
+# ifdef _EVAS_ENGINE_SDL_H
+#  include <SDL/SDL_opengles.h>
 # else
-#  include <GL/gl.h>
-#  include <GL/glext.h>
+#  if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
+#   if defined(GLES_VARIETY_S3C6410)
+#    include <GLES2/gl2.h>
+#   elif defined(GLES_VARIETY_SGX)
+#    include <GLES2/gl2.h>
+#    include <GLES2/gl2ext.h>
+#   endif
+#  else
+#   include <GL/gl.h>
+#   include <GL/glext.h>
+#  endif
 # endif
 #endif
 
index 92e2786..36d91b4 100644 (file)
@@ -1,27 +1,22 @@
 #ifndef EVAS_ENGINE_H
 #define EVAS_ENGINE_H
 
+#define _EVAS_ENGINE_SDL_H
+
 #include "config.h"
+#include <SDL/SDL.h>
 #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
-# if defined(GLES_VARIETY_S3C6410)
-#  include <EGL/egl.h>
-#  include <GLES2/gl2.h>
-# elif defined(GLES_VARIETY_SGX)
-#  include <EGL/egl.h>
-#  include <GLES2/gl2.h>
-#  include <GLES2/gl2ext.h>
-# endif
+# include <EGL/egl.h>
+# include <SDL/SDL_opengles.h>
 # ifdef HAVE_SDL_FLAG_OPENGLES
 #  define EVAS_SDL_GL_FLAG SDL_OPENGLES
 # else
 #  define EVAS_SDL_GL_FLAG SDL_OPENGL /* This probably won't work? */
 # endif
 #else
+# include <SDL/SDL_opengl.h>
 # define EVAS_SDL_GL_FLAG SDL_OPENGL
 #endif
-#include <SDL/SDL.h>
-#include <SDL/SDL_opengl.h>
-#include <GL/gl.h>
 #include "evas_common.h"
 #include "evas_private.h"
 #include "evas_gl_common.h"