[asterisk-commits] mnicholson: branch mnicholson/asttest r193344 - in /team/mnicholson/asttest/a...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 8 12:06:57 CDT 2009


Author: mnicholson
Date: Fri May  8 12:06:54 2009
New Revision: 193344

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=193344
Log:
Added LuaSocket to the distribution.  It will be used for manager interaction.

Added:
    team/mnicholson/asttest/asttest/lua/luasocket-2.0.2.tar.gz   (with props)
    team/mnicholson/asttest/asttest/tools/luasocket.diff   (with props)
Modified:
    team/mnicholson/asttest/asttest/Makefile
    team/mnicholson/asttest/asttest/lib/lua.c

Modified: team/mnicholson/asttest/asttest/Makefile
URL: http://svn.asterisk.org/svn-view/asterisk/team/mnicholson/asttest/asttest/Makefile?view=diff&rev=193344&r1=193343&r2=193344
==============================================================================
--- team/mnicholson/asttest/asttest/Makefile (original)
+++ team/mnicholson/asttest/asttest/Makefile Fri May  8 12:06:54 2009
@@ -21,11 +21,18 @@
 .PHONY: clean dist-clean distclean test check asterisk
 
 LUAFILESYSTEM=luafilesystem-1.4.2
+LUASOCKET=luasocket-2.0.2
+
+LUAFILESYSTEM_OBJS=lua/$(LUAFILESYSTEM)/src/lfs.o 
+LUASOCKET_OBJS=lua/$(LUASOCKET)/src/luasocket.a
+
+LUAFILESYSTEM_HEADER=lua/$(LUAFILESYSTEM)/src/lfs.h
+LUASOCKET_HEADER=lua/$(LUASOCKET)/src/luasocket.h
 
 # Basic set of sources and flags/libraries/includes
 OBJS:=asttest.o lib/lua.o lib/testsuite.o lib/testutils.o
 CFLAGS:=-g -c -D_GNU_SOURCE -Wall -I/usr/include/lua5.1 -Iinclude -Ilua
-L_OBJS:=lua/testlib.o lua/astlib.o lua/$(LUAFILESYSTEM)/src/lfs.o
+L_OBJS:=$(LUAFILESYSTEM_OBJS) $(LUASOCKET_OBJS) lua/testlib.o lua/astlib.o
 T_LIBS:=-llua5.1
 
 AST_INSTALL_DIR = $(PWD)/asterisk
@@ -78,8 +85,11 @@
 lib/testsuite.o: lib/testsuite.c include/asttest/testsuite.h include/asttest/asttest.h
 lib/testutils.o: lib/testutils.c include/asttest/testutils.h include/asttest/asttest.h include/asttest/testsuite.h include/asttest/lua.h
 
-lib/lua.o: lib/lua.c lua/$(LUAFILESYSTEM)/src/lfs.o include/asttest/lua.h include/asttest/testsuite.h include/asttest/lua/*.h
-	$(CC) $(CFLAGS) -o $@ -DLUAFILESYSTEM_H=\"../lua/$(LUAFILESYSTEM)/src/lfs.h\" $<
+lib/lua.o: lib/lua.c $(LUAFILESYSTEM_OBJS) $(LUASOCKET_OBJS) include/asttest/lua.h include/asttest/testsuite.h include/asttest/lua/*.h
+	$(CC) $(CFLAGS) -o $@ \
+	-DLUAFILESYSTEM_HEADER=\"../$(LUAFILESYSTEM_HEADER)\" \
+	-DLUASOCKET_HEADER=\"../$(LUASOCKET_HEADER)\" \
+       	$<
 
 lua/testlib.o: lua/testlib.c lua/testlib_lua.h include/asttest/lua/testlib.h
 lua/astlib.o: lua/astlib.c lua/astlib_lua.h include/asttest/lua/astlib.h
@@ -91,6 +101,14 @@
 	tar -C lua -zxf lua/$(LUAFILESYSTEM).tar.gz 
 	patch -p1 -d lua/$(LUAFILESYSTEM) < tools/lfs.diff
 	touch lua/lfs-patched.stamp
+
+lua/$(LUASOCKET)/src/luasocket.a: lua/$(LUASOCKET) lua/luasocket-patched.stamp
+	$(MAKE) -C lua/$(LUASOCKET)
+
+lua/luasocket-patched.stamp lua/$(LUASOCKET): lua/$(LUASOCKET).tar.gz
+	tar -C lua -zxf lua/$(LUASOCKET).tar.gz 
+	patch -p1 -d lua/$(LUASOCKET) < tools/luasocket.diff
+	touch lua/luasocket-patched.stamp
 
 
 asttest: asttest.c $(OBJS) $(T_OBJS) $(L_OBJS) include/asttest/asttest.h
@@ -111,6 +129,8 @@
 	rm -rf $(AST_INSTALL_DIR)
 	-$(MAKE) -C lua/$(LUAFILESYSTEM) clean
 	rm -f lua/lfs-patched.stamp
+	-$(MAKE) -C lua/$(LUASOCKET) clean
+	rm -f lua/luasocket-patched.stamp
 
 dist-clean: distclean
 
@@ -118,3 +138,4 @@
 	rm -f autoconfig.h config.status config.log makeopts
 	rm -rf autom4te.cache
 	rm -rf lua/$(LUAFILESYSTEM)
+	rm -rf lua/$(LUASOCKET)

Modified: team/mnicholson/asttest/asttest/lib/lua.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/mnicholson/asttest/asttest/lib/lua.c?view=diff&rev=193344&r1=193343&r2=193344
==============================================================================
--- team/mnicholson/asttest/asttest/lib/lua.c (original)
+++ team/mnicholson/asttest/asttest/lib/lua.c Fri May  8 12:06:54 2009
@@ -26,7 +26,8 @@
 #include "asttest/lua/astlib.h"
 #include "asttest/lua/testlib.h"
 
-#include LUAFILESYSTEM_H
+#include LUAFILESYSTEM_HEADER
+#include LUASOCKET_HEADER
 
 lua_State *get_lua_state(struct testsuite *ts, const char *test_name) {
 	lua_State *L = luaL_newstate();
@@ -38,6 +39,12 @@
 
 	/* luad LuaFileSystem */
 	lua_pushcfunction(L, luaopen_lfs);
