summaryrefslogtreecommitdiff
path: root/Build/source/libs/luajit
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2014-03-15 12:21:15 +0000
committerTaco Hoekwater <taco@elvenkind.com>2014-03-15 12:21:15 +0000
commita22d9897afbabdd07f13d2bc5c7c5b9c5865ab53 (patch)
tree70829ffa23329ca4c04efa8da7a18cfe9c44a1f4 /Build/source/libs/luajit
parent5909dbd7ee4290cc486c9c12e4ef0b2bfb9067d4 (diff)
here is luatex 0.79.0
git-svn-id: svn://tug.org/texlive/trunk@33180 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/luajit')
-rw-r--r--Build/source/libs/luajit/LuaJIT-2.0.3-PATCHES/patch-007-lib_package.c65
-rw-r--r--Build/source/libs/luajit/LuaJIT-2.0.3/src/lib_package.c3
-rw-r--r--Build/source/libs/luajit/native/Makefile.am2
3 files changed, 69 insertions, 1 deletions
diff --git a/Build/source/libs/luajit/LuaJIT-2.0.3-PATCHES/patch-007-lib_package.c b/Build/source/libs/luajit/LuaJIT-2.0.3-PATCHES/patch-007-lib_package.c
new file mode 100644
index 00000000000..ffc5b039620
--- /dev/null
+++ b/Build/source/libs/luajit/LuaJIT-2.0.3-PATCHES/patch-007-lib_package.c
@@ -0,0 +1,65 @@
+diff -u LuaJIT-2.0.3.orig/src/lib_package.c LuaJIT-2.0.3/src/lib_package.c
+--- LuaJIT-2.0.3.orig/src/lib_package.c 2014-03-13 12:38:39.407900526 +0100
++++ LuaJIT-2.0.3/src/lib_package.c 2014-03-13 13:01:11.283956573 +0100
+@@ -68,6 +68,9 @@
+ #elif LJ_TARGET_WINDOWS
+
+ #define WIN32_LEAN_AND_MEAN
++#ifndef WINVER
++#define WINVER 0x0500
++#endif
+ #include <windows.h>
+
+ #ifndef GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
+@@ -354,6 +357,29 @@
+ return 1; /* library loaded successfully */
+ }
+
++#define LUA_POF "luaopen_"
++#define LUA_OFSEP "_"
++#define POF LUA_POF
++
++static const char *mkfuncname (lua_State *L, const char *modname) {
++ const char *funcname;
++ const char *mark = strchr(modname, *LUA_IGMARK);
++ if (mark) modname = mark + 1;
++ funcname = luaL_gsub(L, modname, ".", LUA_OFSEP);
++ funcname = lua_pushfstring(L, POF"%s", funcname);
++ lua_remove(L, -2); /* remove 'gsub' result */
++ return funcname;
++}
++
++
++int loader_C_luatex (lua_State *L, const char *name, const char *filename) {
++ const char *funcname;
++ funcname = mkfuncname(L, name);
++ if (ll_loadfunc(L, filename, funcname,0) != 0)
++ loaderror(L, filename);
++ return 1; /* library loaded successfully */
++}
++
+ static int lj_cf_package_loader_croot(lua_State *L)
+ {
+ const char *filename;
+@@ -373,6 +399,21 @@
+ return 1;
+ }
+
++int loader_Call_luatex (lua_State *L, const char *name, const char *filename) {
++ const char *funcname;
++ int stat;
++ if (filename == NULL) return 1; /* root not found */
++ funcname = mkfuncname(L, name);
++ if ((stat = ll_loadfunc(L, filename, funcname,0)) != 0) {
++ if (stat != PACKAGE_ERR_FUNC) loaderror(L, filename); /* real error */
++ lua_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS,
++ name, filename);
++ return 1; /* function not found */
++ }
++ return 1; /* library loaded successfully */
++}
++
++
+ static int lj_cf_package_loader_preload(lua_State *L)
+ {
+ const char *name = luaL_checkstring(L, 1);
diff --git a/Build/source/libs/luajit/LuaJIT-2.0.3/src/lib_package.c b/Build/source/libs/luajit/LuaJIT-2.0.3/src/lib_package.c
index 0e4a8ed0641..6f3adec85b3 100644
--- a/Build/source/libs/luajit/LuaJIT-2.0.3/src/lib_package.c
+++ b/Build/source/libs/luajit/LuaJIT-2.0.3/src/lib_package.c
@@ -68,6 +68,9 @@ static const char *ll_bcsym(void *lib, const char *sym)
#elif LJ_TARGET_WINDOWS
#define WIN32_LEAN_AND_MEAN
+#ifndef WINVER
+#define WINVER 0x0500
+#endif
#include <windows.h>
#ifndef GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
diff --git a/Build/source/libs/luajit/native/Makefile.am b/Build/source/libs/luajit/native/Makefile.am
index 07fa7771cfe..f89c2fa7629 100644
--- a/Build/source/libs/luajit/native/Makefile.am
+++ b/Build/source/libs/luajit/native/Makefile.am
@@ -30,7 +30,7 @@ buildvm_arch.h: minilua$(EXEEXT) $(LUAJIT_TREE)/dynasm/dynasm.lua
nodist_minilua_SOURCES = \
@LUAJIT_TREE@/src/host/minilua.c
-minilua_LDFLAGS = $(MATH_LIB)
+minilua_LDADD = $(MATH_LIB)
CLEANFILES = buildvm-stamp buildvm_arch.h