forked from enlightenment/efl
elua: support the EFL_RUN_IN_TREE environment variable
This commit is contained in:
parent
b8d867b679
commit
4dfec82877
|
@ -9,7 +9,8 @@ bin_elua_elua_SOURCES = \
|
|||
bin_elua_elua_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
|
||||
-DELUA_CORE_DIR="\"$(datadir)/elua/core\"" \
|
||||
-DELUA_MODULES_DIR="\"$(datadir)/elua/modules\"" @ELUA_CFLAGS@ \
|
||||
-DLOCALE_DIR=\"@LOCALE_DIR@\"
|
||||
-DLOCALE_DIR=\"@LOCALE_DIR@\" \
|
||||
-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)\"
|
||||
bin_elua_elua_LDADD = @ELUA_LIBS@
|
||||
bin_elua_elua_DEPENDENCIES = @ELUA_INTERNAL_LIBS@
|
||||
|
||||
|
|
|
@ -95,6 +95,10 @@ static int register_require(lua_State *L) {
|
|||
int n = 2;
|
||||
lua_pushvalue(L, 1);
|
||||
require_ref = luaL_ref(L, LUA_REGISTRYINDEX);
|
||||
if (getenv("EFL_RUN_IN_TREE")) {
|
||||
corepath = PACKAGE_BUILD_DIR "/src/bin/elua/core";
|
||||
modpath = PACKAGE_BUILD_DIR "/src/bin/elua/modules";
|
||||
} else {
|
||||
if (!corepath) {
|
||||
if (noenv || !(corepath = getenv("ELUA_CORE_DIR")) || !corepath[0])
|
||||
corepath = ELUA_CORE_DIR;
|
||||
|
@ -103,6 +107,7 @@ static int register_require(lua_State *L) {
|
|||
if (noenv || !(modpath = getenv("ELUA_MODULES_DIR")) || !modpath[0])
|
||||
modpath = ELUA_MODULES_DIR;
|
||||
}
|
||||
}
|
||||
lua_pushfstring(L, "%s/?.lua;", corepath);
|
||||
EINA_LIST_FOREACH(largs, l, data) {
|
||||
if (data->type != ARG_LIBDIR) continue;
|
||||
|
@ -309,7 +314,13 @@ static int lua_main(lua_State *L) {
|
|||
|
||||
luaL_openlibs(L);
|
||||
|
||||
if (!(coref = coredir)) {
|
||||
if (getenv("EFL_RUN_IN_TREE")) {
|
||||
Arg_Data *v = malloc(sizeof(Arg_Data));
|
||||
v->type = ARG_LIBDIR;
|
||||
v->value = PACKAGE_BUILD_DIR "/src/bindings/luajit";
|
||||
largs = eina_list_append(largs, v);
|
||||
coref = PACKAGE_BUILD_DIR "/src/bin/elua/core";
|
||||
} else if (!(coref = coredir)) {
|
||||
if (noenv || !(coref = getenv("ELUA_CORE_DIR")) || !coref[0]) {
|
||||
coref = ELUA_CORE_DIR;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue