use eina_prefix for module finding as well as generic util bins... and
authorCarsten Haitzler <raster@rasterman.com>
Wed, 1 Aug 2012 06:29:26 +0000 (06:29 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Wed, 1 Aug 2012 06:29:26 +0000 (06:29 +0000)
fix to proviude data file to prefix finding works right with debina
multiarch.

SVN revision: 74710

legacy/evas/configure.ac
legacy/evas/data/Makefile.am [new file with mode: 0644]
legacy/evas/data/checkme [new file with mode: 0644]
legacy/evas/src/lib/file/evas_module.c

index 46ebb80..47cee65 100644 (file)
@@ -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 (file)
index 0000000..80a8cc6
--- /dev/null
@@ -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 (file)
index 0000000..987063d
--- /dev/null
@@ -0,0 +1,2 @@
+This is just a test file used to help evas determine its prefix
+location.
index ffef61e..bdb94df 100644 (file)
@@ -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);