From 568c8829db2f886921c7592cadbadbf4241127b6 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 27 Apr 2014 16:48:07 +1000 Subject: Centralise the PACKAGE_* stuff, move our libraries to lib, and shuffle stuff to suit. --- src/LuaSL/LuaSL_compile.c | 4 ++-- src/LuaSL/LuaSL_test.c | 8 ++++---- src/LuaSL/build.lua | 9 +++++++++ src/LuaSL/test.sh | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) (limited to 'src/LuaSL') diff --git a/src/LuaSL/LuaSL_compile.c b/src/LuaSL/LuaSL_compile.c index 771888e..f32e0c0 100644 --- a/src/LuaSL/LuaSL_compile.c +++ b/src/LuaSL/LuaSL_compile.c @@ -2119,9 +2119,9 @@ boolean compilerSetup(gameGlobals *ourGlobals) } // Compile the constants. - snprintf(buf, sizeof(buf), "lua -e 'require(\"LSL\").gimmeLSL()' > %s/libraries/constants.lsl", PACKAGE_DATA_DIR); + snprintf(buf, sizeof(buf), "lua -e 'require(\"LSL\").gimmeLSL()' > %s/constants.lsl", PACKAGE_LIB_DIR); system(buf); - snprintf(buf, sizeof(buf), "%s/libraries/constants.lsl", PACKAGE_DATA_DIR); + snprintf(buf, sizeof(buf), "%s/constants.lsl", PACKAGE_LIB_DIR); compileLSL(ourGlobals, NULL, "FAKE_SID", buf, TRUE); return TRUE; diff --git a/src/LuaSL/LuaSL_test.c b/src/LuaSL/LuaSL_test.c index 58d6225..27b9626 100644 --- a/src/LuaSL/LuaSL_test.c +++ b/src/LuaSL/LuaSL_test.c @@ -147,7 +147,7 @@ static Eina_Bool _add(void *data, int type __UNUSED__, Ecore_Con_Event_Server_Ad ourGlobals->server = ev->server; gettimeofday(&startTime, NULL); - snprintf(buf, sizeof(buf), "%s/media/Test sim/objects", PACKAGE_DATA_DIR); + snprintf(buf, sizeof(buf), "%s/Test sim/objects", PACKAGE_DATA_DIR); eina_file_dir_list(buf, EINA_TRUE, dirList_compile, ourGlobals); // Wait awhile, then start sending events for testing. ecore_timer_add(0.5, _timer_cb, ourGlobals); @@ -392,7 +392,7 @@ int main(int argc, char **argv) evas_object_focus_set(ourGlobals.bg, EINA_TRUE); ourGlobals.edje = edje_object_add(ourGlobals.canvas); - snprintf(buf, sizeof(buf), "%s/media/%s.edj", PACKAGE_DATA_DIR, "LuaSL"); + snprintf(buf, sizeof(buf), "%s/%s.edj", PACKAGE_DATA_DIR, "LuaSL"); if (!edje_object_file_set(ourGlobals.edje, buf, group)) { int err = edje_object_load_error_get(ourGlobals.edje); @@ -409,7 +409,7 @@ int main(int argc, char **argv) evas_object_resize(ourGlobals.edje, WIDTH, HEIGHT); evas_object_show(ourGlobals.edje); - snprintf(buf, sizeof(buf), "%s/media/bubble_sh.png", PACKAGE_DATA_DIR); + snprintf(buf, sizeof(buf), "%s/bubble_sh.png", PACKAGE_DATA_DIR); for (i = 0; i < (sizeof(names) / sizeof(char *) / 2); i++) { sh = evas_object_image_filled_add(ourGlobals.canvas); @@ -419,7 +419,7 @@ int main(int argc, char **argv) evas_object_data_set(ourGlobals.bg, names[(i * 2) + 1], sh); } - snprintf(buf, sizeof(buf), "%s/media/bubble.png", PACKAGE_DATA_DIR); + snprintf(buf, sizeof(buf), "%s/bubble.png", PACKAGE_DATA_DIR); for (i = 0; i < (sizeof(names) / sizeof(char *) / 2); i++) { bub = evas_object_image_filled_add(ourGlobals.canvas); diff --git a/src/LuaSL/build.lua b/src/LuaSL/build.lua index f86715c..6b34145 100755 --- a/src/LuaSL/build.lua +++ b/src/LuaSL/build.lua @@ -13,11 +13,20 @@ if 'nil' == type(dir) then dir = workingDir end + removeFiles(dir, {'../../LuaSL', '*.o', '*.output', '*.backup', '../../media/LuaSL.edj', 'LuaSL_lexer.h', 'LuaSL_lexer.c', 'LuaSL_lemon_yaccer.h', 'LuaSL_lemon_yaccer.c', 'LuaSL_lemon_yaccer.out'}) -- Run lemon first, flex depends on it to define the symbol values. runCommand('lemon', dir, '../../libraries/lemon/lemon -s -T../../libraries/lemon/lempar.c LuaSL_lemon_yaccer.y') runCommand('flex', dir, 'flex -C --outfile=LuaSL_lexer.c --header-file=LuaSL_lexer.h LuaSL_lexer.l') runCommand('edje_cc', dir, 'edje_cc ' .. EDJE_FLAGS .. ' LuaSL.edc ../../media/LuaSL.edj') + +-- While SledHamr.c does this, we can't use that here, coz LuaSL is not an Elm app. +-- Neither is LuaSL_test actually. +CFLAGS = CFLAGS .. ' -DPACKAGE_BIN_DIR=\\"' .. bin_d .. '\\"' +CFLAGS = CFLAGS .. ' -DPACKAGE_LIB_DIR=\\"' .. lib_d .. '\\"' +CFLAGS = CFLAGS .. ' -DPACKAGE_DATA_DIR=\\"' .. data_d .. '\\"' +CFLAGS = CFLAGS .. ' -DPACKAGE_LOCALE_DIR=\\"' .. locale_d .. '\\"' + compileFiles('../../LuaSL', dir, {'LuaSL_main', 'LuaSL_compile', 'LuaSL_threads', 'LuaSL_utilities', 'LuaSL_lexer', 'LuaSL_lemon_yaccer'}) compileFiles('LuaSL_test', dir, {'LuaSL_test', 'LuaSL_utilities'}) diff --git a/src/LuaSL/test.sh b/src/LuaSL/test.sh index 1c26ade..435c5e2 100755 --- a/src/LuaSL/test.sh +++ b/src/LuaSL/test.sh @@ -4,7 +4,7 @@ wd=$(pwd) # Kill any left overs. killall -KILL LuaSL -export LUA_PATH="$wd/../../libraries/?.lua" +export LUA_PATH="$wd/../../lib/?.lua" case $@ in -- cgit v1.1