efl/evas_cserve2: use eina_prefix

SVN revision: 82220
This commit is contained in:
Gustavo Sverzut Barbieri 2013-01-04 18:00:12 +00:00
parent 1eddf87965
commit 71cf862c95
5 changed files with 31 additions and 3 deletions

View File

@ -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 = \

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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);