1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-27 21:16:50 +03:00

added lua bindings

git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@98 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
cameronrich 2007-05-25 06:04:58 +00:00
parent 4d8f9ddf2c
commit db9b72d4dd
4 changed files with 93 additions and 1 deletions

View File

@ -86,4 +86,20 @@ config CONFIG_PERL_LIB
default "perl58.lib"
endmenu
config CONFIG_LUA_BINDINGS
bool "Create Lua bindings"
default n
depends on CONFIG_BINDINGS && !CONFIG_PLATFORM_WIN32
help
Build Lua bindings (see www.lua.org).
menu "Lua Home"
depends on CONFIG_LUA_BINDINGS
config CONFIG_LUA_CORE
string "Location of Lua CORE"
default "/usr/local"
help:
If the Lua exists on another directory then this needs to be changed
endmenu
endmenu

View File

@ -37,6 +37,10 @@ ifdef CONFIG_PERL_BINDINGS
all: perl/axTLSp_wrap.c
endif
ifdef CONFIG_LUA_BINDINGS
all: lua/axTLSl_wrap.c
endif
csharp/axInterface.cs: ../ssl/ssl.h
@perl ./generate_interface.pl -csharp
@ -55,9 +59,16 @@ perl/axTLSp.i: ../ssl/ssl.h
perl/axTLSp_wrap.c: perl/axTLSp.i
@cd perl; swig -perl5 axTLSp.i; $(MAKE)
lua/axTLSl.i: ../ssl/ssl.h
@perl ./generate_SWIG_interface.pl -lua
lua/axTLSl_wrap.c: lua/axTLSl.i
@cd lua; swig -lua axTLSl.i; $(MAKE)
clean::
$(MAKE) -C csharp clean
$(MAKE) -C vbnet clean
$(MAKE) -C java clean
$(MAKE) -C perl clean
$(MAKE) -C lua clean

View File

@ -121,10 +121,16 @@ elsif ($ARGV[0] eq "-perl")
$module = "axtlsp";
$interfaceFile = "perl/axTLSp.i";
}
elsif ($ARGV[0] eq "-lua")
{
print "Generating lua interface file\n";
$module = "axtlsl";
$interfaceFile = "lua/axTLSl.i";
}
else
{
ouch:
die "Usage: $0 [-java | -perl]\n";
die "Usage: $0 [-java | -perl | -lua]\n";
}
# Input file required to generate SWIG interface file.
@ -313,6 +319,10 @@ JNIEXPORT jint JNICALL Java_axTLSj_axtlsjJNI_getFd(JNIEnv *env, jclass jcls, job
#endif
/* Some SWIG magic to make the API a bit more Lua friendly */
#ifdef SWIGLUA
#endif
END
# Initialise loop variables

55
bindings/lua/Makefile Normal file
View File

@ -0,0 +1,55 @@
#
# Copyright(C) 2007 Cameron Rich
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
include ../../config/.config
include ../../config/makefile.conf
all: lib
ifdef CONFIG_PLATFORM_WIN32
TARGET=../../$(STAGE)/axtlsl.dll
else
TARGET=../../$(STAGE)/libaxtlsl.so
endif
ifneq ($(MAKECMDGOALS), clean)
lib: $(TARGET)
AXTLS_HOME=../..
SSL_HOME=$(AXTLS_HOME)/ssl
CONFIG_HOME=$(AXTLS_HOME)/config
OBJ:=axTLSl_wrap.o
include ../../config/makefile.post
$(TARGET) : $(OBJ)
$(LD) $(LDFLAGS) -L ../../$(STAGE) -L $(CONFIG_LUA_CORE)/lib $(LDSHARED) -o $@ $(OBJ) -laxtls -llua
ifdef CONFIG_PLATFORM_CYGWIN
cd ../../$(STAGE); ln -sf $(notdir $@) axtlsl.dll
endif
CFLAGS += -I$(CONFIG_HOME) -I$(SSL_HOME) -I $(CONFIG_LUA_CORE)/include
else
CFLAGS += /I"`cygpath -w $(CONFIG_HOME)`" /I"`cygpath -w $(SSL_HOME)`" /I"`cygpath -w $(CONFIG_LUA_CORE)/include`"
LDFLAGS += axtls.lib /libpath:"../../$(STAGE)"
$(TARGET) : $(OBJ)
$(LD) $(LDFLAGS) $(LDSHARED) /out:$@ $(OBJ)
endif # WIN32
clean::
@rm -f $(TARGET) *.i axTLSl* .depend