summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2015-04-23 11:27:06 +0200
committerStefan Schmidt <stefan@osg.samsung.com>2015-08-06 19:38:58 +0200
commitd5d0b689537a4eef2025e098b686c999970d488a (patch)
tree25d8d6d50d86a9559fe5b137e44ed63819a2e8d9
parente6b4283c6afb93eba5d628830a6b00545691ad53 (diff)
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
-rw-r--r--src/lib/Makefile.am1
-rw-r--r--src/lib/elm_module.c11
-rw-r--r--src/tests/Makefile.am3
-rw-r--r--src/tests/elm_suite.c2
4 files changed, 14 insertions, 3 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 999faef61..41f5ec303 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -22,6 +22,7 @@ AM_CPPFLAGS = \
22-DLOCALE_DIR=\"$(localedir)\" \ 22-DLOCALE_DIR=\"$(localedir)\" \
23-DPACKAGE_LIB_DIR=\"$(libdir)\" \ 23-DPACKAGE_LIB_DIR=\"$(libdir)\" \
24-DICON_DIR=\"$(datadir)/icons\" \ 24-DICON_DIR=\"$(datadir)/icons\" \
25-DELM_TOP_BUILD_DIR=\"$(top_builddir)\" \
25-DELEMENTARY_BUILD \ 26-DELEMENTARY_BUILD \
26@ELEMENTARY_CFLAGS@ 27@ELEMENTARY_CFLAGS@
27 28
diff --git a/src/lib/elm_module.c b/src/lib/elm_module.c
index 39c7c6a72..febb15ec5 100644
--- a/src/lib/elm_module.c
+++ b/src/lib/elm_module.c
@@ -131,9 +131,16 @@ _elm_module_load(Elm_Module *m)
131 if (m->module) return EINA_TRUE; 131 if (m->module) return EINA_TRUE;
132 if (strchr(m->name, '/')) return EINA_FALSE; 132 if (strchr(m->name, '/')) return EINA_FALSE;
133 133
134 snprintf(buf, sizeof(buf), 134 if (getenv("ELM_RUN_IN_TREE"))
135 "%s/elementary/modules/%s/%s/module"EFL_SHARED_EXTENSION, 135 {
136 snprintf(buf, sizeof(buf),
137 ELM_TOP_BUILD_DIR "/src/modules/%s/.libs/module"EFL_SHARED_EXTENSION, m->name);
138 }
139 else
140 {
141 snprintf(buf, sizeof(buf), "%s/elementary/modules/%s/%s/module"EFL_SHARED_EXTENSION,
136 _elm_lib_dir, m->name, MODULE_ARCH); 142 _elm_lib_dir, m->name, MODULE_ARCH);
143 }
137 m->module = eina_module_new(buf); 144 m->module = eina_module_new(buf);
138 if ((m->module) && (eina_module_load(m->module) == EINA_TRUE)) 145 if ((m->module) && (eina_module_load(m->module) == EINA_TRUE))
139 { 146 {
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index a33bfa5fb..664077f84 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -1,5 +1,6 @@
1AM_TESTS_ENVIRONMENT = \ 1AM_TESTS_ENVIRONMENT = \
2 ELM_DATA_DIR=${top_builddir}/data 2 ELM_DATA_DIR=${top_builddir}/data \
3 ELM_RUN_IN_TREE=1
3 4
4AUTOMAKE_OPTIONS = 1.4 foreign 5AUTOMAKE_OPTIONS = 1.4 foreign
5MAINTAINERCLEANFILES = Makefile.in 6MAINTAINERCLEANFILES = Makefile.in
diff --git a/src/tests/elm_suite.c b/src/tests/elm_suite.c
index dde196291..bb9625fdf 100644
--- a/src/tests/elm_suite.c
+++ b/src/tests/elm_suite.c
@@ -108,6 +108,8 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
108 Suite *s; 108 Suite *s;
109 SRunner *sr; 109 SRunner *sr;
110 110
111 putenv("ELM_RUN_IN_TREE=1");
112
111 s = elm_suite(); 113 s = elm_suite();
112 sr = srunner_create(s); 114 sr = srunner_create(s);
113 115