* Changed Makefiles to use mainline Lua
* Added a dispatching shortcut (thanks to Jow)
This commit is contained in:
parent
505c3208c9
commit
b515d6f88e
14 changed files with 28 additions and 4320 deletions
2
Makefile
2
Makefile
|
@ -18,5 +18,5 @@ host: build
|
|||
mkdir -p host/ffluci
|
||||
for i in $(MODULES); do cp $$i/dist$(LUCI_INSTALLDIR) host/ -R 2>/dev/null || true; done
|
||||
|
||||
hostclean:
|
||||
hostclean: clean
|
||||
rm host -rf
|
||||
|
|
|
@ -1,18 +1,7 @@
|
|||
module("ffluci.controller.luci_fw.luci_fw", package.seeall)
|
||||
|
||||
function index()
|
||||
local page = node("admin", "network", "portfw")
|
||||
page.target = cbi("luci_fw/portfw")
|
||||
page.title = "Portweiterleitung"
|
||||
page.order = 70
|
||||
|
||||
local page = node("admin", "network", "routing")
|
||||
page.target = cbi("luci_fw/routing")
|
||||
page.title = "Routing"
|
||||
page.order = 72
|
||||
|
||||
local page = node("admin", "network", "firewall")
|
||||
page.target = cbi("luci_fw/firewall")
|
||||
page.title = "Firewall"
|
||||
page.order = 74
|
||||
entry({"admin", "network", "portfw"}, cbi("luci_fw/portfw"), "Portweiterleitung", 70)
|
||||
entry({"admin", "network", "routing"}, cbi("luci_fw/routing"), "Routing", 72)
|
||||
entry({"admin", "network", "firewall"}, cbi("luci_fw/firewall"), "Firewall", 74)
|
||||
end
|
|
@ -1,3 +1,3 @@
|
|||
LUAC = luac
|
||||
LUAC_OPTIONS = -s
|
||||
LUCI_INSTALLDIR = /usr/lib/lua/5.1/ffluci
|
||||
LUCI_INSTALLDIR = /usr/lib/lua/ffluci
|
Binary file not shown.
|
@ -13,12 +13,10 @@ PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
|
|||
PKG_SOURCE_PROTO:=svn
|
||||
PKG_SOURCE_VERSION:=$(PKG_REV)
|
||||
|
||||
PKG_BUILD_DEPENDS:=lua-luci
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
|
||||
|
||||
# LUA_TARGET:=compile LUAC=$(BUILD_DIR_HOST)/lua-luci/luac
|
||||
# LUA_TARGET:=compile LUAC=$(BUILD_DIR_HOST)/lua/luac
|
||||
LUA_TARGET:=source
|
||||
|
||||
|
||||
|
@ -48,7 +46,7 @@ endef
|
|||
define Package/ffluci
|
||||
$(call Package/ffluci/template)
|
||||
MENU:=1
|
||||
DEPENDS:=+lua-luci +luaposix +luci-addons
|
||||
DEPENDS:=+lua +luaposix +luci-addons
|
||||
endef
|
||||
|
||||
define Package/ffluci/conffiles
|
||||
|
|
|
@ -23,7 +23,7 @@ define Package/haserl-lua
|
|||
CATEGORY:=Utilities
|
||||
TITLE:=A CGI wrapper to embed shell scripts in HTML documents
|
||||
URL:=http://haserl.sourceforge.net/
|
||||
DEPENDS:=+liblua-luci
|
||||
DEPENDS:=+liblua
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
|
|
|
@ -1,151 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=lua-luci
|
||||
PKG_VERSION:=5.1.3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:=http://dev.leipzig.freifunk.net/svn/ff-luci/trunk/contrib/package-source/ \
|
||||
http://firmware.freifunk-halle.net/ffluci/package-source/
|
||||
PKG_MD5SUM:=98b12c767a5eed92169b01537e988c7f
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
|
||||
|
||||
X_HOST_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/lua-luci/Default
|
||||
SUBMENU:=LUA
|
||||
SECTION:=lang
|
||||
CATEGORY:=Languages
|
||||
TITLE:=LUA programming language
|
||||
URL:=http://www.lua.org/
|
||||
endef
|
||||
|
||||
define Package/lua-luci/Default/description
|
||||
Lua is a powerful light-weight programming language designed for extending
|
||||
applications. Lua is also frequently used as a general-purpose, stand-alone
|
||||
language. Lua is free software.
|
||||
endef
|
||||
|
||||
define Package/liblua-luci
|
||||
$(call Package/lua-luci/Default)
|
||||
SUBMENU:=
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE+= (libraries)
|
||||
endef
|
||||
|
||||
define Package/liblua-luci/description
|
||||
$(call Package/lua-luci/Default/description)
|
||||
This package contains the LUA shared libraries, needed by other programs.
|
||||
endef
|
||||
|
||||
define Package/lua-luci
|
||||
$(call Package/lua-luci/Default)
|
||||
DEPENDS:=+liblua-luci
|
||||
TITLE+= (interpreter)
|
||||
endef
|
||||
|
||||
define Package/lua-luci/description
|
||||
$(call Package/lua-luci/Default/description)
|
||||
This package contains the LUA language interpreter.
|
||||
endef
|
||||
|
||||
define Package/luac-luci
|
||||
$(call Package/lua-luci/Default)
|
||||
DEPENDS:=+liblua-luci
|
||||
TITLE+= (compiler)
|
||||
endef
|
||||
|
||||
define Package/luac/description
|
||||
$(call Package/lua-luci/Default/description)
|
||||
This package contains the LUA language compiler.
|
||||
endef
|
||||
|
||||
define Package/lua-luci-examples
|
||||
$(call Package/lua-luci/Default)
|
||||
DEPENDS:=lua-luci
|
||||
TITLE+= (examples)
|
||||
endef
|
||||
|
||||
define Package/lua-luci-examples/description
|
||||
$(call Package/lua-luci/Default/description)
|
||||
This package contains LUA language examples.
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
cp $(PKG_BUILD_DIR)/src $(PKG_BUILD_DIR)/src-host -R
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
CC="$(TARGET_CROSS)gcc" \
|
||||
LD="$(TARGET_CROSS)ld" \
|
||||
AR="$(TARGET_CROSS)ar rcu" \
|
||||
RANLIB="$(TARGET_CROSS)ranlib" \
|
||||
INSTALL_ROOT=/usr \
|
||||
MYCFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
|
||||
MYLDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
PKG_VERSION=$(PKG_VERSION) \
|
||||
all linux
|
||||
rm -rf $(PKG_INSTALL_DIR)
|
||||
mkdir -p $(PKG_INSTALL_DIR)
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
INSTALL_TOP="$(PKG_INSTALL_DIR)/usr" \
|
||||
install
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)/src-host luac-host
|
||||
mkdir -p $(X_HOST_DIR)
|
||||
cp $(PKG_BUILD_DIR)/src-host/luac-host $(X_HOST_DIR)/luac
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
mkdir -p $(1)/usr/include
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/lua{,lib,conf}.h $(1)/usr/include/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/lauxlib.h $(1)/usr/include/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/lnum_config.h $(1)/usr/include/
|
||||
mkdir -p $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.{a,so.*} $(1)/usr/lib/
|
||||
ln -sf liblua.so.$(PKG_VERSION) $(1)/usr/lib/liblua.so
|
||||
ln -sf liblua.so.$(PKG_VERSION) $(1)/usr/lib/liblualib.so
|
||||
endef
|
||||
|
||||
define Package/liblua-luci/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua.so.* $(1)/usr/lib/
|
||||
echo "Replaces: liblua" >> $(1)/CONTROL/control
|
||||
echo "Conflicts: liblua" >> $(1)/CONTROL/control
|
||||
endef
|
||||
|
||||
define Package/lua-luci/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua $(1)/usr/bin/
|
||||
echo "Replaces: lua" >> $(1)/CONTROL/control
|
||||
echo "Conflicts: lua" >> $(1)/CONTROL/control
|
||||
endef
|
||||
|
||||
define Package/luac-luci/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac $(1)/usr/bin/
|
||||
echo "Replaces: luac" >> $(1)/CONTROL/control
|
||||
echo "Conflicts: luac" >> $(1)/CONTROL/control
|
||||
endef
|
||||
|
||||
define Package/lua-luci-examples/install
|
||||
$(INSTALL_DIR) $(1)/usr/share/lua/examples
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/test/*.lua \
|
||||
$(1)/usr/share/lua/examples/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,liblua-luci))
|
||||
$(eval $(call BuildPackage,lua-luci))
|
||||
$(eval $(call BuildPackage,luac-luci))
|
||||
$(eval $(call BuildPackage,lua-luci-examples))
|
File diff suppressed because it is too large
Load diff
|
@ -1,139 +0,0 @@
|
|||
diff -ur lua-5.1.3-pt1/Makefile lua-5.1.3-pt2/Makefile
|
||||
--- lua-5.1.3-pt1/Makefile 2008-04-05 14:23:14.000000000 +0200
|
||||
+++ lua-5.1.3-pt2/Makefile 2008-04-05 15:13:38.000000000 +0200
|
||||
@@ -37,8 +37,8 @@
|
||||
|
||||
# What to install.
|
||||
TO_BIN= lua luac
|
||||
-TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
|
||||
-TO_LIB= liblua.a
|
||||
+TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp lnum_config.h
|
||||
+TO_LIB= liblua.a liblua.so liblua.so.$R
|
||||
TO_MAN= lua.1 luac.1
|
||||
|
||||
# Lua version and release.
|
||||
diff -ur lua-5.1.3-pt1/src/ldo.h lua-5.1.3-pt2/src/ldo.h
|
||||
--- lua-5.1.3-pt1/src/ldo.h 2008-04-05 14:23:14.000000000 +0200
|
||||
+++ lua-5.1.3-pt2/src/ldo.h 2008-04-05 14:25:40.000000000 +0200
|
||||
@@ -46,7 +46,7 @@
|
||||
LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult);
|
||||
LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize);
|
||||
LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
|
||||
-LUAI_FUNC void luaD_growstack (lua_State *L, int n);
|
||||
+LUA_API void luaD_growstack (lua_State *L, int n);
|
||||
|
||||
LUAI_FUNC void luaD_throw (lua_State *L, int errcode);
|
||||
LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);
|
||||
diff -ur lua-5.1.3-pt1/src/lfunc.h lua-5.1.3-pt2/src/lfunc.h
|
||||
--- lua-5.1.3-pt1/src/lfunc.h 2008-04-05 14:23:14.000000000 +0200
|
||||
+++ lua-5.1.3-pt2/src/lfunc.h 2008-04-05 14:25:40.000000000 +0200
|
||||
@@ -18,7 +18,7 @@
|
||||
cast(int, sizeof(TValue *)*((n)-1)))
|
||||
|
||||
|
||||
-LUAI_FUNC Proto *luaF_newproto (lua_State *L);
|
||||
+LUA_API Proto *luaF_newproto (lua_State *L);
|
||||
LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e);
|
||||
LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e);
|
||||
LUAI_FUNC UpVal *luaF_newupval (lua_State *L);
|
||||
diff -ur lua-5.1.3-pt1/src/lmem.h lua-5.1.3-pt2/src/lmem.h
|
||||
--- lua-5.1.3-pt1/src/lmem.h 2008-04-05 14:23:14.000000000 +0200
|
||||
+++ lua-5.1.3-pt2/src/lmem.h 2008-04-05 14:25:40.000000000 +0200
|
||||
@@ -38,9 +38,9 @@
|
||||
((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t))))
|
||||
|
||||
|
||||
-LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize,
|
||||
+LUA_API void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize,
|
||||
size_t size);
|
||||
-LUAI_FUNC void *luaM_toobig (lua_State *L);
|
||||
+LUA_API void *luaM_toobig (lua_State *L);
|
||||
LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size,
|
||||
size_t size_elem, int limit,
|
||||
const char *errormsg);
|
||||
diff -ur lua-5.1.3-pt1/src/lstring.h lua-5.1.3-pt2/src/lstring.h
|
||||
--- lua-5.1.3-pt1/src/lstring.h 2008-04-05 14:23:14.000000000 +0200
|
||||
+++ lua-5.1.3-pt2/src/lstring.h 2008-04-05 14:25:40.000000000 +0200
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
|
||||
LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
|
||||
-LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
|
||||
+LUA_API TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
|
||||
|
||||
|
||||
#endif
|
||||
diff -ur lua-5.1.3-pt1/src/lundump.h lua-5.1.3-pt2/src/lundump.h
|
||||
--- lua-5.1.3-pt1/src/lundump.h 2008-04-05 14:23:14.000000000 +0200
|
||||
+++ lua-5.1.3-pt2/src/lundump.h 2008-04-05 14:25:40.000000000 +0200
|
||||
@@ -17,7 +17,7 @@
|
||||
LUAI_FUNC void luaU_header (char* h);
|
||||
|
||||
/* dump one chunk; from ldump.c */
|
||||
-LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip);
|
||||
+LUA_API int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip);
|
||||
|
||||
#ifdef luac_c
|
||||
/* print one chunk; from print.c */
|
||||
diff -ur lua-5.1.3-pt1/src/Makefile lua-5.1.3-pt2/src/Makefile
|
||||
--- lua-5.1.3-pt1/src/Makefile 2008-04-05 14:23:31.000000000 +0200
|
||||
+++ lua-5.1.3-pt2/src/Makefile 2008-04-05 14:25:40.000000000 +0200
|
||||
@@ -23,6 +23,7 @@
|
||||
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
|
||||
|
||||
LUA_A= liblua.a
|
||||
+LUA_SO= liblua.so
|
||||
CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
|
||||
lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \
|
||||
lundump.o lvm.o lzio.o lnum.o
|
||||
@@ -33,11 +34,12 @@
|
||||
LUA_O= lua.o
|
||||
|
||||
LUAC_T= luac
|
||||
-LUAC_O= luac.o print.o
|
||||
+LUAC_O= luac.o print.o lopcodes.o
|
||||
|
||||
ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
|
||||
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
|
||||
+ALL_T= $(LUA_A) $(LUA_SO) $(LUA_T) $(LUAC_T)
|
||||
ALL_A= $(LUA_A)
|
||||
+ALL_SO= $(LUA_SO)
|
||||
|
||||
default: $(PLAT)
|
||||
|
||||
@@ -47,14 +49,23 @@
|
||||
|
||||
a: $(ALL_A)
|
||||
|
||||
+so: $(ALL_SO)
|
||||
+
|
||||
$(LUA_A): $(CORE_O) $(LIB_O)
|
||||
$(AR) $@ $?
|
||||
$(RANLIB) $@
|
||||
|
||||
-$(LUA_T): $(LUA_O) $(LUA_A)
|
||||
- $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
|
||||
+$(LUA_SO): $(CORE_O) $(LIB_O)
|
||||
+ $(LD) -o $@.$(PKG_VERSION) -shared -soname="$@.$(PKG_VERSION)" $?
|
||||
+ ln -fs $@.$(PKG_VERSION) $@
|
||||
+
|
||||
+$(LUA_T): $(LUA_O) $(LUA_SO)
|
||||
+ $(CC) -o $@ -L. -llua $(MYLDFLAGS) $(LUA_O) $(LIBS)
|
||||
+
|
||||
+$(LUAC_T): $(LUAC_O) $(LUA_SO)
|
||||
+ $(CC) -o $@ -L. -llua $(MYLDFLAGS) $(LUAC_O) $(LIBS)
|
||||
|
||||
-$(LUAC_T): $(LUAC_O) $(LUA_A)
|
||||
+$(LUAC_T)-host: $(LUAC_O) $(LUA_A)
|
||||
$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
|
||||
|
||||
clean:
|
||||
@@ -96,7 +107,7 @@
|
||||
$(MAKE) all MYCFLAGS=
|
||||
|
||||
linux:
|
||||
- $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
|
||||
+ $(MAKE) all MYCFLAGS+=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
|
||||
|
||||
macosx:
|
||||
$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"
|
|
@ -1,113 +0,0 @@
|
|||
diff -ur lua-5.1.3-pt2/src/ldump.c lua-5.1.3-pt3/src/ldump.c
|
||||
--- lua-5.1.3-pt2/src/ldump.c 2008-04-05 14:25:13.000000000 +0200
|
||||
+++ lua-5.1.3-pt3/src/ldump.c 2008-04-05 14:28:27.000000000 +0200
|
||||
@@ -67,12 +67,12 @@
|
||||
{
|
||||
if (s==NULL || getstr(s)==NULL)
|
||||
{
|
||||
- size_t size=0;
|
||||
+ unsigned int size=0;
|
||||
DumpVar(size,D);
|
||||
}
|
||||
else
|
||||
{
|
||||
- size_t size=s->tsv.len+1; /* include trailing '\0' */
|
||||
+ unsigned int size=s->tsv.len+1; /* include trailing '\0' */
|
||||
DumpVar(size,D);
|
||||
DumpBlock(getstr(s),size,D);
|
||||
}
|
||||
diff -ur lua-5.1.3-pt2/src/lundump.c lua-5.1.3-pt3/src/lundump.c
|
||||
--- lua-5.1.3-pt2/src/lundump.c 2008-04-05 14:25:13.000000000 +0200
|
||||
+++ lua-5.1.3-pt3/src/lundump.c 2008-04-05 14:28:27.000000000 +0200
|
||||
@@ -25,6 +25,7 @@
|
||||
ZIO* Z;
|
||||
Mbuffer* b;
|
||||
const char* name;
|
||||
+ int swap;
|
||||
} LoadState;
|
||||
|
||||
#ifdef LUAC_TRUST_BINARIES
|
||||
@@ -40,7 +41,6 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
-#define LoadMem(S,b,n,size) LoadBlock(S,b,(n)*(size))
|
||||
#define LoadByte(S) (lu_byte)LoadChar(S)
|
||||
#define LoadVar(S,x) LoadMem(S,&x,1,sizeof(x))
|
||||
#define LoadVector(S,b,n,size) LoadMem(S,b,n,size)
|
||||
@@ -52,6 +52,49 @@
|
||||
IF (r!=0, "unexpected end");
|
||||
}
|
||||
|
||||
+static void LoadMem (LoadState* S, void* b, int n, size_t size)
|
||||
+{
|
||||
+ LoadBlock(S,b,n*size);
|
||||
+ if (S->swap)
|
||||
+ {
|
||||
+ char* p=(char*) b;
|
||||
+ char c;
|
||||
+ switch (size)
|
||||
+ {
|
||||
+ case 1:
|
||||
+ break;
|
||||
+ case 2:
|
||||
+ while (n--)
|
||||
+ {
|
||||
+ c=p[0]; p[0]=p[1]; p[1]=c;
|
||||
+ p+=2;
|
||||
+ }
|
||||
+ break;
|
||||
+ case 4:
|
||||
+ while (n--)
|
||||
+ {
|
||||
+ c=p[0]; p[0]=p[3]; p[3]=c;
|
||||
+ c=p[1]; p[1]=p[2]; p[2]=c;
|
||||
+ p+=4;
|
||||
+ }
|
||||
+ break;
|
||||
+ case 8:
|
||||
+ while (n--)
|
||||
+ {
|
||||
+ c=p[0]; p[0]=p[7]; p[7]=c;
|
||||
+ c=p[1]; p[1]=p[6]; p[6]=c;
|
||||
+ c=p[2]; p[2]=p[5]; p[5]=c;
|
||||
+ c=p[3]; p[3]=p[4]; p[4]=c;
|
||||
+ p+=8;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ IF(1, "bad size");
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static int LoadChar(LoadState* S)
|
||||
{
|
||||
char x;
|
||||
@@ -83,7 +126,7 @@
|
||||
|
||||
static TString* LoadString(LoadState* S)
|
||||
{
|
||||
- size_t size;
|
||||
+ unsigned int size;
|
||||
LoadVar(S,size);
|
||||
if (size==0)
|
||||
return NULL;
|
||||
@@ -194,6 +237,7 @@
|
||||
char s[LUAC_HEADERSIZE];
|
||||
luaU_header(h);
|
||||
LoadBlock(S,s,LUAC_HEADERSIZE);
|
||||
+ S->swap=(s[6]!=h[6]); s[6]=h[6];
|
||||
IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header");
|
||||
}
|
||||
|
||||
@@ -228,7 +272,7 @@
|
||||
*h++=(char)LUAC_FORMAT;
|
||||
*h++=(char)*(char*)&x; /* endianness */
|
||||
*h++=(char)sizeof(int);
|
||||
- *h++=(char)sizeof(size_t);
|
||||
+ *h++=(char)sizeof(unsigned int);
|
||||
*h++=(char)sizeof(Instruction);
|
||||
*h++=(char)sizeof(lua_Number);
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
diff -ur lua-luci-5.1.3/src/luaconf.h lua-luci-5.1.3-new/src/luaconf.h
|
||||
--- lua-luci-5.1.3/src/luaconf.h 2008-04-14 13:19:54.000000000 +0200
|
||||
+++ lua-luci-5.1.3-new/src/luaconf.h 2008-04-14 13:19:17.000000000 +0200
|
||||
@@ -38,7 +38,6 @@
|
||||
#if defined(LUA_USE_LINUX)
|
||||
#define LUA_USE_POSIX
|
||||
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
|
||||
-#define LUA_USE_READLINE /* needs some extra libraries */
|
||||
#endif
|
||||
|
||||
#if defined(LUA_USE_MACOSX)
|
||||
Nur in lua-luci-5.1.3-new/src: luaconf.h.orig.
|
||||
diff -ur lua-luci-5.1.3/src/Makefile lua-luci-5.1.3-new/src/Makefile
|
||||
--- lua-luci-5.1.3/src/Makefile 2008-04-14 13:19:57.000000000 +0200
|
||||
+++ lua-luci-5.1.3-new/src/Makefile 2008-04-14 13:19:17.000000000 +0200
|
||||
@@ -17,6 +17,7 @@
|
||||
MYCFLAGS=
|
||||
MYLDFLAGS=
|
||||
MYLIBS=
|
||||
+# USE_READLINE=1
|
||||
|
||||
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
|
||||
|
||||
@@ -86,7 +87,7 @@
|
||||
@echo "MYLIBS = $(MYLIBS)"
|
||||
|
||||
# convenience targets for popular platforms
|
||||
-
|
||||
+RFLAG=$(if $(USE_READLINE),-DLUA_USE_READLINE)
|
||||
none:
|
||||
@echo "Please choose a platform:"
|
||||
@echo " $(PLATS)"
|
||||
@@ -101,16 +102,16 @@
|
||||
$(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-Wl,-E"
|
||||
|
||||
freebsd:
|
||||
- $(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline"
|
||||
+ $(MAKE) all MYCFLAGS="-DLUA_USE_LINUX $(RFLAG)" MYLIBS="-Wl,-E$(if $(USE_READLINE), -lreadline)"
|
||||
|
||||
generic:
|
||||
$(MAKE) all MYCFLAGS=
|
||||
|
||||
linux:
|
||||
- $(MAKE) all MYCFLAGS+=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
|
||||
+ $(MAKE) all MYCFLAGS+="-DLUA_USE_LINUX $(RFLAG)" MYLIBS="-Wl,-E -ldl $(if $(USE_READLINE), -lreadline -lhistory -lncurses)"
|
||||
|
||||
macosx:
|
||||
- $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"
|
||||
+ $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX $(if $(USE_READLINE), MYLIBS="-lreadline")
|
||||
# use this on Mac OS X 10.3-
|
||||
# $(MAKE) all MYCFLAGS=-DLUA_USE_MACOSX
|
||||
|
||||
Nur in lua-luci-5.1.3-new/src: Makefile.orig.
|
|
@ -1,36 +0,0 @@
|
|||
diff -ur lua-5.1.3/etc/lua.pc lua-5.1.3-new/etc/lua.pc
|
||||
--- lua-5.1.3/etc/lua.pc 2008-01-11 14:12:59.000000000 +0100
|
||||
+++ lua-5.1.3-new/etc/lua.pc 2008-05-18 22:09:24.000000000 +0200
|
||||
@@ -8,7 +8,7 @@
|
||||
R= 5.1.3
|
||||
|
||||
# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
|
||||
-prefix= /usr/local
|
||||
+prefix= /usr
|
||||
INSTALL_BIN= ${prefix}/bin
|
||||
INSTALL_INC= ${prefix}/include
|
||||
INSTALL_LIB= ${prefix}/lib
|
||||
diff -ur lua-5.1.3/Makefile lua-5.1.3-new/Makefile
|
||||
--- lua-5.1.3/Makefile 2008-05-18 22:06:55.000000000 +0200
|
||||
+++ lua-5.1.3-new/Makefile 2008-05-18 22:09:13.000000000 +0200
|
||||
@@ -12,7 +12,7 @@
|
||||
# doc directory.) You may want to make these paths consistent with LUA_ROOT,
|
||||
# LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc).
|
||||
#
|
||||
-INSTALL_TOP= /usr/local
|
||||
+INSTALL_TOP= /usr
|
||||
INSTALL_BIN= $(INSTALL_TOP)/bin
|
||||
INSTALL_INC= $(INSTALL_TOP)/include
|
||||
INSTALL_LIB= $(INSTALL_TOP)/lib
|
||||
diff -ur lua-5.1.3/src/luaconf.h lua-5.1.3-new/src/luaconf.h
|
||||
--- lua-5.1.3/src/luaconf.h 2008-05-18 22:07:11.000000000 +0200
|
||||
+++ lua-5.1.3-new/src/luaconf.h 2008-05-18 22:09:50.000000000 +0200
|
||||
@@ -95,7 +95,7 @@
|
||||
".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
|
||||
|
||||
#else
|
||||
-#define LUA_ROOT "/usr/local/"
|
||||
+#define LUA_ROOT "/usr/"
|
||||
#define LUA_LDIR LUA_ROOT "share/lua/5.1/"
|
||||
#define LUA_CDIR LUA_ROOT "lib/lua/5.1/"
|
||||
#define LUA_PATH_DEFAULT \
|
|
@ -18,7 +18,7 @@ define Package/luaposix
|
|||
CATEGORY:=Libraries
|
||||
TITLE:=Lua Posix library
|
||||
URL:=http://luaforge.net/projects/luaposix/
|
||||
DEPENDS:=+liblua-luci
|
||||
DEPENDS:=+liblua
|
||||
MAINTAINER:=Steven Barth <steven-at-midlink-dot-org>
|
||||
endef
|
||||
|
||||
|
|
|
@ -137,11 +137,30 @@ function createindex()
|
|||
end
|
||||
end
|
||||
|
||||
-- Shortcut for creating a dispatching node
|
||||
function entry(path, target, title, order, add)
|
||||
add = add or {}
|
||||
|
||||
local c = node(path)
|
||||
c.target = target
|
||||
c.title = title
|
||||
c.order = order
|
||||
|
||||
for k,v in pairs(add) do
|
||||
c[k] = v
|
||||
end
|
||||
|
||||
return c
|
||||
end
|
||||
|
||||
-- Fetch a dispatching node
|
||||
function node(...)
|
||||
local c = tree
|
||||
|
||||
if arg[1] and type(arg[1]) == "table" then
|
||||
arg = arg[1]
|
||||
end
|
||||
|
||||
for k,v in ipairs(arg) do
|
||||
if not c.nodes[v] then
|
||||
c.nodes[v] = {nodes={}}
|
||||
|
|
Loading…
Reference in a new issue