Evas: Check for dlsym and disable gl engines if not found
authorkakaroto <kakaroto@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 15 Oct 2011 09:31:04 +0000 (09:31 +0000)
committerkakaroto <kakaroto@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 15 Oct 2011 09:31:04 +0000 (09:31 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@64091 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.ac
src/modules/engines/gl_common/evas_gl_context.c
src/modules/engines/gl_common/evas_gl_private.h
src/modules/engines/gl_sdl/evas_engine.c
src/modules/engines/gl_x11/evas_engine.c

index 4495d7a..d7bdd4b 100644 (file)
@@ -484,22 +484,24 @@ dlopen_libs=""
 case "$host_os" in
   mingw32ce*)
 # managed by evil
-    AC_DEFINE(HAVE_DLADDR)
+    AC_DEFINE(HAVE_DLSYM)
   ;;
   mingw*)
 # nothing on mingw platform
   ;;
   *)
-    AC_CHECK_FUNCS(dlopen, res=yes, res=no)
+    AC_CHECK_FUNCS(dlsym, res=yes, res=no)
     if test "x$res" = "xyes"; then
-      AC_CHECK_FUNCS(dladdr, AC_DEFINE(HAVE_DLADDR))
+      AC_DEFINE(HAVE_DLSYM)
     else
-      AC_CHECK_LIB(dl, dlopen, res=yes, res=no)
+      AC_CHECK_LIB(dl, dlsym, res=yes, res=no)
       if test "x$res" = "xyes"; then
-        AC_CHECK_LIB(dl, dladdr, AC_DEFINE(HAVE_DLADDR))
         dlopen_libs=-ldl
+        AC_DEFINE(HAVE_DLSYM)
       else
-        AC_MSG_ERROR(Cannot find dlopen)
+        want_evas_engine_gl_xlib="no"
+        want_evas_engine_gl_xcb="no"
+        want_evas_engine_gl_sdl="no"
       fi
     fi
 esac
index 133cb0b..62e72bd 100644 (file)
@@ -1,5 +1,11 @@
 #include "evas_gl_private.h"
 
+#ifdef HAVE_DLSYM
+# include <dlfcn.h>      /* dlopen,dlclose,etc */
+#else
+# error gl_common should not get compiled if dlsym is not found on the system!
+#endif
+
 #define PRG_INVALID 0xffffffff
 #define GLPIPES 1
 
index 794ab8d..a178823 100644 (file)
@@ -2,8 +2,6 @@
 #define _EVAS_GL_PRIVATE_H
 #include "evas_gl_common.h"
 
-#include <dlfcn.h>      /* dlopen,dlclose,etc */
-
 extern int _evas_engine_GL_common_log_dom;
 
 #ifdef ERR
index 332438a..46588d9 100644 (file)
@@ -1,8 +1,6 @@
 #include "evas_common.h" /* Also includes international specific stuff */
 #include "evas_engine.h"
 
-#include <dlfcn.h>      /* dlopen,dlclose,etc */
-
 static void*                     _sdl_output_setup     (int w, int h, int fullscreen, int noframe);
                 
 int _evas_engine_GL_SDL_log_dom = -1;
index 532ce0f..efc389d 100644 (file)
@@ -1,7 +1,12 @@
 #include "evas_common.h" /* Also includes international specific stuff */
 #include "evas_engine.h"
 
-#include <dlfcn.h>      /* dlopen,dlclose,etc */
+#ifdef HAVE_DLSYM
+# include <dlfcn.h>      /* dlopen,dlclose,etc */
+#else
+# error gl_x11 should not get compiled if dlsym is not found on the system!
+#endif
+
 #define EVAS_GL_NO_GL_H_CHECK 1
 #include "Evas_GL.h"