forked from enlightenment/efl
efl/emotion: fix usage of eina_prefix, add checkme file.
we were using "" for locale that made eina_prefix think that we did not had a common prefix. take the time and add a magic file "checkme" to be checked at runtime to validate stuff. also made the binaries be searched in MODULE_ARCH namespace. SVN revision: 82507
This commit is contained in:
parent
83a8742d4e
commit
93ac29f610
|
@ -59,3 +59,10 @@ edje/vim/plugin-info.txt \
|
||||||
edje/vim/snippets/edc.snippets \
|
edje/vim/snippets/edc.snippets \
|
||||||
edje/vim/syntax/edc.vim \
|
edje/vim/syntax/edc.vim \
|
||||||
edje/vim/syntax/embryo.vim
|
edje/vim/syntax/embryo.vim
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# Emotion
|
||||||
|
emotionfilesdir = $(datadir)/emotion
|
||||||
|
emotionfiles_DATA = emotion/checkme
|
||||||
|
EXTRA_DIST += $(emotionfiles_DATA)
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
This is just a test file used to help emotion determine its prefix
|
||||||
|
location.
|
|
@ -21,10 +21,29 @@
|
||||||
static Eina_Prefix *pfx = NULL;
|
static Eina_Prefix *pfx = NULL;
|
||||||
|
|
||||||
static int _emotion_generic_log_domain = -1;
|
static int _emotion_generic_log_domain = -1;
|
||||||
|
#ifdef DBG
|
||||||
|
#undef DBG
|
||||||
|
#endif
|
||||||
#define DBG(...) EINA_LOG_DOM_DBG(_emotion_generic_log_domain, __VA_ARGS__)
|
#define DBG(...) EINA_LOG_DOM_DBG(_emotion_generic_log_domain, __VA_ARGS__)
|
||||||
|
|
||||||
|
#ifdef INF
|
||||||
|
#undef INF
|
||||||
|
#endif
|
||||||
#define INF(...) EINA_LOG_DOM_INFO(_emotion_generic_log_domain, __VA_ARGS__)
|
#define INF(...) EINA_LOG_DOM_INFO(_emotion_generic_log_domain, __VA_ARGS__)
|
||||||
|
|
||||||
|
#ifdef WRN
|
||||||
|
#undef WRN
|
||||||
|
#endif
|
||||||
#define WRN(...) EINA_LOG_DOM_WARN(_emotion_generic_log_domain, __VA_ARGS__)
|
#define WRN(...) EINA_LOG_DOM_WARN(_emotion_generic_log_domain, __VA_ARGS__)
|
||||||
|
|
||||||
|
#ifdef ERR
|
||||||
|
#undef ERR
|
||||||
|
#endif
|
||||||
#define ERR(...) EINA_LOG_DOM_ERR(_emotion_generic_log_domain, __VA_ARGS__)
|
#define ERR(...) EINA_LOG_DOM_ERR(_emotion_generic_log_domain, __VA_ARGS__)
|
||||||
|
|
||||||
|
#ifdef CRITICAL
|
||||||
|
#undef CRITICAL
|
||||||
|
#endif
|
||||||
#define CRITICAL(...) EINA_LOG_DOM_CRIT(_emotion_generic_log_domain, __VA_ARGS__)
|
#define CRITICAL(...) EINA_LOG_DOM_CRIT(_emotion_generic_log_domain, __VA_ARGS__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -83,7 +102,7 @@ _get_player(const char *name)
|
||||||
if (selected_name[0] == '/') cmd = selected_name;
|
if (selected_name[0] == '/') cmd = selected_name;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "%s/emotion/utils/%s",
|
snprintf(buf, sizeof(buf), "%s/emotion/utils/" MODULE_ARCH "/%s",
|
||||||
libdir, selected_name);
|
libdir, selected_name);
|
||||||
cmd = buf;
|
cmd = buf;
|
||||||
}
|
}
|
||||||
|
@ -98,7 +117,7 @@ _get_player(const char *name)
|
||||||
|
|
||||||
for (i = 0; players[i].name; i++)
|
for (i = 0; players[i].name; i++)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "%s/emotion/utils/%s",
|
snprintf(buf, sizeof(buf), "%s/emotion/utils/" MODULE_ARCH "/%s",
|
||||||
libdir, players[i].cmdline);
|
libdir, players[i].cmdline);
|
||||||
DBG("Try generic player '%s'", buf);
|
DBG("Try generic player '%s'", buf);
|
||||||
if (access(buf, R_OK | X_OK) == 0)
|
if (access(buf, R_OK | X_OK) == 0)
|
||||||
|
@ -1787,27 +1806,24 @@ static void module_close(Emotion_Video_Module *module EINA_UNUSED, void *video)
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
generic_module_init(void)
|
generic_module_init(void)
|
||||||
{
|
{
|
||||||
if (!pfx)
|
if (pfx) return EINA_TRUE;
|
||||||
{
|
|
||||||
pfx = eina_prefix_new(NULL, emotion_object_add,
|
pfx = eina_prefix_new(NULL, emotion_init,
|
||||||
"EMOTION", "emotion", NULL,
|
"EMOTION", "emotion", "checkme",
|
||||||
PACKAGE_BIN_DIR,
|
PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
|
||||||
PACKAGE_LIB_DIR,
|
PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
|
||||||
PACKAGE_DATA_DIR,
|
|
||||||
"");
|
|
||||||
if (!pfx) return EINA_FALSE;
|
if (!pfx) return EINA_FALSE;
|
||||||
}
|
|
||||||
return _emotion_module_register("generic", module_open, module_close);
|
return _emotion_module_register("generic", module_open, module_close);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
generic_module_shutdown(void)
|
generic_module_shutdown(void)
|
||||||
{
|
{
|
||||||
if (pfx)
|
if (!pfx) return;
|
||||||
{
|
|
||||||
eina_prefix_free(pfx);
|
eina_prefix_free(pfx);
|
||||||
pfx = NULL;
|
pfx = NULL;
|
||||||
}
|
|
||||||
_emotion_module_unregister("generic");
|
_emotion_module_unregister("generic");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1817,4 +1833,3 @@ EINA_MODULE_INIT(generic_module_init);
|
||||||
EINA_MODULE_SHUTDOWN(generic_module_shutdown);
|
EINA_MODULE_SHUTDOWN(generic_module_shutdown);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue