elm_module: Load not installed modules from build dir with ELM_RUN_IN_TREE

If we want to run from the local build dir without make install before
elm_module would fail to load the modules as it is expecting them in the
final install location.

We can now change this by setting ELM_RUN_IN_TREE to force it load the not
yet installed modules.

ref T2028
This commit is contained in:
Stefan Schmidt 2015-04-23 11:27:06 +02:00 committed by Stefan Schmidt
parent 1bcc441f2f
commit 07aa742513
4 changed files with 14 additions and 3 deletions

View File

@ -22,6 +22,7 @@ AM_CPPFLAGS = \
-DLOCALE_DIR=\"$(localedir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DICON_DIR=\"$(datadir)/icons\" \
-DELM_TOP_BUILD_DIR=\"$(top_builddir)\" \
-DELEMENTARY_BUILD \
@ELEMENTARY_CFLAGS@

View File

@ -131,9 +131,16 @@ _elm_module_load(Elm_Module *m)
if (m->module) return EINA_TRUE;
if (strchr(m->name, '/')) return EINA_FALSE;
snprintf(buf, sizeof(buf),
"%s/elementary/modules/%s/%s/module"EFL_SHARED_EXTENSION,
if (getenv("ELM_RUN_IN_TREE"))
{
snprintf(buf, sizeof(buf),
ELM_TOP_BUILD_DIR "/src/modules/%s/.libs/module"EFL_SHARED_EXTENSION, m->name);
}
else
{
snprintf(buf, sizeof(buf), "%s/elementary/modules/%s/%s/module"EFL_SHARED_EXTENSION,
_elm_lib_dir, m->name, MODULE_ARCH);
}
m->module = eina_module_new(buf);
if ((m->module) && (eina_module_load(m->module) == EINA_TRUE))
{

View File

@ -1,5 +1,6 @@
AM_TESTS_ENVIRONMENT = \
ELM_DATA_DIR=${top_builddir}/data
ELM_DATA_DIR=${top_builddir}/data \
ELM_RUN_IN_TREE=1
AUTOMAKE_OPTIONS = 1.4 foreign
MAINTAINERCLEANFILES = Makefile.in

View File

@ -108,6 +108,8 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
Suite *s;
SRunner *sr;
putenv("ELM_RUN_IN_TREE=1");
s = elm_suite();
sr = srunner_create(s);