aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_evas/ecore_evas_module.c
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/ecore_evas_module.c
parentefl: Add examples to .gitignore (diff)
downloadefl-733425c62c7b9a23ad465b5b9700612fae3ee356.tar.gz
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/ecore_evas_module.c')
-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)
const char *path;
Eina_List *l;
Eina_Module *em = NULL;
+ Eina_Bool run_in_tree;
EINA_SAFETY_ON_NULL_RETURN_VAL(engine, NULL);
em = (Eina_Module *)eina_hash_find(_registered_engines, engine);
if (em) return em;
+ run_in_tree = !!getenv("EFL_RUN_IN_TREE");
+
EINA_LIST_FOREACH(_engines_paths, l, path)
{
- char tmp[PATH_MAX];
+ char tmp[PATH_MAX] = "";
+
+ if (run_in_tree)
+ {
+ struct stat st;
+ snprintf(tmp, sizeof(tmp), "%s/%s/.libs/%s",
+ path, engine, ECORE_EVAS_ENGINE_NAME);
+ if (stat(tmp, &st) != 0)
+ tmp[0] = '\0';
+ }
+
+ if (tmp[0] == '\0')
+ snprintf(tmp, sizeof(tmp), "%s/%s/%s/%s",
+ path, engine, MODULE_ARCH, ECORE_EVAS_ENGINE_NAME);
- snprintf(tmp, sizeof (tmp), "%s/%s/%s/"ECORE_EVAS_ENGINE_NAME, path, engine, MODULE_ARCH);
em = eina_module_new(tmp);
if (!em) continue;
@@ -57,6 +72,17 @@ _ecore_evas_engine_init(void)
_registered_engines = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free));
+ if (getenv("EFL_RUN_IN_TREE"))
+ {
+ struct stat st;
+ const char mp[] = PACKAGE_BUILD_DIR"/src/modules/ecore_evas/engines/";
+ if (stat(mp, &st) == 0)
+ {
+ _engines_paths = eina_list_append(_engines_paths, strdup(mp));
+ return;
+ }
+ }
+
/* 1. ~/.ecore_evas/modules/ */
paths[0] = eina_module_environment_path_get("HOME", "/.ecore_evas/engines");
/* 2. $(ECORE_ENGINE_DIR)/ecore_evas/modules/ */