aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/LuaSL
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-13 14:42:20 +1000
committerDavid Walter Seikel2014-05-13 14:42:20 +1000
commit29f3fe70aeb5f566864c7868f7c89483547e92b4 (patch)
treec142966809d5b0d67104e12c8b7ed5d61417dab8 /src/LuaSL
parentOops, left this laying around, no longer needed. (diff)
downloadSledjHamr-29f3fe70aeb5f566864c7868f7c89483547e92b4.zip
SledjHamr-29f3fe70aeb5f566864c7868f7c89483547e92b4.tar.gz
SledjHamr-29f3fe70aeb5f566864c7868f7c89483547e92b4.tar.bz2
SledjHamr-29f3fe70aeb5f566864c7868f7c89483547e92b4.tar.xz
Extantz calls love, and love calls LuaSL, and clean out the need for scripts to twiddle the Lua paths.
Diffstat (limited to 'src/LuaSL')
-rw-r--r--src/LuaSL/LuaSL_main.c19
-rwxr-xr-xsrc/LuaSL/test.sh27
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
222int main(int argc, char **argv) 222int 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
3wd=$(pwd)
4
5# Kill any left overs.
6killall -KILL LuaSL
7export LUA_PATH="$wd/../../lib/?.lua"
8
9case $@ 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
27esac