FS-7180: add --enable-sytem-lua configure arg to allow building mod_lua against system lua and allow mod_lua to build against lua 5.1 or 5.2

This commit is contained in:
Michael Jerris 2015-01-20 11:48:00 -05:00
parent 46cf8a4dce
commit 07d09b7869
3 changed files with 17 additions and 15 deletions

View File

@ -517,6 +517,9 @@ AC_SUBST(SYS_XMLRPC_CFLAGS)
AC_SUBST(SYS_XMLRPC_LDFLAGS)
AM_CONDITIONAL([SYSTEM_XMLRPCC],[test "${enable_xmlrpcc}" = "yes"])
AC_ARG_ENABLE([system-lua],[AS_HELP_STRING([--enable-system-lua],[use system lib for lua])],,[enable_system_lua="no"])
AM_CONDITIONAL([SYSTEM_LUA],[test "${enable_system_lua}" = "yes"])
AC_ARG_ENABLE(srtp,
[AC_HELP_STRING([--disable-srtp],[build without srtp support])],[enable_srtp="$enableval"],[enable_srtp="yes"])

View File

@ -3,26 +3,22 @@ include $(top_srcdir)/build/modmake.rulesam
MODNAME=mod_lua
LUA_DIR=$(switch_srcdir)/src/mod/languages/mod_lua/lua
LIBLUA_A=$(LUA_DIR)/liblua.a
AM_CFLAGS += $(CFLAGS) -D_GNU_SOURCE
mod_LTLIBRARIES = mod_lua.la
mod_lua_la_SOURCES = mod_lua.cpp freeswitch_lua.cpp mod_lua_wrap.cpp lua/lapi.c lua/lcode.c lua/lctype.c lua/ldebug.c lua/ldo.c lua/ldump.c lua/lfunc.c lua/lgc.c lua/llex.c lua/lmem.c lua/lobject.c lua/lopcodes.c lua/lparser.c lua/lstate.c lua/lstring.c lua/ltable.c lua/ltm.c lua/lundump.c lua/lvm.c lua/lzio.c lua/lauxlib.c lua/lbaselib.c lua/lbitlib.c lua/lcorolib.c lua/ldblib.c lua/liolib.c lua/lmathlib.c lua/loslib.c lua/lstrlib.c lua/ltablib.c lua/loadlib.c lua/linit.c
mod_lua_la_SOURCES = mod_lua.cpp freeswitch_lua.cpp mod_lua_wrap.cpp
if SYSTEM_LUA
mod_lua_la_CXXFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS)
mod_lua_la_CFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS)
else
mod_lua_la_SOURCES += lua/lapi.c lua/lcode.c lua/lctype.c lua/ldebug.c lua/ldo.c lua/ldump.c lua/lfunc.c lua/lgc.c lua/llex.c lua/lmem.c lua/lobject.c lua/lopcodes.c lua/lparser.c lua/lstate.c lua/lstring.c lua/ltable.c lua/ltm.c lua/lundump.c lua/lvm.c lua/lzio.c lua/lauxlib.c lua/lbaselib.c lua/lbitlib.c lua/lcorolib.c lua/ldblib.c lua/liolib.c lua/lmathlib.c lua/loslib.c lua/lstrlib.c lua/ltablib.c lua/loadlib.c lua/linit.c
LUA_DIR=$(switch_srcdir)/src/mod/languages/mod_lua/lua
mod_lua_la_CXXFLAGS = -I$(LUA_DIR) $(AM_CPPFLAGS) -DLUA_USE_LINUX
mod_lua_la_CFLAGS = -I$(LUA_DIR) $(AM_CPPFLAGS) -DLUA_USE_LINUX
mod_lua_la_LIBADD = $(switch_builddir)/libfreeswitch.la
mod_lua_la_LDFLAGS = -avoid-version -module -no-undefined -shared -lm $(AM_LDFLAGS) $(SOLINK) #$(LIBLUA_A)
endif
#BUILT_SOURCES = $(LIBLUA_A)
#$(mod_lua_la_SOURCES) : $(BUILT_SOURCES)
#
#$(LIBLUA_A):
# cd $(LUA_DIR) && $(MAKE) CC="$(CC)" AR="$(AR) rcu" CFLAGS="$(AM_CFLAGS) -DLUA_USE_LINUX -w" liblua.a
#luaclean:
# cd $(LUA_DIR) && $(MAKE) clean
#
#allclean: clean luaclean
mod_lua_la_LIBADD = $(switch_builddir)/libfreeswitch.la
mod_lua_la_LDFLAGS = -avoid-version -module -no-undefined -shared -lm -llua $(AM_LDFLAGS) $(SOLINK)
reswig: swigclean lua_wrap

View File

@ -9,6 +9,9 @@ extern "C" {
}
#include <switch_cpp.h>
#ifndef lua_pushglobaltable
#define lua_pushglobaltable(L) lua_pushvalue(L,LUA_GLOBALSINDEX)
#endif
typedef struct{
lua_State* L;