summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel@osg.samsung.com>2018-02-16 20:37:17 +0100
committerMarcel Hollerbach <marcel@osg.samsung.com>2018-02-17 21:17:58 +0100
commit17d8781a2a44af451a2bee1685f5dece7cfba634 (patch)
treea0d4df7077bfda09c655837e40626ecd72c2a6a0 /src/lib/ecore_evas
parentc93bd1b81b7c7b108911db49b011da8ff5f43057 (diff)
ecore: use new bs static lib
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/ecore_evas_module.c72
1 files changed, 22 insertions, 50 deletions
diff --git a/src/lib/ecore_evas/ecore_evas_module.c b/src/lib/ecore_evas/ecore_evas_module.c
index 9d5e6ad075..a6ce6bec51 100644
--- a/src/lib/ecore_evas/ecore_evas_module.c
+++ b/src/lib/ecore_evas/ecore_evas_module.c
@@ -9,6 +9,8 @@
9#include "ecore_evas_private.h" 9#include "ecore_evas_private.h"
10#include <unistd.h> 10#include <unistd.h>
11 11
12#include "../../static_libs/buildsystem/buildsystem.h"
13
12static Eina_Hash *_registered_engines = NULL; 14static Eina_Hash *_registered_engines = NULL;
13static Eina_List *_engines_paths = NULL; 15static Eina_List *_engines_paths = NULL;
14static Eina_List *_engines_available = NULL; 16static Eina_List *_engines_available = NULL;
@@ -63,26 +65,23 @@ Eina_Module *
63_ecore_evas_vnc_server_module_load(void) 65_ecore_evas_vnc_server_module_load(void)
64{ 66{
65 char *prefix; 67 char *prefix;
68 char buf[PATH_MAX];
66 69
67 if (_ecore_evas_vnc) 70 if (_ecore_evas_vnc)
68 return _ecore_evas_vnc; 71 return _ecore_evas_vnc;
69 72
70#ifdef NEED_RUN_IN_TREE 73 if (bs_mod_get(buf, sizeof(buf), "ecore_evas", "vnc_server"))
74 {
71#if defined(HAVE_GETUID) && defined(HAVE_GETEUID) 75#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
72 if (getuid() == geteuid()) 76 if (getuid() == geteuid())
73#endif 77#endif
74 {
75 if (getenv("EFL_RUN_IN_TREE"))
76 { 78 {
77 _ecore_evas_vnc = _ecore_evas_vnc_server_module_try_load(PACKAGE_BUILD_DIR 79 _ecore_evas_vnc = _ecore_evas_vnc_server_module_try_load(buf,
78 "/src/modules/ecore_evas/vnc_server/.libs/"
79 ECORE_EVAS_ENGINE_NAME,
80 EINA_TRUE); 80 EINA_TRUE);
81 if (_ecore_evas_vnc) 81 if (_ecore_evas_vnc)
82 return _ecore_evas_vnc; 82 return _ecore_evas_vnc;
83 } 83 }
84 } 84 }
85#endif
86 85
87 prefix = eina_module_symbol_path_get(_ecore_evas_vnc_server_module_load, 86 prefix = eina_module_symbol_path_get(_ecore_evas_vnc_server_module_load,
88 "/ecore_evas"); 87 "/ecore_evas");
@@ -105,41 +104,31 @@ _ecore_evas_engine_load(const char *engine)
105 const char *path; 104 const char *path;
106 Eina_List *l; 105 Eina_List *l;
107 Eina_Module *em = NULL; 106 Eina_Module *em = NULL;
108#ifdef NEED_RUN_IN_TREE 107 char tmp[PATH_MAX] = "";
109 Eina_Bool run_in_tree;
110#endif
111 108
112 EINA_SAFETY_ON_NULL_RETURN_VAL(engine, NULL); 109 EINA_SAFETY_ON_NULL_RETURN_VAL(engine, NULL);
113 110
114 em = (Eina_Module *)eina_hash_find(_registered_engines, engine); 111 em = (Eina_Module *)eina_hash_find(_registered_engines, engine);
115 if (em) return em; 112 if (em) return em;
116 113
117#ifdef NEED_RUN_IN_TREE 114 if (bs_mod_get(tmp, sizeof(tmp), "ecore_evas/engines", engine))
118 run_in_tree = !!getenv("EFL_RUN_IN_TREE");
119#endif
120
121 EINA_LIST_FOREACH(_engines_paths, l, path)
122 { 115 {
123 char tmp[PATH_MAX] = ""; 116 em = eina_module_new(tmp);
117 if (!em) return NULL;
124 118
125#ifdef NEED_RUN_IN_TREE 119 if (!eina_module_load(em))
126#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
127 if (getuid() == geteuid())
128#endif
129 { 120 {
130 if (run_in_tree) 121 eina_module_free(em);
131 { 122 return NULL;
132 snprintf(tmp, sizeof(tmp), "%s/%s/.libs/%s",
133 path, engine, ECORE_EVAS_ENGINE_NAME);
134 if (!_file_exists(tmp))
135 tmp[0] = '\0';
136 }
137 } 123 }
138#endif 124 if (eina_hash_add(_registered_engines, engine, em))
125 return em;
126 }
139 127
140 if (tmp[0] == '\0') 128 EINA_LIST_FOREACH(_engines_paths, l, path)
141 snprintf(tmp, sizeof(tmp), "%s/%s/%s/%s", 129 {
142 path, engine, MODULE_ARCH, ECORE_EVAS_ENGINE_NAME); 130 snprintf(tmp, sizeof(tmp), "%s/%s/%s/%s",
131 path, engine, MODULE_ARCH, ECORE_EVAS_ENGINE_NAME);
143 132
144 em = eina_module_new(tmp); 133 em = eina_module_new(tmp);
145 if (!em) continue; 134 if (!em) continue;
@@ -167,23 +156,6 @@ _ecore_evas_engine_init(void)
167// _registered_engines = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free)); 156// _registered_engines = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free));
168 _registered_engines = eina_hash_string_small_new(NULL); 157 _registered_engines = eina_hash_string_small_new(NULL);
169 158
170#ifdef NEED_RUN_IN_TREE
171#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
172 if (getuid() == geteuid())
173#endif
174 {
175 if (getenv("EFL_RUN_IN_TREE"))
176 {
177 const char mp[] = PACKAGE_BUILD_DIR"/src/modules/ecore_evas/engines/";
178 if (_file_exists(mp))
179 {
180 _engines_paths = eina_list_append(_engines_paths, strdup(mp));
181 return;
182 }
183 }
184 }
185#endif
186
187 /* 1. libecore_evas.so/../ecore_evas/engines/ */ 159 /* 1. libecore_evas.so/../ecore_evas/engines/ */
188 paths[0] = eina_module_symbol_path_get(_ecore_evas_engine_init, "/ecore_evas/engines"); 160 paths[0] = eina_module_symbol_path_get(_ecore_evas_engine_init, "/ecore_evas/engines");
189#ifndef _WIN32 161#ifndef _WIN32
@@ -218,7 +190,7 @@ _ecore_evas_engine_shutdown(void)
218 _registered_engines = NULL; 190 _registered_engines = NULL;
219 } 191 }
220 */ 192 */
221 193
222 EINA_LIST_FREE(_engines_paths, path) 194 EINA_LIST_FREE(_engines_paths, path)
223 free(path); 195 free(path);
224 196