summaryrefslogtreecommitdiff
path: root/src/bin/elua
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2015-04-09 17:33:35 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-06 15:05:19 +0100
commit498501b9d77af8f841ae01e302e8f4f50fb7d8d4 (patch)
treed0267670b21ba8543b4aeeb1f163ac30bf9816d4 /src/bin/elua
parent329fae97b0a1190b4a5c9349fb9a9aebbeb4f6c7 (diff)
elua: remove EFL_RUN_IN_TREE hack (pass cmdline args)
Diffstat (limited to 'src/bin/elua')
-rw-r--r--src/bin/elua/main.c57
1 files changed, 20 insertions, 37 deletions
diff --git a/src/bin/elua/main.c b/src/bin/elua/main.c
index 44113c3a34..2873339645 100644
--- a/src/bin/elua/main.c
+++ b/src/bin/elua/main.c
@@ -119,40 +119,31 @@ elua_register_require(lua_State *L)
119 elua_require_ref = luaL_ref(L, LUA_REGISTRYINDEX); 119 elua_require_ref = luaL_ref(L, LUA_REGISTRYINDEX);
120 lua_pushvalue(L, 2); 120 lua_pushvalue(L, 2);
121 elua_appload_ref = luaL_ref(L, LUA_REGISTRYINDEX); 121 elua_appload_ref = luaL_ref(L, LUA_REGISTRYINDEX);
122 if (getenv("EFL_RUN_IN_TREE")) 122 if (!corepath)
123 { 123 {
124 corepath = PACKAGE_SRC_DIR "/src/scripts/elua/core"; 124 if (noenv || !(corepath = getenv("ELUA_CORE_DIR")) || !corepath[0])
125 modpath = PACKAGE_SRC_DIR "/src/scripts/elua/modules"; 125 {
126 appspath = PACKAGE_SRC_DIR "/src/scripts/elua/apps"; 126 corepath = corepathbuf;
127 snprintf(corepathbuf, sizeof(corepathbuf), "%s/core",
128 eina_prefix_data_get(elua_prefix));
129 }
127 } 130 }
128 else 131 if (!modpath)
129 { 132 {
130 if (!corepath) 133 if (noenv || !(modpath = getenv("ELUA_MODULES_DIR")) || !modpath[0])
131 { 134 {
132 if (noenv || !(corepath = getenv("ELUA_CORE_DIR")) || !corepath[0]) 135 modpath = modpathbuf;
133 { 136 snprintf(modpathbuf, sizeof(modpathbuf), "%s/modules",
134 corepath = corepathbuf; 137 eina_prefix_data_get(elua_prefix));
135 snprintf(corepathbuf, sizeof(corepathbuf), "%s/core",
136 eina_prefix_data_get(elua_prefix));
137 }
138 } 138 }
139 if (!modpath) 139 }
140 { 140 if (!appspath)
141 if (noenv || !(modpath = getenv("ELUA_MODULES_DIR")) || !modpath[0]) 141 {
142 { 142 if (noenv || !(appspath = getenv("ELUA_APPS_DIR")) || !appspath[0])
143 modpath = modpathbuf;
144 snprintf(modpathbuf, sizeof(modpathbuf), "%s/modules",
145 eina_prefix_data_get(elua_prefix));
146 }
147 }
148 if (!appspath)
149 { 143 {
150 if (noenv || !(appspath = getenv("ELUA_APPS_DIR")) || !appspath[0]) 144 appspath = appspathbuf;
151 { 145 snprintf(appspathbuf, sizeof(appspathbuf), "%s/apps",
152 appspath = appspathbuf; 146 eina_prefix_data_get(elua_prefix));
153 snprintf(appspathbuf, sizeof(appspathbuf), "%s/apps",
154 eina_prefix_data_get(elua_prefix));
155 }
156 } 147 }
157 } 148 }
158 lua_pushfstring(L, "%s/?.lua;", corepath); 149 lua_pushfstring(L, "%s/?.lua;", corepath);
@@ -388,15 +379,7 @@ elua_main(lua_State *L)
388 return 0; 379 return 0;
389 } 380 }
390 381
391 if (getenv("EFL_RUN_IN_TREE")) 382 if (!(coref = coredir))
392 {
393 Arg_Data *v = malloc(sizeof(Arg_Data));
394 v->type = ARG_LIBDIR;
395 v->value = PACKAGE_SRC_DIR "/src/bindings/luajit";
396 largs = eina_list_append(largs, v);
397 coref = PACKAGE_SRC_DIR "/src/scripts/elua/core";
398 }
399 else if (!(coref = coredir))
400 { 383 {
401 if (noenv || !(coref = getenv("ELUA_CORE_DIR")) || !coref[0]) 384 if (noenv || !(coref = getenv("ELUA_CORE_DIR")) || !coref[0])
402 { 385 {