summaryrefslogtreecommitdiff
path: root/src/lib/eeze
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/eeze
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/eeze')
-rw-r--r--src/lib/eeze/eeze_sensor.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/lib/eeze/eeze_sensor.c b/src/lib/eeze/eeze_sensor.c
index b808c6cc50..157b8a9c6a 100644
--- a/src/lib/eeze/eeze_sensor.c
+++ b/src/lib/eeze/eeze_sensor.c
@@ -9,7 +9,8 @@
9#include <Eeze_Sensor.h> 9#include <Eeze_Sensor.h>
10#include "eeze_sensor_private.h" 10#include "eeze_sensor_private.h"
11 11
12Eeze_Sensor *g_handle; 12static Eeze_Sensor *g_handle;
13static Eina_Prefix *pfx;
13 14
14/* Priority order for modules. The one with the highest order of the available 15/* Priority order for modules. The one with the highest order of the available
15 * ones will be used. This in good enough for now as we only have two modules 16 * ones will be used. This in good enough for now as we only have two modules
@@ -77,10 +78,14 @@ eeze_sensor_modules_load(void)
77 * is one of these items. We do load the modules from the builddir if the 78 * is one of these items. We do load the modules from the builddir if the
78 * environment is set. Normal case is to use installed modules from system 79 * environment is set. Normal case is to use installed modules from system
79 */ 80 */
80 if (getenv("EEZE_USE_IN_TREE_MODULES")) 81 if (getenv("EFL_RUN_IN_TREE"))
81 g_handle->modules_array = eina_module_list_get(NULL, PACKAGE_BUILD_DIR "/src/modules/.libs/", 0, NULL, NULL); 82 g_handle->modules_array = eina_module_list_get(NULL, PACKAGE_BUILD_DIR "/src/modules/eeze/.libs/", 0, NULL, NULL);
82 else 83 else
83 g_handle->modules_array = eina_module_list_get(NULL, PACKAGE_LIB_DIR "/eeze/sensor/", 0, NULL, NULL); 84 {
85 char buf[PATH_MAX];
86 snprintf(buf, sizeof(buf), "%s/eeze/sensor/", eina_prefix_lib_get(pfx));
87 g_handle->modules_array = eina_module_list_get(NULL, buf, 0, NULL, NULL);
88 }
84 89
85 if (!g_handle->modules_array) 90 if (!g_handle->modules_array)
86 { 91 {
@@ -104,7 +109,7 @@ eeze_sensor_modules_unload(void)
104 * been loaded in initialized. They stay in the hash funtion until they 109 * been loaded in initialized. They stay in the hash funtion until they
105 * unregister themself. 110 * unregister themself.
106 */ 111 */
107Eina_Bool 112EAPI Eina_Bool
108eeze_sensor_module_register(const char *name, Eeze_Sensor_Module *mod) 113eeze_sensor_module_register(const char *name, Eeze_Sensor_Module *mod)
109{ 114{
110 Eeze_Sensor_Module *module = NULL; 115 Eeze_Sensor_Module *module = NULL;
@@ -127,7 +132,7 @@ eeze_sensor_module_register(const char *name, Eeze_Sensor_Module *mod)
127/* This function is offered to the modules to unregsiter itself. When requested 132/* This function is offered to the modules to unregsiter itself. When requested
128 * we remove them safely from the hash. 133 * we remove them safely from the hash.
129 */ 134 */
130Eina_Bool 135EAPI Eina_Bool
131eeze_sensor_module_unregister(const char *name) 136eeze_sensor_module_unregister(const char *name)
132{ 137{
133 DBG("Unregister module %s", name); 138 DBG("Unregister module %s", name);
@@ -290,6 +295,9 @@ eeze_sensor_shutdown(void)
290 free(g_handle); 295 free(g_handle);
291 g_handle = NULL; 296 g_handle = NULL;
292 297
298 eina_prefix_free(pfx);
299 pfx = NULL;
300
293 eina_shutdown(); 301 eina_shutdown();
294} 302}
295 303
@@ -298,6 +306,10 @@ eeze_sensor_init(void)
298{ 306{
299 if (!eina_init()) return EINA_FALSE; 307 if (!eina_init()) return EINA_FALSE;
300 308
309 pfx = eina_prefix_new(NULL, eeze_sensor_init, "EEZE", "eeze", "checkme",
310 PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
311 PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
312
301 g_handle = calloc(1, sizeof(Eeze_Sensor)); 313 g_handle = calloc(1, sizeof(Eeze_Sensor));
302 if (!g_handle) return EINA_FALSE; 314 if (!g_handle) return EINA_FALSE;
303 315