diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am index b9553079fc..81d93e3940 100644 --- a/src/Makefile_Ecore.am +++ b/src/Makefile_Ecore.am @@ -141,7 +141,9 @@ lib/ecore/ecore_exe.c \ lib/ecore/ecore_exe_private.h \ lib/ecore/ecore_private.h \ lib/ecore/ecore_internal.h \ -lib/ecore/ecore_main_common.h +lib/ecore/ecore_main_common.h \ +static_libs/buildsystem/buildsystem.h \ +static_libs/buildsystem/buildsystem_autotools.c if HAVE_WIN32 @@ -164,6 +166,7 @@ lib_ecore_libecore_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/ecore\" \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ +-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \ @ECORE_CFLAGS@ lib_ecore_libecore_la_LIBADD = @ECORE_LIBS@ @EVIL_LIBS@ lib_ecore_libecore_la_DEPENDENCIES = @ECORE_INTERNAL_LIBS@ diff --git a/src/Makefile_Ecore_Con.am b/src/Makefile_Ecore_Con.am index f8d35d2636..f90af32a15 100644 --- a/src/Makefile_Ecore_Con.am +++ b/src/Makefile_Ecore_Con.am @@ -118,7 +118,9 @@ lib/ecore_con/efl_net_ssl_context.c \ lib/ecore_con/efl_net_dialer_ssl.c \ lib/ecore_con/efl_net_server_ssl.c \ lib/ecore_con/ecore_con_local.c \ -lib/ecore_con/efl_net_ip_address.c +lib/ecore_con/efl_net_ip_address.c \ +static_libs/buildsystem/buildsystem.h \ +static_libs/buildsystem/buildsystem_autotools.c if EFL_NET_CONTROL_BACKEND_CONNMAN lib_ecore_con_libecore_con_la_SOURCES += \ @@ -167,6 +169,7 @@ lib_ecore_con_libecore_con_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/ecore\" \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ +-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \ @ECORE_CON_CFLAGS@ lib_ecore_con_libecore_con_la_LIBADD = @ECORE_CON_LIBS@ @EVIL_LIBS@ lib_ecore_con_libecore_con_la_DEPENDENCIES = @ECORE_CON_INTERNAL_LIBS@ diff --git a/src/Makefile_Ecore_Evas.am b/src/Makefile_Ecore_Evas.am index debc9963fc..dea5608a0d 100644 --- a/src/Makefile_Ecore_Evas.am +++ b/src/Makefile_Ecore_Evas.am @@ -23,7 +23,9 @@ lib/ecore_evas/ecore_evas_wayland.h \ lib/ecore_evas/ecore_evas_cocoa.h \ lib/ecore_evas/ecore_evas_win32.h \ lib/ecore_evas/ecore_evas_x11.h \ -lib/ecore_evas/ecore_evas_util.c +lib/ecore_evas/ecore_evas_util.c \ +static_libs/buildsystem/buildsystem.h \ +static_libs/buildsystem/buildsystem_autotools.c lib_ecore_evas_libecore_evas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -I$(top_srcdir)/src/modules/evas/engines/buffer \ @@ -31,6 +33,7 @@ lib_ecore_evas_libecore_evas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/ecore_evas\" \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ +-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \ @ECORE_EVAS_CFLAGS@ lib_ecore_evas_libecore_evas_la_LIBADD = @ECORE_EVAS_LIBS@ lib_ecore_evas_libecore_evas_la_DEPENDENCIES = @ECORE_EVAS_INTERNAL_LIBS@ diff --git a/src/Makefile_Ecore_IMF.am b/src/Makefile_Ecore_IMF.am index 001927fe62..3c2355f218 100644 --- a/src/Makefile_Ecore_IMF.am +++ b/src/Makefile_Ecore_IMF.am @@ -12,13 +12,16 @@ lib_ecore_imf_libecore_imf_la_SOURCES = \ lib/ecore_imf/ecore_imf.c \ lib/ecore_imf/ecore_imf_context.c \ lib/ecore_imf/ecore_imf_module.c \ -lib/ecore_imf/ecore_imf_private.h +lib/ecore_imf/ecore_imf_private.h \ +static_libs/buildsystem/buildsystem.h \ +static_libs/buildsystem/buildsystem_autotools.c lib_ecore_imf_libecore_imf_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/ecore_imf\" \ -DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \ +-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \ @ECORE_IMF_CFLAGS@ lib_ecore_imf_libecore_imf_la_LIBADD = @ECORE_IMF_LIBS@ lib_ecore_imf_libecore_imf_la_DEPENDENCIES = @ECORE_IMF_INTERNAL_LIBS@ diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c index a2779bed86..c280c6a959 100644 --- a/src/lib/ecore/ecore.c +++ b/src/lib/ecore/ecore.c @@ -32,6 +32,7 @@ #include "Ecore.h" #include "Efl_Core.h" #include "ecore_private.h" +#include "../../static_libs/buildsystem/buildsystem.h" #if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_INFO) #include @@ -164,9 +165,7 @@ ecore_system_modules_load(void) const char **itr; for (itr = built_modules; *itr != NULL; itr++) { - snprintf(buf, sizeof(buf), - "%s/src/modules/ecore/system/%s/.libs", - PACKAGE_BUILD_DIR, *itr); + bs_mod_get(buf, sizeof(buf), "ecore/system", "system"); module_list = eina_module_list_get(module_list, buf, EINA_FALSE, NULL, NULL); } diff --git a/src/lib/ecore_con/ecore_con_proxy_helper.c b/src/lib/ecore_con/ecore_con_proxy_helper.c index f99c7a225b..f1f5aadaf1 100644 --- a/src/lib/ecore_con/ecore_con_proxy_helper.c +++ b/src/lib/ecore_con/ecore_con_proxy_helper.c @@ -18,6 +18,7 @@ #include "ecore_private.h" #include "Ecore_Con.h" #include "ecore_con_private.h" +#include "../../static_libs/buildsystem/buildsystem.h" typedef struct { Eina_Thread_Queue *thq; @@ -87,9 +88,7 @@ _efl_net_proxy_helper_spawn(void) } // find binary location path if (run_in_tree == 1) - snprintf - (buf, sizeof(buf), - PACKAGE_BUILD_DIR"/src/bin/ecore_con/utils/efl_net_proxy_helper"HELPER_EXT); + bs_binary_get(buf, sizeof(buf), "ecore_con/utils", "efl_net_proxy_helper"); else #endif snprintf diff --git a/src/lib/ecore_evas/ecore_evas_module.c b/src/lib/ecore_evas/ecore_evas_module.c index 9d5e6ad075..a6ce6bec51 100644 --- a/src/lib/ecore_evas/ecore_evas_module.c +++ b/src/lib/ecore_evas/ecore_evas_module.c @@ -9,6 +9,8 @@ #include "ecore_evas_private.h" #include +#include "../../static_libs/buildsystem/buildsystem.h" + static Eina_Hash *_registered_engines = NULL; static Eina_List *_engines_paths = NULL; static Eina_List *_engines_available = NULL; @@ -63,26 +65,23 @@ Eina_Module * _ecore_evas_vnc_server_module_load(void) { char *prefix; + char buf[PATH_MAX]; if (_ecore_evas_vnc) return _ecore_evas_vnc; -#ifdef NEED_RUN_IN_TREE -#if defined(HAVE_GETUID) && defined(HAVE_GETEUID) - if (getuid() == geteuid()) -#endif + if (bs_mod_get(buf, sizeof(buf), "ecore_evas", "vnc_server")) { - if (getenv("EFL_RUN_IN_TREE")) +#if defined(HAVE_GETUID) && defined(HAVE_GETEUID) + if (getuid() == geteuid()) +#endif { - _ecore_evas_vnc = _ecore_evas_vnc_server_module_try_load(PACKAGE_BUILD_DIR - "/src/modules/ecore_evas/vnc_server/.libs/" - ECORE_EVAS_ENGINE_NAME, + _ecore_evas_vnc = _ecore_evas_vnc_server_module_try_load(buf, EINA_TRUE); if (_ecore_evas_vnc) return _ecore_evas_vnc; } } -#endif prefix = eina_module_symbol_path_get(_ecore_evas_vnc_server_module_load, "/ecore_evas"); @@ -105,41 +104,31 @@ _ecore_evas_engine_load(const char *engine) const char *path; Eina_List *l; Eina_Module *em = NULL; -#ifdef NEED_RUN_IN_TREE - Eina_Bool run_in_tree; -#endif + char tmp[PATH_MAX] = ""; EINA_SAFETY_ON_NULL_RETURN_VAL(engine, NULL); em = (Eina_Module *)eina_hash_find(_registered_engines, engine); if (em) return em; -#ifdef NEED_RUN_IN_TREE - run_in_tree = !!getenv("EFL_RUN_IN_TREE"); -#endif + if (bs_mod_get(tmp, sizeof(tmp), "ecore_evas/engines", engine)) + { + em = eina_module_new(tmp); + if (!em) return NULL; + + if (!eina_module_load(em)) + { + eina_module_free(em); + return NULL; + } + if (eina_hash_add(_registered_engines, engine, em)) + return em; + } EINA_LIST_FOREACH(_engines_paths, l, path) { - char tmp[PATH_MAX] = ""; - -#ifdef NEED_RUN_IN_TREE -#if defined(HAVE_GETUID) && defined(HAVE_GETEUID) - if (getuid() == geteuid()) -#endif - { - if (run_in_tree) - { - snprintf(tmp, sizeof(tmp), "%s/%s/.libs/%s", - path, engine, ECORE_EVAS_ENGINE_NAME); - if (!_file_exists(tmp)) - tmp[0] = '\0'; - } - } -#endif - - if (tmp[0] == '\0') - snprintf(tmp, sizeof(tmp), "%s/%s/%s/%s", - path, engine, MODULE_ARCH, ECORE_EVAS_ENGINE_NAME); + snprintf(tmp, sizeof(tmp), "%s/%s/%s/%s", + path, engine, MODULE_ARCH, ECORE_EVAS_ENGINE_NAME); em = eina_module_new(tmp); if (!em) continue; @@ -167,23 +156,6 @@ _ecore_evas_engine_init(void) // _registered_engines = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free)); _registered_engines = eina_hash_string_small_new(NULL); -#ifdef NEED_RUN_IN_TREE -#if defined(HAVE_GETUID) && defined(HAVE_GETEUID) - if (getuid() == geteuid()) -#endif - { - if (getenv("EFL_RUN_IN_TREE")) - { - const char mp[] = PACKAGE_BUILD_DIR"/src/modules/ecore_evas/engines/"; - if (_file_exists(mp)) - { - _engines_paths = eina_list_append(_engines_paths, strdup(mp)); - return; - } - } - } -#endif - /* 1. libecore_evas.so/../ecore_evas/engines/ */ paths[0] = eina_module_symbol_path_get(_ecore_evas_engine_init, "/ecore_evas/engines"); #ifndef _WIN32 @@ -218,7 +190,7 @@ _ecore_evas_engine_shutdown(void) _registered_engines = NULL; } */ - + EINA_LIST_FREE(_engines_paths, path) free(path); diff --git a/src/lib/ecore_imf/ecore_imf_module.c b/src/lib/ecore_imf/ecore_imf_module.c index 814152f79b..6232f85614 100644 --- a/src/lib/ecore_imf/ecore_imf_module.c +++ b/src/lib/ecore_imf/ecore_imf_module.c @@ -14,6 +14,8 @@ #include "Ecore_IMF.h" #include "ecore_imf_private.h" +#include "../../static_libs/buildsystem/buildsystem.h" + static void _ecore_imf_module_free(Ecore_IMF_Module *module); static int _ecore_imf_modules_exists(const char *ctx_id); @@ -77,9 +79,7 @@ ecore_imf_module_init(void) } for (itr = modules_load; *itr != NULL; itr++) { - snprintf(buf, sizeof(buf), - "%s/src/modules/ecore_imf/%s/.libs", - PACKAGE_BUILD_DIR, *itr); + bs_mod_dir_get(buf, sizeof(buf), "ecore_imf", *itr); module_list = eina_module_list_get (module_list, buf, EINA_FALSE, NULL, NULL); }