forked from enlightenment/efl
eina - does modules like the rest of efl, so it's able to be installed with
multiple versions at the same time. eventually will neeed to also include major number in release name too. SVN revision: 45594
This commit is contained in:
parent
4405fdfed1
commit
735ad48c39
|
@ -28,6 +28,9 @@ AC_DEFINE_UNQUOTED(VMAJ, ["$VMAJ"], [Eina major version number])
|
|||
AC_SUBST(VMAJ)
|
||||
AC_SUBST(version_info)
|
||||
|
||||
MODULE_ARCH="$host_os-$host_cpu-$release"
|
||||
AC_SUBST(MODULE_ARCH)
|
||||
AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture")
|
||||
|
||||
### Needed information
|
||||
|
||||
|
|
|
@ -66,6 +66,7 @@ EAPI const char * eina_module_file_get(const Eina_Module *m) EINA_PURE EINA_WARN
|
|||
EAPI char *eina_module_symbol_path_get(const void *symbol, const char *sub_dir) EINA_PURE EINA_MALLOC EINA_ARG_NONNULL(1, 2);
|
||||
EAPI char *eina_module_environment_path_get(const char *env, const char *sub_dir) EINA_PURE EINA_MALLOC EINA_ARG_NONNULL(1, 2);
|
||||
|
||||
EAPI Eina_Array * eina_module_arch_list_get(Eina_Array *array, const char *path, const char *arch);
|
||||
EAPI Eina_Array * eina_module_list_get(Eina_Array *array, const char *path, unsigned int recursive, Eina_Module_Cb cb, void *data) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
|
||||
EAPI void eina_module_list_load(Eina_Array *list) EINA_ARG_NONNULL(1);
|
||||
EAPI void eina_module_list_unload(Eina_Array *list) EINA_ARG_NONNULL(1);
|
||||
|
|
|
@ -165,18 +165,18 @@ eina_mempool_init(void)
|
|||
_backends = eina_hash_string_superfast_new(NULL);
|
||||
|
||||
/* dynamic backends */
|
||||
_modules = eina_module_list_get(NULL, PACKAGE_LIB_DIR "/eina-"VMAJ"/mp/", 0, NULL, NULL);
|
||||
_modules = eina_module_arch_list_get(NULL, PACKAGE_LIB_DIR "/eina/modules/mp", MODULE_ARCH);
|
||||
|
||||
path = eina_module_environment_path_get("HOME", "/.eina-"VMAJ"/mp/");
|
||||
_modules = eina_module_list_get(_modules, path, 0, NULL, NULL);
|
||||
path = eina_module_environment_path_get("HOME", "/.eina/mp/modules/mp");
|
||||
_modules = eina_module_arch_list_get(_modules, path, MODULE_ARCH);
|
||||
if (path) free(path);
|
||||
|
||||
path = eina_module_environment_path_get("EINA_MODULES_MEMPOOL_DIR", "/eina-"VMAJ"/mp/");
|
||||
_modules = eina_module_list_get(_modules, path, 0, NULL, NULL);
|
||||
path = eina_module_environment_path_get("EINA_MODULES_MEMPOOL_DIR", "/eina/modules/mp");
|
||||
_modules = eina_module_arch_list_get(_modules, path, MODULE_ARCH);
|
||||
if (path) free(path);
|
||||
|
||||
path = eina_module_symbol_path_get(eina_init, "/eina-"VMAJ"/mp/");
|
||||
_modules = eina_module_list_get(_modules, path, 0, NULL, NULL);
|
||||
path = eina_module_symbol_path_get(eina_init, "/eina/modules/mp");
|
||||
_modules = eina_module_arch_list_get(_modules, path, MODULE_ARCH);
|
||||
if (path) free(path);
|
||||
|
||||
if (!_modules)
|
||||
|
@ -186,6 +186,7 @@ eina_mempool_init(void)
|
|||
goto mempool_init_error;
|
||||
}
|
||||
eina_module_list_load(_modules);
|
||||
|
||||
/* builtin backends */
|
||||
#ifdef EINA_STATIC_BUILD_CHAINED_POOL
|
||||
chained_init();
|
||||
|
|
|
@ -511,6 +511,51 @@ EAPI char *eina_module_environment_path_get(const char *env, const char *sub_dir
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void _dir_arch_list_db(const char *name, const char *path, void *data)
|
||||
{
|
||||
Dir_List_Get_Cb_Data *cb_data = data;
|
||||
Eina_Module *m;
|
||||
char *file;
|
||||
size_t length;
|
||||
|
||||
length = strlen(path) + 1 + strlen(name) + 1 +
|
||||
strlen((char *)(cb_data->data)) + 1 + sizeof("module") +
|
||||
sizeof(SHARED_LIB_SUFFIX) + 1;
|
||||
|
||||
file = alloca(length);
|
||||
snprintf(file, length, "%s/%s/%s/module" SHARED_LIB_SUFFIX,
|
||||
path, name, (char *)(cb_data->data));
|
||||
m = eina_module_new(file);
|
||||
if (!m)
|
||||
return;
|
||||
eina_array_push(cb_data->array, m);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of modules found on the directory path
|
||||
*
|
||||
* @param array The array that stores the list of the modules.
|
||||
* @param path The directory's path to search for modules
|
||||
* @param arch the architecture string
|
||||
* @param cb Callback function to call, if the return value of the callback is zero
|
||||
* it won't be added to the list, if it is one, it will.
|
||||
* @param data Data passed to the callback function
|
||||
*/
|
||||
EAPI Eina_Array * eina_module_arch_list_get(Eina_Array *array, const char *path, const char *arch)
|
||||
{
|
||||
Dir_List_Get_Cb_Data list_get_cb_data;
|
||||
|
||||
if ((!path) || (!arch)) return array;
|
||||
|
||||
list_get_cb_data.array = array ? array : eina_array_new(4);
|
||||
list_get_cb_data.cb = NULL;
|
||||
list_get_cb_data.data = (void *)arch;
|
||||
|
||||
eina_file_dir_list(path, 0, &_dir_arch_list_db, &list_get_cb_data);
|
||||
|
||||
return list_get_cb_data.array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of modules found on the directory path
|
||||
*
|
||||
|
|
|
@ -10,16 +10,16 @@ AM_CPPFLAGS = \
|
|||
if EINA_BUILD_BUDDY
|
||||
if !EINA_STATIC_BUILD_BUDDY
|
||||
|
||||
controllerdir = $(libdir)/eina/mp
|
||||
controller_LTLIBRARIES = eina_buddy.la
|
||||
controllerdir = $(libdir)/eina/modules/mp/buddy/$(MODULE_ARCH)
|
||||
controller_LTLIBRARIES = module.la
|
||||
|
||||
eina_buddy_la_SOURCES = \
|
||||
module_la_SOURCES = \
|
||||
eina_buddy.c
|
||||
|
||||
eina_buddy_la_CFLAGS = @EINA_CFLAGS@
|
||||
eina_buddy_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@
|
||||
eina_buddy_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
|
||||
eina_buddy_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
module_la_CFLAGS = @EINA_CFLAGS@
|
||||
module_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@
|
||||
module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
|
||||
module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
endif
|
||||
endif
|
||||
|
|
|
@ -10,16 +10,16 @@ AM_CPPFLAGS = \
|
|||
if EINA_BUILD_CHAINED_POOL
|
||||
if !EINA_STATIC_BUILD_CHAINED_POOL
|
||||
|
||||
controllerdir = $(libdir)/eina-$(VMAJ)/mp
|
||||
controller_LTLIBRARIES = eina_chained_mempool.la
|
||||
controllerdir = $(libdir)/eina/modules/mp/chained_pool/$(MODULE_ARCH)
|
||||
controller_LTLIBRARIES = module.la
|
||||
|
||||
eina_chained_mempool_la_SOURCES = \
|
||||
module_la_SOURCES = \
|
||||
eina_chained_mempool.c
|
||||
|
||||
eina_chained_mempool_la_CFLAGS = @EINA_CFLAGS@ @EFL_PTHREAD_CFLAGS@
|
||||
eina_chained_mempool_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@
|
||||
eina_chained_mempool_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version @EFL_PTHREAD_LIBS@
|
||||
eina_chained_mempool_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
module_la_CFLAGS = @EINA_CFLAGS@ @EFL_PTHREAD_CFLAGS@
|
||||
module_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@
|
||||
module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version @EFL_PTHREAD_LIBS@
|
||||
module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
endif
|
||||
endif
|
||||
|
|
|
@ -12,15 +12,15 @@ AM_CPPFLAGS = \
|
|||
if EINA_BUILD_EMEMOA_FIXED
|
||||
if !EINA_STATIC_BUILD_EMEMOA_FIXED
|
||||
|
||||
controllerdir = $(libdir)/eina-$(VMAJ)/mp
|
||||
controller_LTLIBRARIES = eina_ememoa_fixed.la
|
||||
controllerdir = $(libdir)/eina/modules/mp/ememoa_fixed/$(MODULE_ARCH)
|
||||
controller_LTLIBRARIES = module.la
|
||||
|
||||
eina_ememoa_fixed_la_SOURCES = \
|
||||
module_la_SOURCES = \
|
||||
eina_ememoa_fixed.c
|
||||
|
||||
eina_ememoa_fixed_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@ @EMEMOA_LIBS@
|
||||
eina_ememoa_fixed_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
|
||||
eina_ememoa_fixed_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
module_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@ @EMEMOA_LIBS@
|
||||
module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
|
||||
module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
endif
|
||||
endif
|
||||
|
|
|
@ -12,15 +12,15 @@ AM_CPPFLAGS = \
|
|||
if EINA_BUILD_EMEMOA_UNKNOWN
|
||||
if !EINA_STATIC_BUILD_EMEMOA_UNKNOWN
|
||||
|
||||
controllerdir = $(libdir)/eina-$(VMAJ)/mp
|
||||
controller_LTLIBRARIES = eina_ememoa_unknown.la
|
||||
controllerdir = $(libdir)/eina/modules/mp/ememoa_unknown/$(MODULE_ARCH)
|
||||
controller_LTLIBRARIES = module.la
|
||||
|
||||
eina_ememoa_unknown_la_SOURCES = \
|
||||
module_la_SOURCES = \
|
||||
eina_ememoa_unknown.c
|
||||
|
||||
eina_ememoa_unknown_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EMEMOA_LIBS@ @EINA_LIBS@
|
||||
eina_ememoa_unknown_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
|
||||
eina_ememoa_unknown_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
module_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EMEMOA_LIBS@ @EINA_LIBS@
|
||||
module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
|
||||
module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
endif
|
||||
endif
|
||||
|
|
|
@ -11,15 +11,15 @@ AM_CPPFLAGS = \
|
|||
if EINA_BUILD_FIXED_BITMAP
|
||||
if !EINA_STATIC_BUILD_FIXED_BITMAP
|
||||
|
||||
controllerdir = $(libdir)/eina-$(VMAJ)/mp
|
||||
controller_LTLIBRARIES = eina_fixed_bitmap.la
|
||||
controllerdir = $(libdir)/eina/modules/mp/fixed_bitmap/$(MODULE_ARCH)
|
||||
controller_LTLIBRARIES = module.la
|
||||
|
||||
eina_fixed_bitmap_la_SOURCES = \
|
||||
module_la_SOURCES = \
|
||||
eina_fixed_bitmap.c
|
||||
|
||||
eina_fixed_bitmap_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@
|
||||
eina_fixed_bitmap_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
|
||||
eina_fixed_bitmap_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
module_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@
|
||||
module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
|
||||
module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
endif
|
||||
endif
|
||||
|
|
|
@ -11,15 +11,15 @@ AM_CPPFLAGS = \
|
|||
if EINA_BUILD_PASS_THROUGH
|
||||
if !EINA_STATIC_BUILD_PASS_THROUGH
|
||||
|
||||
controllerdir = $(libdir)/eina-$(VMAJ)/mp
|
||||
controller_LTLIBRARIES = eina_pass_through.la
|
||||
controllerdir = $(libdir)//eina/modules/mp/pass_through/$(MODULE_ARCH)
|
||||
controller_LTLIBRARIES = module.la
|
||||
|
||||
eina_pass_through_la_SOURCES = \
|
||||
module_la_SOURCES = \
|
||||
eina_pass_through.c
|
||||
|
||||
eina_pass_through_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@
|
||||
eina_pass_through_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
|
||||
eina_pass_through_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
module_la_LIBADD = $(top_builddir)/src/lib/libeina.la @EINA_LIBS@
|
||||
module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
|
||||
module_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
endif
|
||||
endif
|
||||
|
|
Loading…
Reference in New Issue