[asterisk-commits] mnicholson: branch mnicholson/asttest r193388 - in /team/mnicholson/asttest/a...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri May 8 15:45:02 CDT 2009
Author: mnicholson
Date: Fri May 8 15:44:58 2009
New Revision: 193388
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=193388
Log:
Added LuaPosix and cleaned up Makefile a little.
Added:
team/mnicholson/asttest/asttest/lua/luaposix-5.1.4.tar.gz (with props)
team/mnicholson/asttest/asttest/tools/luaposix.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=193388&r1=193387&r2=193388
==============================================================================
--- team/mnicholson/asttest/asttest/Makefile (original)
+++ team/mnicholson/asttest/asttest/Makefile Fri May 8 15:44:58 2009
@@ -22,17 +22,24 @@
LUAFILESYSTEM=luafilesystem-1.4.2
LUASOCKET=luasocket-2.0.2
+LUAPOSIX=luaposix-5.1.4
LUAFILESYSTEM_OBJS=lua/$(LUAFILESYSTEM)/src/lfs.o
LUASOCKET_OBJS=lua/$(LUASOCKET)/src/luasocket.a
+LUAPOSIX_OBJS=lua/$(LUAPOSIX)/lposix.o
LUAFILESYSTEM_HEADER=lua/$(LUAFILESYSTEM)/src/lfs.h
LUASOCKET_HEADER=lua/$(LUASOCKET)/src/luasocket.h
+LUAPOSIX_HEADER=lua/$(LUAPOSIX)/lposix.h
+
+LUAPOSIX_LIBS=-lcrypt
# 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:=$(LUAFILESYSTEM_OBJS) $(LUASOCKET_OBJS) lua/testlib.o lua/astlib.o
+L_MODULES:=$(LUAFILESYSTEM_OBJS) $(LUASOCKET_OBJS) $(LUAPOSIX_OBJS)
+L_LIBS:=$(LUAPOSIX_LIBS)
+L_OBJS:=lua/testlib.o lua/astlib.o
T_LIBS:=-llua5.1
AST_INSTALL_DIR = $(PWD)/asterisk
@@ -86,10 +93,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 $(LUAFILESYSTEM_OBJS) $(LUASOCKET_OBJS) include/asttest/lua.h include/asttest/testsuite.h include/asttest/lua/*.h
+lib/lua.o: lib/lua.c $(L_MODULES) include/asttest/lua.h include/asttest/testsuite.h include/asttest/lua/*.h
$(CC) $(CFLAGS) -o $@ \
-DLUAFILESYSTEM_HEADER=\"../$(LUAFILESYSTEM_HEADER)\" \
-DLUASOCKET_HEADER=\"../$(LUASOCKET_HEADER)\" \
+ -DLUAPOSIX_HEADER=\"../$(LUAPOSIX_HEADER)\" \
$<
lua/testlib.o: lua/testlib.c lua/testlib_lua.h include/asttest/lua/testlib.h
@@ -111,9 +119,16 @@
patch -p1 -d lua/$(LUASOCKET) < tools/luasocket.diff
touch lua/luasocket-patched.stamp
+$(LUAPOSIX_OBJS): lua/$(LUAPOSIX) lua/luaposix-patched.stamp
+ $(MAKE) -C lua/$(LUAPOSIX)
+
+lua/luaposix-patched.stamp lua/$(LUAPOSIX): lua/$(LUAPOSIX).tar.gz
+ tar -C lua -zxf lua/$(LUAPOSIX).tar.gz
+ patch -p1 -d lua/$(LUAPOSIX) < tools/luaposix.diff
+ touch lua/luaposix-patched.stamp
asttest: asttest.c $(OBJS) $(T_OBJS) $(L_OBJS) include/asttest/asttest.h
- $(CC) -o $@ $(OBJS) $(L_OBJS) $(T_LIBS)
+ $(CC) -o $@ $(OBJS) $(L_OBJS) $(T_LIBS) $(L_MODULES) $(L_LIBS)
tools/mkstring: tools/mkstring.c
$(CC) -D_GNU_SOURCE -Wall -o $@ $^
@@ -129,9 +144,8 @@
rm -f tools/mkstring
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
+ -$(MAKE) -C lua/$(LUAPOSIX) clean
dist-clean: distclean
@@ -140,3 +154,8 @@
rm -rf autom4te.cache
rm -rf lua/$(LUAFILESYSTEM)
rm -rf lua/$(LUASOCKET)
+ rm -rf lua/$(LUAPOSIX)
+ rm -f lua/lfs-patched.stamp
+ rm -f lua/luasocket-patched.stamp
+ rm -f lua/luaposix-patched.stamp
+
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=193388&r1=193387&r2=193388
==============================================================================
--- team/mnicholson/asttest/asttest/lib/lua.c (original)
+++ team/mnicholson/asttest/asttest/lib/lua.c Fri May 8 15:44:58 2009
@@ -28,6 +28,7 @@
#include LUAFILESYSTEM_HEADER
#include LUASOCKET_HEADER
+#include LUAPOSIX_HEADER
lua_State *get_lua_state(struct testsuite *ts, const char *test_name) {
lua_State *L = luaL_newstate();
@@ -45,6 +46,12 @@
/* load LuaSocket */
lua_pushcfunction(L, luaopen_socket_core);
+ if (lua_pcall(L, 0, 0, 0)) {
+ goto e_print_error;
+ }
+
+ /* load LuaPosix */
+ lua_pushcfunction(L, luaopen_posix);
if (lua_pcall(L, 0, 0, 0)) {
goto e_print_error;
}
Added: team/mnicholson/asttest/asttest/lua/luaposix-5.1.4.tar.gz
URL: http://svn.asterisk.org/svn-view/asterisk/team/mnicholson/asttest/asttest/lua/luaposix-5.1.4.tar.gz?view=auto&rev=193388
==============================================================================
Binary file - no diff available.
Propchange: team/mnicholson/asttest/asttest/lua/luaposix-5.1.4.tar.gz
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: team/mnicholson/asttest/asttest/tools/luaposix.diff
URL: http://svn.asterisk.org/svn-view/asterisk/team/mnicholson/asttest/asttest/tools/luaposix.diff?view=auto&rev=193388
==============================================================================
--- team/mnicholson/asttest/asttest/tools/luaposix.diff (added)
+++ team/mnicholson/asttest/asttest/tools/luaposix.diff Fri May 8 15:44:58 2009
@@ -1,0 +1,22 @@
+diff -ruN a/lposix.h b/lposix.h
+--- a/lposix.h 1969-12-31 18:00:00.000000000 -0600
++++ b/lposix.h 2009-05-08 15:32:27.000000000 -0500
+@@ -0,0 +1,6 @@
++#ifndef LPOSIX_H
++#define LPOSIX_H
++
++LUALIB_API int luaopen_posix (lua_State *L);
++
++#endif
+diff -ruN a/Makefile b/Makefile
+--- a/Makefile 2008-07-18 09:31:56.000000000 -0500
++++ b/Makefile 2009-05-08 15:15:04.000000000 -0500
+@@ -25,7 +25,7 @@
+
+ CPPFLAGS= -fPIC $(INCS) $(WARN)
+ WARN= -pedantic -Wall
+-INCS= -I$(LUAINC)
++INCS= `pkg-config --cflags lua5.1`
+
+ MYNAME= posix
+ MYLIB= $(MYNAME)
Propchange: team/mnicholson/asttest/asttest/tools/luaposix.diff
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/mnicholson/asttest/asttest/tools/luaposix.diff
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/mnicholson/asttest/asttest/tools/luaposix.diff
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the asterisk-commits
mailing list