summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 17:19:43 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 17:19:43 +0000
commit733425c62c7b9a23ad465b5b9700612fae3ee356 (patch)
treefdc2f4e310d964cb96fa56a73d66fdba246d06b8 /src/lib/ecore_evas
parent365a4acf97c59470c317a3e80d7586efe9344bb5 (diff)
efl: make libraries aware of EFL_RUN_IN_TREE.
this variable tells that the build is being done in tree and we should not look at install locations. SVN revision: 82217
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/ecore_evas_module.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/lib/ecore_evas/ecore_evas_module.c b/src/lib/ecore_evas/ecore_evas_module.c
index 3abbbf3209..a93f3e57f9 100644
--- a/src/lib/ecore_evas/ecore_evas_module.c
+++ b/src/lib/ecore_evas/ecore_evas_module.c
@@ -22,17 +22,32 @@ _ecore_evas_engine_load(const char *engine)
22 const char *path; 22 const char *path;
23 Eina_List *l; 23 Eina_List *l;
24 Eina_Module *em = NULL; 24 Eina_Module *em = NULL;
25 Eina_Bool run_in_tree;
25 26
26 EINA_SAFETY_ON_NULL_RETURN_VAL(engine, NULL); 27 EINA_SAFETY_ON_NULL_RETURN_VAL(engine, NULL);
27 28
28 em = (Eina_Module *)eina_hash_find(_registered_engines, engine); 29 em = (Eina_Module *)eina_hash_find(_registered_engines, engine);
29 if (em) return em; 30 if (em) return em;
30 31
32 run_in_tree = !!getenv("EFL_RUN_IN_TREE");
33
31 EINA_LIST_FOREACH(_engines_paths, l, path) 34 EINA_LIST_FOREACH(_engines_paths, l, path)
32 { 35 {
33 char tmp[PATH_MAX]; 36 char tmp[PATH_MAX] = "";
37
38 if (run_in_tree)
39 {
40 struct stat st;
41 snprintf(tmp, sizeof(tmp), "%s/%s/.libs/%s",
42 path, engine, ECORE_EVAS_ENGINE_NAME);
43 if (stat(tmp, &st) != 0)
44 tmp[0] = '\0';
45 }
46
47 if (tmp[0] == '\0')
48 snprintf(tmp, sizeof(tmp), "%s/%s/%s/%s",
49 path, engine, MODULE_ARCH, ECORE_EVAS_ENGINE_NAME);
34 50
35 snprintf(tmp, sizeof (tmp), "%s/%s/%s/"ECORE_EVAS_ENGINE_NAME, path, engine, MODULE_ARCH);
36 em = eina_module_new(tmp); 51 em = eina_module_new(tmp);
37 if (!em) continue; 52 if (!em) continue;
38 53
@@ -57,6 +72,17 @@ _ecore_evas_engine_init(void)
57 72
58 _registered_engines = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free)); 73 _registered_engines = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free));
59 74
75 if (getenv("EFL_RUN_IN_TREE"))
76 {
77 struct stat st;
78 const char mp[] = PACKAGE_BUILD_DIR"/src/modules/ecore_evas/engines/";
79 if (stat(mp, &st) == 0)
80 {
81 _engines_paths = eina_list_append(_engines_paths, strdup(mp));
82 return;
83 }
84 }
85
60 /* 1. ~/.ecore_evas/modules/ */ 86 /* 1. ~/.ecore_evas/modules/ */
61 paths[0] = eina_module_environment_path_get("HOME", "/.ecore_evas/engines"); 87 paths[0] = eina_module_environment_path_get("HOME", "/.ecore_evas/engines");
62 /* 2. $(ECORE_ENGINE_DIR)/ecore_evas/modules/ */ 88 /* 2. $(ECORE_ENGINE_DIR)/ecore_evas/modules/ */