summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 18:00:12 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 18:00:12 +0000
commit71cf862c95bff9cce8906cddb68dc98239a96b98 (patch)
tree000e76c6bd8021c204cc7db5ed460de1b6995bd2
parent1eddf879657d927c9773078bc5c88eefc6b9bc28 (diff)
efl/evas_cserve2: use eina_prefix
SVN revision: 82220
-rw-r--r--src/Makefile_Evas.am4
-rw-r--r--src/bin/evas/evas_cserve2.h2
-rw-r--r--src/bin/evas/evas_cserve2_main.c14
-rw-r--r--src/bin/evas/evas_cserve2_slave.c11
-rw-r--r--src/bin/evas/evas_cserve2_slaves.c3
5 files changed, 31 insertions, 3 deletions
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 = \
1407-I$(top_srcdir)/src/lib/evas/include \ 1407-I$(top_srcdir)/src/lib/evas/include \
1408-I$(top_srcdir)/src/lib/evas/cserve2 \ 1408-I$(top_srcdir)/src/lib/evas/cserve2 \
1409-I$(top_srcdir)/src/lib/eet \ 1409-I$(top_srcdir)/src/lib/eet \
1410-DPACKAGE_BIN_DIR=\"$(bindir)\" \
1410-DPACKAGE_LIB_DIR=\"$(libdir)\" \ 1411-DPACKAGE_LIB_DIR=\"$(libdir)\" \
1412-DPACKAGE_DATA_DIR=\"$(datadir)/evas\" \
1411@EVAS_CFLAGS@ 1413@EVAS_CFLAGS@
1412 1414
1413bin_evas_evas_cserve2_LDADD = \ 1415bin_evas_evas_cserve2_LDADD = \
@@ -1471,7 +1473,9 @@ bin_evas_evas_cserve2_slave_CPPFLAGS = \
1471-I$(top_srcdir)/src/lib/evas \ 1473-I$(top_srcdir)/src/lib/evas \
1472-I$(top_srcdir)/src/lib/evas/include \ 1474-I$(top_srcdir)/src/lib/evas/include \
1473-I$(top_srcdir)/src/lib/evas/cserve2 \ 1475-I$(top_srcdir)/src/lib/evas/cserve2 \
1476-DPACKAGE_BIN_DIR=\"$(bindir)\" \
1474-DPACKAGE_LIB_DIR=\"$(libdir)\" \ 1477-DPACKAGE_LIB_DIR=\"$(libdir)\" \
1478-DPACKAGE_DATA_DIR=\"$(datadir)/evas\" \
1475@EVAS_CFLAGS@ 1479@EVAS_CFLAGS@
1476 1480
1477bin_evas_evas_cserve2_slave_LDADD = \ 1481bin_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 @@
25 25
26extern int _evas_cserve2_bin_log_dom; 26extern int _evas_cserve2_bin_log_dom;
27 27
28extern Eina_Prefix *_evas_cserve2_pfx;
29
28typedef struct _Slave Slave; 30typedef struct _Slave Slave;
29typedef struct _Slave_Thread_Data Slave_Thread_Data; 31typedef struct _Slave_Thread_Data Slave_Thread_Data;
30typedef struct _Shm_Handle Shm_Handle; 32typedef 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 @@
13#endif 13#endif
14#define CSERVE2_BIN_DEFAULT_COLOR EINA_COLOR_BLUE 14#define CSERVE2_BIN_DEFAULT_COLOR EINA_COLOR_BLUE
15 15
16Eina_Prefix *_evas_cserve2_pfx = NULL;
16int _evas_cserve2_bin_log_dom = -1; 17int _evas_cserve2_bin_log_dom = -1;
17static unsigned int _client_id = 0; 18static unsigned int _client_id = 0;
18static Eina_Hash *client_list = NULL; 19static Eina_Hash *client_list = NULL;
@@ -316,15 +317,23 @@ _clients_finish(void)
316} 317}
317 318
318int 319int
319main(int argc EINA_UNUSED, const char *argv[] EINA_UNUSED) 320main(int argc EINA_UNUSED, const char *argv[])
320{ 321{
321 eina_init(); 322 eina_init();
322 323
324 _evas_cserve2_pfx = eina_prefix_new(argv[0], main,
325 "EVAS", "evas", "checkme",
326 PACKAGE_BIN_DIR,
327 PACKAGE_LIB_DIR,
328 PACKAGE_DATA_DIR,
329 PACKAGE_DATA_DIR);
330
323 _evas_cserve2_bin_log_dom = eina_log_domain_register 331 _evas_cserve2_bin_log_dom = eina_log_domain_register
324 ("evas_cserve2_bin", CSERVE2_BIN_DEFAULT_COLOR); 332 ("evas_cserve2_bin", CSERVE2_BIN_DEFAULT_COLOR);
325 if (_evas_cserve2_bin_log_dom < 0) 333 if (_evas_cserve2_bin_log_dom < 0)
326 { 334 {
327 EINA_LOG_ERR("impossible to create a log domain."); 335 EINA_LOG_ERR("impossible to create a log domain.");
336 eina_prefix_free(_evas_cserve2_pfx);
328 eina_shutdown(); 337 eina_shutdown();
329 exit(1); 338 exit(1);
330 } 339 }
@@ -367,11 +376,14 @@ main(int argc EINA_UNUSED, const char *argv[] EINA_UNUSED)
367 376
368 cserve2_main_loop_finish(); 377 cserve2_main_loop_finish();
369 378
379 eina_prefix_free(_evas_cserve2_pfx);
380
370 eina_log_domain_unregister(_evas_cserve2_bin_log_dom); 381 eina_log_domain_unregister(_evas_cserve2_bin_log_dom);
371 eina_shutdown(); 382 eina_shutdown();
372 return 0; 383 return 0;
373 384
374error: 385error:
386 eina_prefix_free(_evas_cserve2_pfx);
375 eina_log_domain_unregister(_evas_cserve2_bin_log_dom); 387 eina_log_domain_unregister(_evas_cserve2_bin_log_dom);
376 eina_shutdown(); 388 eina_shutdown();
377 exit(1); 389 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 @@
15 15
16static Eina_Hash *loaders = NULL; 16static Eina_Hash *loaders = NULL;
17static Eina_List *modules = NULL; 17static Eina_List *modules = NULL;
18static Eina_Prefix *pfx = NULL;
18 19
19struct ext_loader_s 20struct ext_loader_s
20{ 21{
@@ -86,7 +87,8 @@ loader_module_find(const char *type)
86 if (l) return l; 87 if (l) return l;
87 88
88 /* FIXME: Look in every possible path, but what will those be? */ 89 /* FIXME: Look in every possible path, but what will those be? */
89 snprintf(buf, sizeof(buf), PACKAGE_LIB_DIR "/evas/cserve2/loaders/%s/%s/%s", 90 snprintf(buf, sizeof(buf), "%s/evas/cserve2/loaders/%s/%s/%s",
91 eina_prefix_lib_get(pfx),
90 type, MODULE_ARCH, EVAS_MODULE_NAME_IMAGE_LOADER); 92 type, MODULE_ARCH, EVAS_MODULE_NAME_IMAGE_LOADER);
91 93
92 em = eina_module_new(buf); 94 em = eina_module_new(buf);
@@ -442,6 +444,12 @@ int main(int c, char **v)
442 return 1; 444 return 1;
443 445
444 eina_init(); 446 eina_init();
447 pfx = eina_prefix_new(v[0], main,
448 "EVAS", "evas", "checkme",
449 PACKAGE_BIN_DIR,
450 PACKAGE_LIB_DIR,
451 PACKAGE_DATA_DIR,
452 PACKAGE_DATA_DIR);
445 453
446 loaders = eina_hash_string_superfast_new(NULL); 454 loaders = eina_hash_string_superfast_new(NULL);
447 455
@@ -476,6 +484,7 @@ int main(int c, char **v)
476 EINA_LIST_FREE(modules, m) 484 EINA_LIST_FREE(modules, m)
477 eina_module_free(m); 485 eina_module_free(m);
478 486
487 eina_prefix_free(pfx);
479 eina_shutdown(); 488 eina_shutdown();
480 489
481 return 0; 490 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)
337 if (!access(buf, X_OK)) 337 if (!access(buf, X_OK))
338 return eina_stringshare_add(buf); 338 return eina_stringshare_add(buf);
339 339
340 snprintf(buf, sizeof(buf), PACKAGE_LIB_DIR"/evas/cserve2/bin/%s", name); 340 snprintf(buf, sizeof(buf), "%s/evas/cserve2/bin/%s",
341 eina_prefix_lib_get(_evas_cserve2_pfx), name);
341 if (!access(buf, X_OK)) 342 if (!access(buf, X_OK))
342 return eina_stringshare_add(buf); 343 return eina_stringshare_add(buf);
343 344