diff options
author | Gustavo Sverzut Barbieri <barbieri@profusion.mobi> | 2017-02-03 11:49:38 -0200 |
---|---|---|
committer | Gustavo Sverzut Barbieri <barbieri@profusion.mobi> | 2017-02-03 12:36:38 -0200 |
commit | 8dc853f2300ea70a9116325db773da22c6343c3c (patch) | |
tree | 841bdd4af4acac518732cd0c189de991fa4ffd73 /src/lib/evas/file/evas_module.c | |
parent | 75dc1b3fd711afa26f69f8244b64d2df9628fae4 (diff) |
ifdef RUN_IN_TREE logic.
This logic is only needed for autotools, cmake will replicate the
installation file structure and thus eina_prefix works out of box.
Diffstat (limited to '')
-rw-r--r-- | src/lib/evas/file/evas_module.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/evas/file/evas_module.c b/src/lib/evas/file/evas_module.c index 67f565657f..f05870ad2b 100644 --- a/src/lib/evas/file/evas_module.c +++ b/src/lib/evas/file/evas_module.c | |||
@@ -110,6 +110,7 @@ evas_module_paths_init(void) | |||
110 | { | 110 | { |
111 | char *libdir, *path; | 111 | char *libdir, *path; |
112 | 112 | ||
113 | #ifdef NEED_RUN_IN_TREE | ||
113 | #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) | 114 | #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) |
114 | if (getuid() == geteuid()) | 115 | if (getuid() == geteuid()) |
115 | #endif | 116 | #endif |
@@ -125,6 +126,7 @@ evas_module_paths_init(void) | |||
125 | } | 126 | } |
126 | } | 127 | } |
127 | } | 128 | } |
129 | #endif | ||
128 | 130 | ||
129 | /* 1. libevas.so/../evas/modules/ */ | 131 | /* 1. libevas.so/../evas/modules/ */ |
130 | libdir = (char *)_evas_module_libdir_get(); | 132 | libdir = (char *)_evas_module_libdir_get(); |
@@ -408,9 +410,11 @@ evas_module_engine_list(void) | |||
408 | unsigned int i; | 410 | unsigned int i; |
409 | const char *s, *s2; | 411 | const char *s, *s2; |
410 | char buf[PATH_MAX]; | 412 | char buf[PATH_MAX]; |
413 | #ifdef NEED_RUN_IN_TREE | ||
411 | Eina_Bool run_in_tree; | 414 | Eina_Bool run_in_tree; |
412 | 415 | ||
413 | run_in_tree = !!getenv("EFL_RUN_IN_TREE"); | 416 | run_in_tree = !!getenv("EFL_RUN_IN_TREE"); |
417 | #endif | ||
414 | 418 | ||
415 | EINA_LIST_FOREACH(evas_module_paths, l, s) | 419 | EINA_LIST_FOREACH(evas_module_paths, l, s) |
416 | { | 420 | { |
@@ -424,6 +428,7 @@ evas_module_engine_list(void) | |||
424 | { | 428 | { |
425 | const char *fname = fi->path + fi->name_start; | 429 | const char *fname = fi->path + fi->name_start; |
426 | 430 | ||
431 | #ifdef NEED_RUN_IN_TREE | ||
427 | buf[0] = '\0'; | 432 | buf[0] = '\0'; |
428 | #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) | 433 | #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) |
429 | if (getuid() == geteuid()) | 434 | if (getuid() == geteuid()) |
@@ -439,6 +444,7 @@ evas_module_engine_list(void) | |||
439 | } | 444 | } |
440 | 445 | ||
441 | if (buf[0] == '\0') | 446 | if (buf[0] == '\0') |
447 | #endif | ||
442 | snprintf(buf, sizeof(buf), "%s/engines/%s/%s", | 448 | snprintf(buf, sizeof(buf), "%s/engines/%s/%s", |
443 | s, fname, MODULE_ARCH); | 449 | s, fname, MODULE_ARCH); |
444 | 450 | ||
@@ -513,7 +519,9 @@ evas_module_find_type(Evas_Module_Type type, const char *name) | |||
513 | Evas_Module *em; | 519 | Evas_Module *em; |
514 | Eina_Module *en; | 520 | Eina_Module *en; |
515 | Eina_List *l; | 521 | Eina_List *l; |
522 | #ifdef NEED_RUN_IN_TREE | ||
516 | Eina_Bool run_in_tree; | 523 | Eina_Bool run_in_tree; |
524 | #endif | ||
517 | 525 | ||
518 | if ((unsigned int)type > 5) return NULL; | 526 | if ((unsigned int)type > 5) return NULL; |
519 | 527 | ||
@@ -524,7 +532,9 @@ evas_module_find_type(Evas_Module_Type type, const char *name) | |||
524 | return NULL; | 532 | return NULL; |
525 | } | 533 | } |
526 | 534 | ||
535 | #ifdef NEED_RUN_IN_TREE | ||
527 | run_in_tree = !!getenv("EFL_RUN_IN_TREE"); | 536 | run_in_tree = !!getenv("EFL_RUN_IN_TREE"); |
537 | #endif | ||
528 | 538 | ||
529 | EINA_LIST_FOREACH(evas_module_paths, l, path) | 539 | EINA_LIST_FOREACH(evas_module_paths, l, path) |
530 | { | 540 | { |
@@ -540,6 +550,7 @@ evas_module_find_type(Evas_Module_Type type, const char *name) | |||
540 | } | 550 | } |
541 | 551 | ||
542 | buffer[0] = '\0'; | 552 | buffer[0] = '\0'; |
553 | #if NEED_RUN_IN_TREE | ||
543 | #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) | 554 | #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) |
544 | if (getuid() == geteuid()) | 555 | if (getuid() == geteuid()) |
545 | #endif | 556 | #endif |
@@ -552,6 +563,7 @@ evas_module_find_type(Evas_Module_Type type, const char *name) | |||
552 | buffer[0] = '\0'; | 563 | buffer[0] = '\0'; |
553 | } | 564 | } |
554 | } | 565 | } |
566 | #endif | ||
555 | 567 | ||
556 | if (buffer[0] == '\0') | 568 | if (buffer[0] == '\0') |
557 | snprintf(buffer, sizeof(buffer), "%s/%s/%s/%s/%s", | 569 | snprintf(buffer, sizeof(buffer), "%s/%s/%s/%s/%s", |