diff options
author | Gustavo Sverzut Barbieri <barbieri@gmail.com> | 2013-01-04 17:19:43 +0000 |
---|---|---|
committer | Gustavo Sverzut Barbieri <barbieri@gmail.com> | 2013-01-04 17:19:43 +0000 |
commit | 733425c62c7b9a23ad465b5b9700612fae3ee356 (patch) | |
tree | fdc2f4e310d964cb96fa56a73d66fdba246d06b8 /src/lib/ecore_imf | |
parent | 365a4acf97c59470c317a3e80d7586efe9344bb5 (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_imf')
-rw-r--r-- | src/lib/ecore_imf/ecore_imf_module.c | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/src/lib/ecore_imf/ecore_imf_module.c b/src/lib/ecore_imf/ecore_imf_module.c index cbdee47178..bf8cf6b731 100644 --- a/src/lib/ecore_imf/ecore_imf_module.c +++ b/src/lib/ecore_imf/ecore_imf_module.c | |||
@@ -24,13 +24,57 @@ typedef struct _Ecore_IMF_Selector | |||
24 | 24 | ||
25 | static Eina_Hash *modules = NULL; | 25 | static Eina_Hash *modules = NULL; |
26 | static Eina_Array *module_list = NULL; | 26 | static Eina_Array *module_list = NULL; |
27 | static Eina_Prefix *pfx = NULL; | ||
27 | 28 | ||
28 | void | 29 | void |
29 | ecore_imf_module_init(void) | 30 | ecore_imf_module_init(void) |
30 | { | 31 | { |
31 | char *homedir; | 32 | char *homedir; |
33 | char buf[PATH_MAX] = ""; | ||
32 | 34 | ||
33 | module_list = eina_module_list_get(NULL, PACKAGE_LIB_DIR "/ecore/immodules", 0, NULL, NULL); | 35 | pfx = eina_prefix_new(NULL, ecore_imf_init, |
36 | "ECORE_IMF", "ecore_imf", "checkme", | ||
37 | PACKAGE_BIN_DIR, PACKAGE_LIB_DIR, | ||
38 | PACKAGE_DATA_DIR, PACKAGE_DATA_DIR); | ||
39 | |||
40 | if (getenv("EFL_RUN_IN_TREE")) | ||
41 | { | ||
42 | struct stat st; | ||
43 | snprintf(buf, sizeof(buf), "%s/src/modules/ecore/immodules", | ||
44 | PACKAGE_BUILD_DIR); | ||
45 | if (stat(buf, &st) == 0) | ||
46 | { | ||
47 | const char *built_modules[] = { | ||
48 | #ifdef ENABLE_XIM | ||
49 | "xim", | ||
50 | #endif | ||
51 | #ifdef BUILD_ECORE_IMF_IBUS | ||
52 | "ibus", | ||
53 | #endif | ||
54 | #ifdef BUILD_ECORE_IMF_SCIM | ||
55 | "scim", | ||
56 | #endif | ||
57 | NULL | ||
58 | }; | ||
59 | const char **itr; | ||
60 | for (itr = built_modules; *itr != NULL; itr++) | ||
61 | { | ||
62 | snprintf(buf, sizeof(buf), | ||
63 | "%s/src/modules/ecore/immodules/%s/.libs", | ||
64 | PACKAGE_BUILD_DIR, *itr); | ||
65 | module_list = eina_module_list_get(module_list, buf, | ||
66 | EINA_FALSE, NULL, NULL); | ||
67 | } | ||
68 | |||
69 | if (module_list) | ||
70 | eina_module_list_load(module_list); | ||
71 | return; | ||
72 | } | ||
73 | } | ||
74 | |||
75 | snprintf(buf, sizeof(buf), "%s/ecore/immodules", eina_prefix_lib_get(pfx)); | ||
76 | |||
77 | module_list = eina_module_list_get(NULL, buf, 0, NULL, NULL); | ||
34 | homedir = eina_module_environment_path_get("HOME", "/.ecore/immodules"); | 78 | homedir = eina_module_environment_path_get("HOME", "/.ecore/immodules"); |
35 | if (homedir) | 79 | if (homedir) |
36 | { | 80 | { |
@@ -54,6 +98,9 @@ ecore_imf_module_shutdown(void) | |||
54 | eina_array_free(module_list); | 98 | eina_array_free(module_list); |
55 | module_list = NULL; | 99 | module_list = NULL; |
56 | } | 100 | } |
101 | |||
102 | eina_prefix_free(pfx); | ||
103 | pfx = NULL; | ||
57 | } | 104 | } |
58 | 105 | ||
59 | static Eina_Bool | 106 | static Eina_Bool |