diff options
Diffstat (limited to 'src/LuaSL')
-rw-r--r-- | src/LuaSL/LuaSL_main.c | 19 | ||||
-rwxr-xr-x | src/LuaSL/test.sh | 27 |
2 files changed, 17 insertions, 29 deletions
diff --git a/src/LuaSL/LuaSL_main.c b/src/LuaSL/LuaSL_main.c index 0d8a6db..7d6fa99 100644 --- a/src/LuaSL/LuaSL_main.c +++ b/src/LuaSL/LuaSL_main.c | |||
@@ -221,8 +221,23 @@ static Eina_Bool _del(void *data, int type __UNUSED__, Ecore_Con_Event_Client_De | |||
221 | 221 | ||
222 | int main(int argc, char **argv) | 222 | int main(int argc, char **argv) |
223 | { | 223 | { |
224 | gameGlobals ourGlobals; | 224 | gameGlobals ourGlobals; |
225 | int result = EXIT_FAILURE; | 225 | char *env, cwd[PATH_MAX], temp[PATH_MAX * 2]; |
226 | int result = EXIT_FAILURE; | ||
227 | |||
228 | // Sigh, Elm has this great thing for dealing with bin, lib, and data directories, but this is not an Elm app, | ||
229 | // And Elm is too heavy for just that little bit. | ||
230 | // So just duplicate a bit of what we need here. Sorta. | ||
231 | getcwd(cwd, PATH_MAX); | ||
232 | env = getenv("LUA_CPATH"); | ||
233 | if (!env) env = ""; | ||
234 | sprintf(temp, "%s;%s/lib?.so;%s/?.so;%s/?.so", env, PACKAGE_LIB_DIR, PACKAGE_LIB_DIR, cwd); | ||
235 | setenv("LUA_CPATH", temp, 1); | ||
236 | |||
237 | env = getenv("LUA_PATH"); | ||
238 | if (!env) env = ""; | ||
239 | sprintf(temp, "%s;%s/?.lua;%s/?.lua", env, PACKAGE_LIB_DIR, cwd); | ||
240 | setenv("LUA_PATH", temp, 1); | ||
226 | 241 | ||
227 | memset(&ourGlobals, 0, sizeof(gameGlobals)); | 242 | memset(&ourGlobals, 0, sizeof(gameGlobals)); |
228 | ourGlobals.address = "127.0.0.1"; | 243 | ourGlobals.address = "127.0.0.1"; |
diff --git a/src/LuaSL/test.sh b/src/LuaSL/test.sh deleted file mode 100755 index e8471c8..0000000 --- a/src/LuaSL/test.sh +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | #! /bin/bash | ||
2 | |||
3 | wd=$(pwd) | ||
4 | |||
5 | # Kill any left overs. | ||
6 | killall -KILL LuaSL | ||
7 | export LUA_PATH="$wd/../../lib/?.lua" | ||
8 | |||
9 | case $@ in | ||
10 | |||
11 | ddd) | ||
12 | ddd ../../LuaSL | ||
13 | ;; | ||
14 | |||
15 | gdb) | ||
16 | gdb ../../LuaSL | ||
17 | ;; | ||
18 | |||
19 | *) | ||
20 | echo "_______________ STARTING LuaSL _______________" | ||
21 | ../../LuaSL & | ||
22 | sleep 1 | ||
23 | echo "_______________ STARTING love _______________" | ||
24 | ../../love | ||
25 | ;; | ||
26 | |||
27 | esac | ||