summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile_Elua_Helper.am2
-rw-r--r--src/bin/elua/core/util.lua12
2 files changed, 12 insertions, 2 deletions
diff --git a/src/Makefile_Elua_Helper.am b/src/Makefile_Elua_Helper.am
index aa14f92..d6f383c 100644
--- a/src/Makefile_Elua_Helper.am
+++ b/src/Makefile_Elua_Helper.am
@@ -2,7 +2,7 @@ if HAVE_ELUA_BIN
2ELUA_GEN = @elua_bin@ :lualian 2ELUA_GEN = @elua_bin@ :lualian
3_ELUA_GEN_DEP = @elua_bin@ 3_ELUA_GEN_DEP = @elua_bin@
4else 4else
5ELUA_GEN = LD_LIBRARY_PATH=$(top_builddir)/src/lib/eolian/.libs \ 5ELUA_GEN = ELUA_EOLIAN_LIBRARY_PATH=$(top_builddir)/src/lib/eolian/.libs \
6 EFL_RUN_IN_TREE=1 $(top_builddir)/src/bin/elua/elua${EXEEXT} :lualian 6 EFL_RUN_IN_TREE=1 $(top_builddir)/src/bin/elua/elua${EXEEXT} :lualian
7_ELUA_GEN_DEP = bin/elua/elua${EXEEXT} 7_ELUA_GEN_DEP = bin/elua/elua${EXEEXT}
8endif 8endif
diff --git a/src/bin/elua/core/util.lua b/src/bin/elua/core/util.lua
index 02b89a3..78db3ab 100644
--- a/src/bin/elua/core/util.lua
+++ b/src/bin/elua/core/util.lua
@@ -71,7 +71,17 @@ local loaded_libc = {}
71M.lib_load = function(libname) 71M.lib_load = function(libname)
72 local lib = loaded_libs[libname] 72 local lib = loaded_libs[libname]
73 if not lib then 73 if not lib then
74 lib = ffi.load(libname) 74 local ev = os.getenv("ELUA_" .. libname:upper() .. "_LIBRARY_PATH")
75 if not ev or ev == "" then
76 lib = ffi.load(libname)
77 else
78 if ffi.os == "Windows" then
79 lib = ffi.load(ev .. "\\" .. libname .. ".dll")
80 else
81 lib = ffi.load(ev .. "/lib" .. libname .. ".so")
82 end
83 -- XXX: perhaps check here if it's loaded and fallback to default?
84 end
75 loaded_libs[libname] = lib 85 loaded_libs[libname] = lib
76 loaded_libc[libname] = 0 86 loaded_libc[libname] = 0
77 end 87 end