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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Apr 1 21:40:22 CDT 2009


Author: mnicholson
Date: Wed Apr  1 21:40:18 2009
New Revision: 185948

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=185948
Log:
added the LuaFileSystem library

Added:
    team/mnicholson/asttest/asttest/lua/luafilesystem-1.4.2.tar.gz   (with props)
    team/mnicholson/asttest/asttest/tools/lfs.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.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/Makefile?view=diff&rev=185948&r1=185947&r2=185948
==============================================================================
--- team/mnicholson/asttest/asttest/Makefile (original)
+++ team/mnicholson/asttest/asttest/Makefile Wed Apr  1 21:40:18 2009
@@ -20,10 +20,12 @@
 
 .PHONY: clean dist-clean distclean test check asterisk
 
+LUAFILESYSTEM=luafilesystem-1.4.2
+
 # 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
+L_OBJS:=lua/testlib.o lua/astlib.o lua/$(LUAFILESYSTEM)/src/lfs.o
 T_LIBS:=-llua5.1
 
 AST_INSTALL_DIR = $(PWD)/asterisk
@@ -73,12 +75,23 @@
 	$(MAKE) -C ../ install
 	$(MAKE) -C ../ samples
 
-lib/lua.o: lib/lua.c include/asttest/lua.h include/asttest/testsuite.h include/asttest/lua/*.h
 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\" $<
+
 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
+
+lua/$(LUAFILESYSTEM)/src/lfs.o: lua/lfs-patched.stamp
+	$(MAKE) -C lua/$(LUAFILESYSTEM)
+
+lua/lfs-patched.stamp: lua/$(LUAFILESYSTEM).tar.gz
+	tar -C lua -zxf lua/$(LUAFILESYSTEM).tar.gz 
+	patch -p1 -d lua/$(LUAFILESYSTEM) < tools/lfs.diff
+	touch lua/lfs-patched.stamp
+
 
 asttest: asttest.c $(OBJS) $(T_OBJS) $(L_OBJS) include/asttest/asttest.h
 	$(CC) -o $@ $(OBJS) $(L_OBJS) $(T_LIBS)
@@ -96,9 +109,12 @@
 	rm -f lua/*_lua.h
 	rm -f tools/mkstring
 	rm -rf $(AST_INSTALL_DIR)
+	-$(MAKE) -C lua/$(LUAFILESYSTEM) clean
+	rm -f lua/lfs-patched.stamp
 
 dist-clean: distclean
 
 distclean: clean
 	rm -f autoconfig.h config.status config.log makeopts
 	rm -rf autom4te.cache
+	rm -rf lua/$(LUAFILESYSTEM)

Modified: team/mnicholson/asttest/asttest/lib/lua.c
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/lib/lua.c?view=diff&rev=185948&r1=185947&r2=185948
==============================================================================
--- team/mnicholson/asttest/asttest/lib/lua.c (original)
+++ team/mnicholson/asttest/asttest/lib/lua.c Wed Apr  1 21:40:18 2009
@@ -26,6 +26,8 @@
 #include "asttest/lua/astlib.h"
 #include "asttest/lua/testlib.h"
 
+#include LUAFILESYSTEM_H
+
 lua_State *get_lua_state(struct testsuite *ts, const char *test_name) {
 	lua_State *L = luaL_newstate();
 	if (!L) {
@@ -33,6 +35,12 @@
 	}
 
 	luaL_openlibs(L);
+
+	/* luad LuaFileSystem */
+	lua_pushcfunction(L, luaopen_lfs);
+	if (lua_pcall(L, 0, 0, 0)) {
+		goto e_print_error;
+	}
 
 	/* load the test lib */
 	lua_pushcfunction(L, luaopen_testlib);

Added: team/mnicholson/asttest/asttest/lua/luafilesystem-1.4.2.tar.gz
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/lua/luafilesystem-1.4.2.tar.gz?view=auto&rev=185948
==============================================================================
Binary file - no diff available.

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

Added: team/mnicholson/asttest/asttest/tools/lfs.diff
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/tools/lfs.diff?view=auto&rev=185948
==============================================================================
--- team/mnicholson/asttest/asttest/tools/lfs.diff (added)
+++ team/mnicholson/asttest/asttest/tools/lfs.diff Wed Apr  1 21:40:18 2009
@@ -1,0 +1,13 @@
+diff -ru a/config b/config
+--- a/config	2007-10-27 17:42:32.000000000 -0500
++++ b/config	2009-04-01 20:18:09.000000000 -0500
+@@ -18,7 +18,8 @@
+ # Compilation directives
+ WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedantic
+ INCS= -I$(LUA_INC)
+-CFLAGS= $(WARN) $(INCS)
++LUA_CFLAGS=`pkg-config --cflags lua5.1`
++CFLAGS= $(WARN) $(LUA_CFLAGS)
+ CC= gcc
+ 
+ # $Id$

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

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

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




More information about the asterisk-commits mailing list