+	if (lua_pcall(L, 0, 0, 0)) {
+		goto e_print_error;
+	}
+
+	/* load LuaSocket */
+	lua_pushcfunction(L, luaopen_socket_core);
 	if (lua_pcall(L, 0, 0, 0)) {
 		goto e_print_error;
 	}

Added: team/mnicholson/asttest/asttest/lua/luasocket-2.0.2.tar.gz
URL: http://svn.asterisk.org/svn-view/asterisk/team/mnicholson/asttest/asttest/lua/luasocket-2.0.2.tar.gz?view=auto&rev=193344
==============================================================================
Binary file - no diff available.

Propchange: team/mnicholson/asttest/asttest/lua/luasocket-2.0.2.tar.gz
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: team/mnicholson/asttest/asttest/tools/luasocket.diff
URL: http://svn.asterisk.org/svn-view/asterisk/team/mnicholson/asttest/asttest/tools/luasocket.diff?view=auto&rev=193344
==============================================================================
--- team/mnicholson/asttest/asttest/tools/luasocket.diff (added)
+++ team/mnicholson/asttest/asttest/tools/luasocket.diff Fri May  8 12:06:54 2009
@@ -1,0 +1,64 @@
+diff -ru a/config b/config
+--- a/config	2007-10-14 23:21:05.000000000 -0500
++++ b/config	2009-05-08 11:43:37.000000000 -0500
+@@ -11,13 +11,12 @@
+ SOCKET_SO=socket.$(EXT).$(SOCKET_V) 
+ MIME_SO=mime.$(EXT).$(MIME_V)
+ UNIX_SO=unix.$(EXT)
++SOCKET_A=luasocket.a
+ 
+ #------
+ # Lua includes and libraries
+ #
+-#LUAINC=-I/usr/local/include/lua50
+-#LUAINC=-I/usr/local/include/lua5.1
+-#LUAINC=-Ilua-5.1.1/src
++LUAINC=`pkg-config --cflags lua5.1`
+ 
+ #------
+ # Compat-5.1 directory
+@@ -54,6 +53,10 @@
+ CFLAGS= $(LUAINC) $(DEF) -pedantic -Wall -O2 -fpic
+ LDFLAGS=-O -shared -fpic
+ LD=gcc 
++AR=ar
++ARFLAGS=rc
++RANLIB=ranlib
++RANLIBFLAGS=
+ 
+ #------
+ # End of makefile configuration
+diff -ru a/src/makefile b/src/makefile
+--- a/src/makefile	2007-10-14 23:21:05.000000000 -0500
++++ b/src/makefile	2009-05-08 11:41:32.000000000 -0500
+@@ -47,7 +47,7 @@
+ 	usocket.o \
+ 	unix.o
+ 
+-all: $(SOCKET_SO) $(MIME_SO) 
++all: $(SOCKET_SO) $(MIME_SO) $(SOCKET_A)
+ 
+ $(SOCKET_SO): $(SOCKET_OBJS)
+ 	$(LD) $(LDFLAGS) -o $@ $(SOCKET_OBJS)
+@@ -58,6 +58,11 @@
+ $(UNIX_SO): $(UNIX_OBJS)
+ 	$(LD) $(LDFLAGS) -o $@ $(UNIX_OBJS)
+ 
++$(SOCKET_A): $(SOCKET_OBJS)
++	$(AR) $(ARFLAGS) $@ $(SOCKET_OBJS)
++	$(RANLIB) $(RANLIBFLAGS) $@
++	
++
+ #------
+ # List of dependencies
+ #
+@@ -82,7 +87,7 @@
+ usocket.o: usocket.c socket.h io.h timeout.h usocket.h
+ 
+ clean:
+-	rm -f $(SOCKET_SO) $(SOCKET_OBJS) 
++	rm -f $(SOCKET_SO) $(SOCKET_A) $(SOCKET_OBJS) 
+ 	rm -f $(MIME_SO) $(UNIX_SO) $(MIME_OBJS) $(UNIX_OBJS)
+ 
+ #------
+Only in b: tags

Propchange: team/mnicholson/asttest/asttest/tools/luasocket.diff
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/tools/luasocket.diff
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/tools/luasocket.diff
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the asterisk-commits mailing list