From: Gustavo Sverzut Barbieri Date: Fri, 4 Jan 2013 18:00:12 +0000 (+0000) Subject: efl/evas_cserve2: use eina_prefix X-Git-Tag: submit/devel/efl/20131022.203902~2510 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71cf862c95bff9cce8906cddb68dc98239a96b98;p=platform%2Fupstream%2Fefl.git efl/evas_cserve2: use eina_prefix SVN revision: 82220 --- diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index efd6225..0177efb 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -1407,7 +1407,9 @@ bin_evas_evas_cserve2_CPPFLAGS = \ -I$(top_srcdir)/src/lib/evas/include \ -I$(top_srcdir)/src/lib/evas/cserve2 \ -I$(top_srcdir)/src/lib/eet \ +-DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ +-DPACKAGE_DATA_DIR=\"$(datadir)/evas\" \ @EVAS_CFLAGS@ bin_evas_evas_cserve2_LDADD = \ @@ -1471,7 +1473,9 @@ bin_evas_evas_cserve2_slave_CPPFLAGS = \ -I$(top_srcdir)/src/lib/evas \ -I$(top_srcdir)/src/lib/evas/include \ -I$(top_srcdir)/src/lib/evas/cserve2 \ +-DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ +-DPACKAGE_DATA_DIR=\"$(datadir)/evas\" \ @EVAS_CFLAGS@ bin_evas_evas_cserve2_slave_LDADD = \ diff --git a/src/bin/evas/evas_cserve2.h b/src/bin/evas/evas_cserve2.h index af21cca..43c38c8 100644 --- a/src/bin/evas/evas_cserve2.h +++ b/src/bin/evas/evas_cserve2.h @@ -25,6 +25,8 @@ extern int _evas_cserve2_bin_log_dom; +extern Eina_Prefix *_evas_cserve2_pfx; + typedef struct _Slave Slave; typedef struct _Slave_Thread_Data Slave_Thread_Data; typedef struct _Shm_Handle Shm_Handle; diff --git a/src/bin/evas/evas_cserve2_main.c b/src/bin/evas/evas_cserve2_main.c index 5c57b72..4c29106 100644 --- a/src/bin/evas/evas_cserve2_main.c +++ b/src/bin/evas/evas_cserve2_main.c @@ -13,6 +13,7 @@ #endif #define CSERVE2_BIN_DEFAULT_COLOR EINA_COLOR_BLUE +Eina_Prefix *_evas_cserve2_pfx = NULL; int _evas_cserve2_bin_log_dom = -1; static unsigned int _client_id = 0; static Eina_Hash *client_list = NULL; @@ -316,15 +317,23 @@ _clients_finish(void) } int -main(int argc EINA_UNUSED, const char *argv[] EINA_UNUSED) +main(int argc EINA_UNUSED, const char *argv[]) { eina_init(); + _evas_cserve2_pfx = eina_prefix_new(argv[0], main, + "EVAS", "evas", "checkme", + PACKAGE_BIN_DIR, + PACKAGE_LIB_DIR, + PACKAGE_DATA_DIR, + PACKAGE_DATA_DIR); + _evas_cserve2_bin_log_dom = eina_log_domain_register ("evas_cserve2_bin", CSERVE2_BIN_DEFAULT_COLOR); if (_evas_cserve2_bin_log_dom < 0) { EINA_LOG_ERR("impossible to create a log domain."); + eina_prefix_free(_evas_cserve2_pfx); eina_shutdown(); exit(1); } @@ -367,11 +376,14 @@ main(int argc EINA_UNUSED, const char *argv[] EINA_UNUSED) cserve2_main_loop_finish(); + eina_prefix_free(_evas_cserve2_pfx); + eina_log_domain_unregister(_evas_cserve2_bin_log_dom); eina_shutdown(); return 0; error: + eina_prefix_free(_evas_cserve2_pfx); eina_log_domain_unregister(_evas_cserve2_bin_log_dom); eina_shutdown(); exit(1); diff --git a/src/bin/evas/evas_cserve2_slave.c b/src/bin/evas/evas_cserve2_slave.c index 5a06017..e930876 100644 --- a/src/bin/evas/evas_cserve2_slave.c +++ b/src/bin/evas/evas_cserve2_slave.c @@ -15,6 +15,7 @@ static Eina_Hash *loaders = NULL; static Eina_List *modules = NULL; +static Eina_Prefix *pfx = NULL; struct ext_loader_s { @@ -86,7 +87,8 @@ loader_module_find(const char *type) if (l) return l; /* FIXME: Look in every possible path, but what will those be? */ - snprintf(buf, sizeof(buf), PACKAGE_LIB_DIR "/evas/cserve2/loaders/%s/%s/%s", + snprintf(buf, sizeof(buf), "%s/evas/cserve2/loaders/%s/%s/%s", + eina_prefix_lib_get(pfx), type, MODULE_ARCH, EVAS_MODULE_NAME_IMAGE_LOADER); em = eina_module_new(buf); @@ -442,6 +444,12 @@ int main(int c, char **v) return 1; eina_init(); + pfx = eina_prefix_new(v[0], main, + "EVAS", "evas", "checkme", + PACKAGE_BIN_DIR, + PACKAGE_LIB_DIR, + PACKAGE_DATA_DIR, + PACKAGE_DATA_DIR); loaders = eina_hash_string_superfast_new(NULL); @@ -476,6 +484,7 @@ int main(int c, char **v) EINA_LIST_FREE(modules, m) eina_module_free(m); + eina_prefix_free(pfx); eina_shutdown(); return 0; diff --git a/src/bin/evas/evas_cserve2_slaves.c b/src/bin/evas/evas_cserve2_slaves.c index 63a11c0..c7c4c92 100644 --- a/src/bin/evas/evas_cserve2_slaves.c +++ b/src/bin/evas/evas_cserve2_slaves.c @@ -337,7 +337,8 @@ _slave_proc_path_get(const char *name) if (!access(buf, X_OK)) return eina_stringshare_add(buf); - snprintf(buf, sizeof(buf), PACKAGE_LIB_DIR"/evas/cserve2/bin/%s", name); + snprintf(buf, sizeof(buf), "%s/evas/cserve2/bin/%s", + eina_prefix_lib_get(_evas_cserve2_pfx), name); if (!access(buf, X_OK)) return eina_stringshare_add(buf);