[Build-system] Use swig 4.1

This commit is contained in:
Andrey Volk
2025-07-09 13:18:29 +03:00
parent 9d69bd607b
commit 9dc471ba1e
14 changed files with 28 additions and 61 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ CLASSES=org/freeswitch/esl/*
all: esl.jar
esl_wrap.cpp:
swig3.0 -module esl -java -c++ $(LOCAL_CFLAGS) -package org.freeswitch.esl -outdir org/freeswitch/esl -o esl_wrap.cpp ../ESL.i
swig -module esl -java -c++ $(LOCAL_CFLAGS) -package org.freeswitch.esl -outdir org/freeswitch/esl -o esl_wrap.cpp ../ESL.i
esl_wrap.o: esl_wrap.cpp
$(CXX) $(CXX_CFLAGS) $(LOCAL_CFLAGS) $(CXXFLAGS) $(GCC_WARNING_JUNK) $(PERL_INC) -c esl_wrap.cpp -o esl_wrap.o
+1 -1
View File
@@ -5,7 +5,7 @@ WRAP_GCC_WARNING_SILENCE=-Wno-unused-function
all: ESL.so
esl_wrap.cpp:
swig3.0 -module ESL -lua -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
swig -module ESL -lua -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
esl_wrap.o: esl_wrap.cpp
$(CXX) $(CXX_CFLAGS) $(LUA_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) $(WRAP_GCC_WARNING_SILENCE) -c esl_wrap.cpp -o esl_wrap.o
+1 -1
View File
@@ -5,7 +5,7 @@ WRAP_GCC_WARNING_SILENCE=-Wno-unused-function
all: ESL.so
esl_wrap.cpp:
swig3.0 -module ESL -csharp -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
swig -module ESL -csharp -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
esl_wrap.o: esl_wrap.cpp
$(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) $(WRAP_GCC_WARNING_SILENCE) -c esl_wrap.cpp -o esl_wrap.o
+1 -1
View File
@@ -21,7 +21,7 @@ endif
$(MAKE) -C ..
esl_wrap.cpp:
swig3.0 -module ESL -shadow -perl5 -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
swig -module ESL -shadow -perl5 -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
perlxsi.c:
$(PERL) -MExtUtils::Embed -e xsinit -- -o perlxsi.c
+1 -1
View File
@@ -3,7 +3,7 @@ WRAP_GCC_WARNING_SILENCE=-Wno-unused-label -Wno-unused-function
all: ESL.so
esl_wrap.cpp:
swig3.0 -module ESL -php7 -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
swig -module ESL -php7 -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
sed -e 's/ char \*type_name;/ const char \*type_name;/' -i esl_wrap.cpp
esl_wrap.o: esl_wrap.cpp
+1 -1
View File
@@ -5,7 +5,7 @@ SITE_DIR=$(DESTDIR)/`$(PYTHON3) -c "from distutils.sysconfig import get_python_l
all: _ESL.so
esl_wrap.cpp:
swig3.0 -module ESL -classic -python -c++ -DMULTIPLICITY -threads -I../src/include -o esl_wrap.cpp ../ESL.i
swig -module ESL -classic -python -c++ -DMULTIPLICITY -threads -I../src/include -o esl_wrap.cpp ../ESL.i
esl_wrap.o: esl_wrap.cpp
$(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) -c esl_wrap.cpp -o esl_wrap.o
+1 -1
View File
@@ -6,7 +6,7 @@ RUBY_GEM_DIR=$(shell $(RUBY) -e 'puts RbConfig::CONFIG["rubylibdir"]')
all: ESL.so
esl_wrap.cpp:
swig3.0 -module ESL -ruby -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
swig -module ESL -ruby -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
esl_wrap.o: esl_wrap.cpp
$(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) -c esl_wrap.cpp -o esl_wrap.o
+1 -1
View File
@@ -5,7 +5,7 @@ WRAP_GCC_WARNING_SILENCE=-Wno-unused-function
all: ESL.so
esl_wrap.cpp:
swig3.0 -module ESL -tcl -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
swig -module ESL -tcl -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
esl_wrap.o: esl_wrap.cpp
$(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) $(WRAP_GCC_WARNING_SILENCE) -c esl_wrap.cpp -o esl_wrap.o
+1 -1
View File
@@ -28,7 +28,7 @@ freeswitch.jar: classes
reswig:
rm -f switch_swig_wrap.cpp
swig3.0 -java -c++ -I../../../include -package org.freeswitch.swig -outdir src/org/freeswitch/swig -o switch_swig_wrap.cpp mod_java.i
swig -java -c++ -I../../../include -package org.freeswitch.swig -outdir src/org/freeswitch/swig -o switch_swig_wrap.cpp mod_java.i
install-data-local:
cp freeswitch.jar $(DESTDIR)@scriptdir@
+1 -1
View File
@@ -25,7 +25,7 @@ swigclean: clean
rm -f mod_lua_wrap.*
mod_lua_wrap.cpp: mod_lua_extra.c
swig3.0 -lua -c++ -I../../../../src/include -oh mod_lua_wrap.h -o mod_lua_wrap.cpp freeswitch.i
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
patch -s -p0 -i hack.diff
+1 -1
View File
@@ -39,7 +39,7 @@ swigclean: clean
rm -f freeswitch_wrap.cxx managed/swig.cs
freeswitch_wrap.cxx:
swig3.0 -I../../../include -v -O -c++ -csharp -namespace FreeSWITCH.Native -dllimport mod_managed -DSWIG_CSHARP_NO_STRING_HELPER freeswitch.i
swig -I../../../include -v -O -c++ -csharp -namespace FreeSWITCH.Native -dllimport mod_managed -DSWIG_CSHARP_NO_STRING_HELPER freeswitch.i
rm -f ./managed/swig.cs
cat *.cs > ./managed/swig.cs
rm -f *.cs
+1 -1
View File
@@ -23,7 +23,7 @@ swigclean: clean
rm -f mod_perl_wrap.* freeswitch.so freeswitch.pm
mod_perl_wrap.cpp:
swig3.0 -static -shadow -perl5 -c++ -DMULTIPLICITY -I../../../../src/include -o mod_perl_wrap.cpp freeswitch.i
swig -static -shadow -perl5 -c++ -DMULTIPLICITY -I../../../../src/include -o mod_perl_wrap.cpp freeswitch.i
echo "#include \"mod_perl_extra.c\"" >> mod_perl_wrap.cpp
patch -s -p0 -i hack.diff
+1 -1
View File
@@ -20,7 +20,7 @@ swigclean: clean
rm -f mod_python_wrap.* freeswitch.py
mod_python_wrap.cpp: mod_python_extra.c hack.diff
swig3.0 -python -c++ -I../../../../src/include -oh mod_python_wrap.h -o mod_python_wrap.cpp mod_python.i
swig -python -c++ -I../../../../src/include -oh mod_python_wrap.h -o mod_python_wrap.cpp mod_python.i
echo "#include \"mod_python_extra.c\"" >> mod_python_wrap.cpp
patch -s -p0 -i hack.diff
+15 -48
View File
@@ -1,6 +1,6 @@
--- mod_python_wrap.cpp.old 2015-06-16 12:56:23.868000000 -0500
+++ mod_python_wrap.cpp 2015-06-16 12:56:32.268000000 -0500
@@ -3500,7 +3500,9 @@ SWIG_AsCharArray(PyObject * obj, char *val, size_t size)
--- mod_python_wrap.cpp.old 2024-11-08 21:22:49.064934340 +0000
+++ mod_python_wrap.cpp 2024-11-12 13:45:20.822756877 +0000
@@ -3492,7 +3492,9 @@
if (csize <= size) {
if (val) {
if (csize) memcpy(val, cptr, csize*sizeof(char));
@@ -10,16 +10,16 @@
}
if (alloc == SWIG_NEWOBJ) {
delete[] cptr;
@@ -4677,7 +4677,7 @@ SWIGINTERN PyObject *_wrap_DTMF_digit_set(PyObject *SWIGUNUSEDPARM(self), PyObje
@@ -4689,7 +4691,7 @@
char arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
- char val2 ;
+ char val2 = '\0';
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
@@ -4787,7 +4787,7 @@ SWIGINTERN PyObject *_wrap_new_DTMF(PyObject *SWIGUNUSEDPARM(self), PyObject *ar
PyObject *swig_obj[2] ;
@@ -4799,7 +4801,7 @@
PyObject *resultobj = 0;
char arg1 ;
uint32_t arg2 = (uint32_t) SWITCH_DEFAULT_DTMF_DURATION ;
@@ -28,7 +28,7 @@
int ecode1 = 0 ;
void *argp2 ;
int res2 = 0 ;
@@ -6198,7 +6198,9 @@
@@ -6371,7 +6373,9 @@
}
arg3 = static_cast< int >(val3);
}
@@ -38,31 +38,16 @@
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Event, SWIG_POINTER_OWN | 0 );
return resultobj;
fail:
@@ -9264,20 +9266,20 @@
}
-SWIGINTERN PyObject *_wrap_new_Session__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_Session__SWIG_0(PyObject *self, PyObject *args) {
PyObject *resultobj = 0;
PYTHON::Session *result = 0 ;
@@ -9779,7 +9783,7 @@
if (!PyArg_ParseTuple(args,(char *)":new_Session")) SWIG_fail;
if ((nobjs < 0) || (nobjs > 0)) SWIG_fail;
result = (PYTHON::Session *)new PYTHON::Session();
- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PYTHON__Session, SWIG_POINTER_NEW | 0 );
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PYTHON__Session, SWIG_POINTER_NEW | 0 ); result->setPython(self);
return resultobj;
fail:
return NULL;
}
-SWIGINTERN PyObject *_wrap_new_Session__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_Session__SWIG_1(PyObject *self, PyObject *args) {
PyObject *resultobj = 0;
char *arg1 = (char *) 0 ;
CoreSession *arg2 = (CoreSession *) 0 ;
@@ -9302,7 +9304,7 @@
@@ -9809,7 +9813,7 @@
}
arg2 = reinterpret_cast< CoreSession * >(argp2);
result = (PYTHON::Session *)new PYTHON::Session(arg1,arg2);
@@ -71,16 +56,7 @@
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
return resultobj;
fail:
@@ -9311,7 +9313,7 @@
}
-SWIGINTERN PyObject *_wrap_new_Session__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_Session__SWIG_2(PyObject *self, PyObject *args) {
PyObject *resultobj = 0;
char *arg1 = (char *) 0 ;
int res1 ;
@@ -9327,7 +9329,7 @@
@@ -9833,7 +9837,7 @@
}
arg1 = reinterpret_cast< char * >(buf1);
result = (PYTHON::Session *)new PYTHON::Session(arg1);
@@ -89,16 +65,7 @@
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
return resultobj;
fail:
@@ -9336,7 +9338,7 @@
}
-SWIGINTERN PyObject *_wrap_new_Session__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_Session__SWIG_3(PyObject *self, PyObject *args) {
PyObject *resultobj = 0;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
void *argp1 = 0 ;
@@ -9351,7 +9353,7 @@
@@ -9856,7 +9860,7 @@
}
arg1 = reinterpret_cast< switch_core_session_t * >(argp1);
result = (PYTHON::Session *)new PYTHON::Session(arg1);
@@ -107,11 +74,11 @@
return resultobj;
fail:
return NULL;
@@ -10492,6 +10492,7 @@ SWIGINTERN PyObject *_wrap_Session_setSelf(PyObject *SWIGUNUSEDPARM(self), PyObj
@@ -10520,6 +10524,7 @@
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_setSelf" "', argument " "1"" of type '" "PYTHON::Session *""'");
}
arg1 = reinterpret_cast< PYTHON::Session * >(argp1);
+ if (!arg1) SWIG_exception_fail(SWIG_ValueError, "in method '" "Session_setSelf" "', argument " "1"" is NULL");
arg2 = obj1;
arg2 = swig_obj[1];
(arg1)->setSelf(arg2);
resultobj = SWIG_Py_Void();