Files
freeswitch/src/mod/languages/mod_lua/Makefile.am
T
Dmitry Verenitsin 153c3a5139 [mod_lua] Move SWIG wrapper patches into ".i" typemaps, drop hack.diff (#3043)
A swig 4.1 regeneration dropped several hand-patched wrapper edits.
Express them (and the rest) as SWIG typemaps in `freeswitch.i` so they
survive reswig. `make reswig` now produces the final wrapper directly;
`hack.diff` and its `patch` step are removed.

Restored regressions:
- `setLUA(L)` on returned `Session`: a hangup hook or input callback on
a script-created `freeswitch.Session()` no longer crashes the process
- binary-safe `Stream::read` (`lua_pushlstring`)

Also moved to typemaps:
- `Dbh`/`JSON` self-pointer guards (`%typemap(check)`), now covering
every wrapper including four the hand-patch missed
- type-table isolation (`#define SWIG_TYPE_TABLE mod_lua`)
2026-05-28 01:34:53 +03:00

40 lines
1.4 KiB
Makefile

VERBOSE=1
include $(top_srcdir)/build/modmake.rulesam
MODNAME=mod_lua
AM_CFLAGS += $(CFLAGS) -D_GNU_SOURCE
noinst_LTLIBRARIES = libluamod.la
libluamod_la_SOURCES = mod_lua.cpp freeswitch_lua.cpp mod_lua_wrap.cpp
libluamod_la_CXXFLAGS = $(AM_CPPFLAGS) $(LUA_CFLAGS) $(CPPFLAGS)
libluamod_la_CFLAGS = $(AM_CPPFLAGS) $(LUA_CFLAGS) $(CPPFLAGS)
mod_LTLIBRARIES = mod_lua.la
mod_lua_la_SOURCES = mod_lua.cpp freeswitch_lua.cpp mod_lua_wrap.cpp
mod_lua_la_CXXFLAGS = $(AM_CPPFLAGS) $(LUA_CFLAGS) $(CPPFLAGS)
mod_lua_la_CFLAGS = $(AM_CPPFLAGS) $(LUA_CFLAGS) $(CPPFLAGS)
mod_lua_la_LIBADD = $(switch_builddir)/libfreeswitch.la
mod_lua_la_LDFLAGS = -avoid-version -module -no-undefined -shared -lm $(AM_LDFLAGS) $(SOLINK) $(LUA_LIBS)
reswig: swigclean mod_lua_wrap.cpp
swigclean: clean
rm -f mod_lua_wrap.*
mod_lua_wrap.cpp: mod_lua_extra.c
swig -lua -c++ -I../../../../src/include -oh mod_lua_wrap.h -o mod_lua_wrap.cpp freeswitch.i
echo "#include \"mod_lua_extra.c\"" >> mod_lua_wrap.cpp
noinst_PROGRAMS = test/test_mod_lua
test_test_mod_lua_SOURCES = test/test_mod_lua.c
test_test_mod_lua_CFLAGS = $(AM_CFLAGS) -I. -DSWITCH_TEST_BASE_DIR_FOR_CONF=\"${abs_builddir}/test\" -DSWITCH_TEST_BASE_DIR_OVERRIDE=\"${abs_builddir}/test\"
test_test_mod_lua_LDFLAGS = $(AM_LDFLAGS) -avoid-version -no-undefined $(freeswitch_LDFLAGS) $(switch_builddir)/libfreeswitch.la $(CORE_LIBS) $(APR_LIBS)
test_test_mod_lua_LDADD = libluamod.la $(LUA_LIBS)
TESTS = $(noinst_PROGRAMS)