elua: remove EFL_RUN_IN_TREE hack (pass cmdline args)

This commit is contained in:
Daniel Kolesa 2015-04-09 17:33:35 +01:00 committed by Daniel Kolesa
parent 329fae97b0
commit 498501b9d7
3 changed files with 26 additions and 40 deletions

View File

@ -14,7 +14,6 @@ lib_elua_libelua_la_SOURCES = \
lib_elua_libelua_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ELUA_CFLAGS@ \
-DLOCALE_DIR=\"@LOCALE_DIR@\" \
-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/elua\"
@ -33,7 +32,6 @@ bin_elua_elua_SOURCES = \
bin_elua_elua_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ELUA_CFLAGS@ \
-DLOCALE_DIR=\"@LOCALE_DIR@\" \
-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/elua\"

View File

@ -3,7 +3,12 @@ ELUA_GEN = @elua_bin@ lualian
_ELUA_GEN_DEP = @elua_bin@
else
ELUA_GEN = ELUA_EOLIAN_LIBRARY_PATH=$(top_builddir)/src/lib/eolian/.libs \
EFL_RUN_IN_TREE=1 $(top_builddir)/src/bin/elua/elua${EXEEXT} lualian
$(top_builddir)/src/bin/elua/elua${EXEEXT} \
-I$(abs_top_srcdir)/src/bindings/luajit \
-C$(abs_top_srcdir)/src/scripts/elua/core \
-M$(abs_top_srcdir)/src/scripts/elua/modules \
-A$(abs_top_srcdir)/src/scripts/elua/apps \
lualian
_ELUA_GEN_DEP = bin/elua/elua${EXEEXT} scripts/elua/apps/lualian.lua \
scripts/elua/modules/lualian.lua \
scripts/elua/modules/getopt.lua scripts/elua/core/util.lua \

View File

@ -119,40 +119,31 @@ elua_register_require(lua_State *L)
elua_require_ref = luaL_ref(L, LUA_REGISTRYINDEX);
lua_pushvalue(L, 2);
elua_appload_ref = luaL_ref(L, LUA_REGISTRYINDEX);
if (getenv("EFL_RUN_IN_TREE"))
if (!corepath)
{
corepath = PACKAGE_SRC_DIR "/src/scripts/elua/core";
modpath = PACKAGE_SRC_DIR "/src/scripts/elua/modules";
appspath = PACKAGE_SRC_DIR "/src/scripts/elua/apps";
if (noenv || !(corepath = getenv("ELUA_CORE_DIR")) || !corepath[0])
{
corepath = corepathbuf;
snprintf(corepathbuf, sizeof(corepathbuf), "%s/core",
eina_prefix_data_get(elua_prefix));
}
}
else
if (!modpath)
{
if (!corepath)
if (noenv || !(modpath = getenv("ELUA_MODULES_DIR")) || !modpath[0])
{
if (noenv || !(corepath = getenv("ELUA_CORE_DIR")) || !corepath[0])
{
corepath = corepathbuf;
snprintf(corepathbuf, sizeof(corepathbuf), "%s/core",
eina_prefix_data_get(elua_prefix));
}
modpath = modpathbuf;
snprintf(modpathbuf, sizeof(modpathbuf), "%s/modules",
eina_prefix_data_get(elua_prefix));
}
if (!modpath)
}
if (!appspath)
{
if (noenv || !(appspath = getenv("ELUA_APPS_DIR")) || !appspath[0])
{
if (noenv || !(modpath = getenv("ELUA_MODULES_DIR")) || !modpath[0])
{
modpath = modpathbuf;
snprintf(modpathbuf, sizeof(modpathbuf), "%s/modules",
eina_prefix_data_get(elua_prefix));
}
}
if (!appspath)
{
if (noenv || !(appspath = getenv("ELUA_APPS_DIR")) || !appspath[0])
{
appspath = appspathbuf;
snprintf(appspathbuf, sizeof(appspathbuf), "%s/apps",
eina_prefix_data_get(elua_prefix));
}
appspath = appspathbuf;
snprintf(appspathbuf, sizeof(appspathbuf), "%s/apps",
eina_prefix_data_get(elua_prefix));
}
}
lua_pushfstring(L, "%s/?.lua;", corepath);
@ -388,15 +379,7 @@ elua_main(lua_State *L)
return 0;
}
if (getenv("EFL_RUN_IN_TREE"))
{
Arg_Data *v = malloc(sizeof(Arg_Data));
v->type = ARG_LIBDIR;
v->value = PACKAGE_SRC_DIR "/src/bindings/luajit";
largs = eina_list_append(largs, v);
coref = PACKAGE_SRC_DIR "/src/scripts/elua/core";
}
else if (!(coref = coredir))
if (!(coref = coredir))
{
if (noenv || !(coref = getenv("ELUA_CORE_DIR")) || !coref[0])
{