Out of the box support for Lua 5.3.

This commit is contained in:
Diego Nehab 2015-02-18 20:51:37 -02:00
parent 5edf093643
commit ddf4292824
7 changed files with 96 additions and 85 deletions

View File

@ -5,7 +5,7 @@
# Targets: # Targets:
# install install system independent support # install install system independent support
# install-unix also install unix-only support # install-unix also install unix-only support
# install-both install for both lua5.1 and lua5.2 # install-both install for lua51 lua52 lua53
# install-both-unix also install unix-only # install-both-unix also install unix-only
# print print the build settings # print print the build settings
@ -30,6 +30,9 @@ install-both:
$(MAKE) clean $(MAKE) clean
@cd src; $(MAKE) $(PLAT) LUAV=5.2 @cd src; $(MAKE) $(PLAT) LUAV=5.2
@cd src; $(MAKE) install LUAV=5.2 @cd src; $(MAKE) install LUAV=5.2
$(MAKE) clean
@cd src; $(MAKE) $(PLAT) LUAV=5.3
@cd src; $(MAKE) install LUAV=5.3
install-both-unix: install-both-unix:
$(MAKE) clean $(MAKE) clean
@ -38,6 +41,9 @@ install-both-unix:
$(MAKE) clean $(MAKE) clean
@cd src; $(MAKE) $(PLAT) LUAV=5.2 @cd src; $(MAKE) $(PLAT) LUAV=5.2
@cd src; $(MAKE) install-unix LUAV=5.2 @cd src; $(MAKE) install-unix LUAV=5.2
$(MAKE) clean
@cd src; $(MAKE) $(PLAT) LUAV=5.3
@cd src; $(MAKE) install-unix LUAV=5.3
.PHONY: test .PHONY: test

View File

