diff options
Diffstat (limited to '')
-rw-r--r-- | src/libraries/SledjHamr.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libraries/SledjHamr.c b/src/libraries/SledjHamr.c index aa68774..6137199 100644 --- a/src/libraries/SledjHamr.c +++ b/src/libraries/SledjHamr.c | |||
@@ -2,6 +2,8 @@ | |||
2 | 2 | ||
3 | void HamrTime(void *elm_main, char *domain) | 3 | void HamrTime(void *elm_main, char *domain) |
4 | { | 4 | { |
5 | char *env, cwd[PATH_MAX], temp[PATH_MAX * 2]; | ||
6 | |||
5 | elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR); | 7 | elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR); |
6 | elm_app_compile_data_dir_set(PACKAGE_DATA_DIR); | 8 | elm_app_compile_data_dir_set(PACKAGE_DATA_DIR); |
7 | elm_app_compile_lib_dir_set(PACKAGE_LIB_DIR); | 9 | elm_app_compile_lib_dir_set(PACKAGE_LIB_DIR); |
@@ -20,4 +22,15 @@ void HamrTime(void *elm_main, char *domain) | |||
20 | elm_app_info_set(elm_main, domain, "checkme.txt"); | 22 | elm_app_info_set(elm_main, domain, "checkme.txt"); |
21 | // Once this is all setup, the code can do - | 23 | // Once this is all setup, the code can do - |
22 | // elm_app_prefix_dir_get(); // or bin, lib, data, locale. | 24 | // elm_app_prefix_dir_get(); // or bin, lib, data, locale. |
25 | |||
26 | getcwd(cwd, PATH_MAX); | ||
27 | env = getenv("LUA_CPATH"); | ||
28 | if (!env) env = ""; | ||
29 | sprintf(temp, "%s;%s/lib?.so;%s/?.so;%s/?.so", env, elm_app_lib_dir_get(), elm_app_lib_dir_get(), cwd); | ||
30 | setenv("LUA_CPATH", temp, 1); | ||
31 | |||
32 | env = getenv("LUA_PATH"); | ||
33 | if (!env) env = ""; | ||
34 | sprintf(temp, "%s;%s/?.lua;%s/?.lua", env, elm_app_lib_dir_get(), cwd); | ||
35 | setenv("LUA_PATH", temp, 1); | ||
23 | } | 36 | } |