From debbdfe022610edb9c545ac4f2777151d73958aa Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Wed, 1 Aug 2012 06:29:26 +0000 Subject: [PATCH] use eina_prefix for module finding as well as generic util bins... and fix to proviude data file to prefix finding works right with debina multiarch. SVN revision: 74710 --- legacy/evas/configure.ac | 1 + legacy/evas/data/Makefile.am | 6 ++++++ legacy/evas/data/checkme | 2 ++ legacy/evas/src/lib/file/evas_module.c | 19 +++++++++++++++---- 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 legacy/evas/data/Makefile.am create mode 100644 legacy/evas/data/checkme diff --git a/legacy/evas/configure.ac b/legacy/evas/configure.ac index 46ebb80c32..47cee6580d 100644 --- a/legacy/evas/configure.ac +++ b/legacy/evas/configure.ac @@ -1945,6 +1945,7 @@ src/static_deps/liblinebreak/Makefile src/lib/include/Makefile src/examples/Makefile src/tests/Makefile +data/Makefile evas.spec ]) diff --git a/legacy/evas/data/Makefile.am b/legacy/evas/data/Makefile.am new file mode 100644 index 0000000000..80a8cc6a07 --- /dev/null +++ b/legacy/evas/data/Makefile.am @@ -0,0 +1,6 @@ +MAINTAINERCLEANFILES = Makefile.in + +filesdir = $(datadir)/evas +files_DATA = checkme + +EXTRA_DIST = $(files_DATA) diff --git a/legacy/evas/data/checkme b/legacy/evas/data/checkme new file mode 100644 index 0000000000..987063d4cb --- /dev/null +++ b/legacy/evas/data/checkme @@ -0,0 +1,2 @@ +This is just a test file used to help evas determine its prefix +location. diff --git a/legacy/evas/src/lib/file/evas_module.c b/legacy/evas/src/lib/file/evas_module.c index ffef61e3e9..bdb94dfb7c 100644 --- a/legacy/evas/src/lib/file/evas_module.c +++ b/legacy/evas/src/lib/file/evas_module.c @@ -42,7 +42,7 @@ _evas_module_append(Eina_List *list, char *path) void evas_module_paths_init(void) { - char *path; + char *libdir, *path; /* 1. ~/.evas/modules/ */ path = eina_module_environment_path_get("HOME", "/.evas/modules"); @@ -56,13 +56,24 @@ evas_module_paths_init(void) evas_module_paths = _evas_module_append(evas_module_paths, path); /* 3. libevas.so/../evas/modules/ */ - path = eina_module_symbol_path_get(evas_module_paths_init, "/evas/modules"); + libdir = (char *)_evas_module_libdir_get(); + if (!libdir) + path = eina_module_symbol_path_get(evas_module_paths_init, "/evas/modules"); + else + { + path = malloc(strlen(libdir) + strlen("/evas/modules") + 1); + if (path) + { + strcpy(path, libdir); + strcat(path, "/evas/modules"); + } + } if (eina_list_search_unsorted(evas_module_paths, (Eina_Compare_Cb) strcmp, path)) free(path); else evas_module_paths = _evas_module_append(evas_module_paths, path); - /* 4. PREFIX/evas/modules/ */ + /* 4. PREFIX/lib/evas/modules/ */ #ifndef _MSC_VER path = PACKAGE_LIB_DIR "/evas/modules"; if (!eina_list_search_unsorted(evas_module_paths, (Eina_Compare_Cb) strcmp, path)) @@ -616,7 +627,7 @@ EAPI const char * _evas_module_libdir_get(void) { if (!pfx) pfx = eina_prefix_new - (NULL, _evas_module_libdir_get, "EVAS", "evas", NULL, + (NULL, _evas_module_libdir_get, "EVAS", "evas", "checkme", PACKAGE_BIN_DIR, PACKAGE_LIB_DIR, PACKAGE_DATA_DIR, PACKAGE_DATA_DIR); if (!pfx) return NULL; return eina_prefix_lib_get(pfx);