@ -18,7 +18,6 @@
#include "lua.h" #include "lua.h"
#include "lauxlib.h" #include "lauxlib.h"
/*=========================================================================*\ /*=========================================================================*\
* LuaSocket includes * LuaSocket includes
\*=========================================================================*/ \*=========================================================================*/
@ -32,6 +31,11 @@
#include "udp.h" #include "udp.h"
#include "select.h" #include "select.h"
#if LUA_VERSION_NUM > 502 && !defined(LUA_COMPAT_APIINTCASTS)
#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n)))
#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d)))
#endif
/*-------------------------------------------------------------------------*\ /*-------------------------------------------------------------------------*\
* Internal function prototypes * Internal function prototypes
\*-------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
@ -78,14 +82,6 @@ static int global_unload(lua_State *L) {
return 0; return 0;
} }
#if LUA_VERSION_NUM > 501
int luaL_typerror (lua_State *L, int narg, const char *tname) {
const char *msg = lua_pushfstring(L, "%s expected, got %s",
tname, luaL_typename(L, narg));
return luaL_argerror(L, narg, msg);
}
#endif
/*-------------------------------------------------------------------------*\ /*-------------------------------------------------------------------------*\
* Setup basic stuff. * Setup basic stuff.
\*-------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/

View File

@ -147,7 +147,7 @@ DEF_macosx= -DLUASOCKET_$(DEBUG) -DUNIX_HAS_SUN_LEN -DLUA_$(COMPAT)_MODULE \
-DLUASOCKET_API='__attribute__((visibility("default")))' \ -DLUASOCKET_API='__attribute__((visibility("default")))' \
-DUNIX_API='__attribute__((visibility("default")))' \ -DUNIX_API='__attribute__((visibility("default")))' \
-DMIME_API='__attribute__((visibility("default")))' -DMIME_API='__attribute__((visibility("default")))'
CFLAGS_macosx= -I$(LUAINC) $(DEF) -pedantic -Wall -O2 -fno-common \ CFLAGS_macosx= -I$(LUAINC) $(DEF) -Wall -O2 -fno-common \
-fvisibility=hidden -fvisibility=hidden
LDFLAGS_macosx= -bundle -undefined dynamic_lookup -o LDFLAGS_macosx= -bundle -undefined dynamic_lookup -o
LD_macosx= export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc LD_macosx= export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc
@ -163,7 +163,7 @@ DEF_linux=-DLUASOCKET_$(DEBUG) -DLUA_$(COMPAT)_MODULE \
-DLUASOCKET_API='__attribute__((visibility("default")))' \ -DLUASOCKET_API='__attribute__((visibility("default")))' \
-DUNIX_API='__attribute__((visibility("default")))' \ -DUNIX_API='__attribute__((visibility("default")))' \
-DMIME_API='__attribute__((visibility("default")))' -DMIME_API='__attribute__((visibility("default")))'
CFLAGS_linux= -I$(LUAINC) $(DEF) -pedantic -Wall -Wshadow -Wextra \ CFLAGS_linux= -I$(LUAINC) $(DEF) -Wall -Wshadow -Wextra \
-Wimplicit -O2 -ggdb3 -fpic -fvisibility=hidden -Wimplicit -O2 -ggdb3 -fpic -fvisibility=hidden
LDFLAGS_linux=-O -shared -fpic -o LDFLAGS_linux=-O -shared -fpic -o
LD_linux=gcc LD_linux=gcc
@ -179,7 +179,7 @@ DEF_freebsd=-DLUASOCKET_$(DEBUG) -DLUA_$(COMPAT)_MODULE \
-DLUASOCKET_API='__attribute__((visibility("default")))' \ -DLUASOCKET_API='__attribute__((visibility("default")))' \
-DUNIX_API='__attribute__((visibility("default")))' \ -DUNIX_API='__attribute__((visibility("default")))' \
-DMIME_API='__attribute__((visibility("default")))' -DMIME_API='__attribute__((visibility("default")))'
CFLAGS_freebsd= -I$(LUAINC) $(DEF) -pedantic -Wall -Wshadow -Wextra \ CFLAGS_freebsd= -I$(LUAINC) $(DEF) -Wall -Wshadow -Wextra \
-Wimplicit -O2 -ggdb3 -fpic -fvisibility=hidden -Wimplicit -O2 -ggdb3 -fpic -fvisibility=hidden
LDFLAGS_freebsd=-O -shared -fpic -o LDFLAGS_freebsd=-O -shared -fpic -o
LD_freebsd=gcc LD_freebsd=gcc
@ -194,7 +194,7 @@ CC_mingw=gcc
DEF_mingw= -DLUASOCKET_INET_PTON -DLUASOCKET_$(DEBUG) -DLUA_$(COMPAT)_MODULE \ DEF_mingw= -DLUASOCKET_INET_PTON -DLUASOCKET_$(DEBUG) -DLUA_$(COMPAT)_MODULE \
-DWINVER=0x0501 -DLUASOCKET_API='__declspec(dllexport)' \ -DWINVER=0x0501 -DLUASOCKET_API='__declspec(dllexport)' \
-DMIME_API='__declspec(dllexport)' -DMIME_API='__declspec(dllexport)'
CFLAGS_mingw= -I$(LUAINC) $(DEF) -pedantic -Wall -O2 -fno-common \ CFLAGS_mingw= -I$(LUAINC) $(DEF) -Wall -O2 -fno-common \
-fvisibility=hidden -fvisibility=hidden
LDFLAGS_mingw= $(LUALIB) -shared -Wl,-s -lws2_32 -o LDFLAGS_mingw= $(LUALIB) -shared -Wl,-s -lws2_32 -o
LD_mingw=gcc LD_mingw=gcc

View File

@ -13,6 +13,11 @@
#include "mime.h" #include "mime.h"
#if LUA_VERSION_NUM > 502 && !defined(LUA_COMPAT_APIINTCASTS)
#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n)))
#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d)))
#endif
/*=========================================================================*\ /*=========================================================================*\
* Don't want to trust escape character constants * Don't want to trust escape character constants
\*=========================================================================*/ \*=========================================================================*/

4
test/auth/.htaccess Normal file
View File

@ -0,0 +1,4 @@
AuthName "test-auth"
AuthType Basic
AuthUserFile /Users/diego/impa/luasocket/test/auth/.htpasswd
Require valid-user

View File

@ -1 +1 @@
luasocket:l8n2npozPB.sQ luasocket:$apr1$47u2O.Me$.m/5BWAtt7GVoxsouIPBR1