prep for CentOS 7, updated autoconf/automake/libtool/libltdl stuff

This commit is contained in:
Thomas Ries 2017-05-28 13:21:53 +00:00
parent ce9672cb29
commit 20dd89d07c
10 changed files with 6692 additions and 3848 deletions

View File

@ -1,5 +1,8 @@
0.8.3dev
========
28-May-2017: - updated autogen/automake/libtool/libltdl to a recent
version. Personal note: libtool/libltr is a steaming
pile of fertilizer - a voodoo driven toolbox
16-Apr-2017: - plugin_blacklist: new plugin to block UACs that cause
excessive failures durign REGISTER attempts.
27-Feb-2017: - improved memory behavior of some plugins during shutdown

View File

@ -19,11 +19,10 @@
#
if use_convenience_ltdl
OPT_LTDL_DIR = libltdl
endif
OPT_LTDL_DIR = libltdl
SUBDIRS = $(OPT_LTDL_DIR) src doc scripts contrib
INCLUDES = $(LTDLINCL)
#&&&INCLUDES = $(LTDLINCL)
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = TODO RELNOTES siproxd.spec autogen.sh

View File

@ -337,14 +337,15 @@ AC_MSG_CHECKING(libosip2 version > 3.0.0)
dnl check if contacts member is a structure with nb_elt (ok) or a
dnl pointer to the structure (bad)
AC_COMPILE_IFELSE([
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([
#include <osipparser2/osip_parser.h>
main() {
osip_message_t t;
int e;
e=t.contacts.nb_elt;
}
],acx_check_libosip_version=ok, )
])],acx_check_libosip_version=ok, )
if test $acx_check_libosip_version = fail; then
echo "*** ERROR: libosip2-3.x.x is required!";exit 1;

View File

@ -1,7 +1,7 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
test -f configure.in || {
test -f configure.ac || {
echo "**Error**: This directory does not look like the top-level directory"
exit 1
}

View File

@ -1,4 +1,4 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* use custom firewall control module */
#undef CUSTOM_FWMODULE
@ -6,6 +6,30 @@
/* Define to 1 if you have the `accept' function. */
#undef HAVE_ACCEPT
/* Define to 1 if you have the `argz_add' function. */
#undef HAVE_ARGZ_ADD
/* Define to 1 if you have the `argz_append' function. */
#undef HAVE_ARGZ_APPEND
/* Define to 1 if you have the `argz_count' function. */
#undef HAVE_ARGZ_COUNT
/* Define to 1 if you have the `argz_create_sep' function. */
#undef HAVE_ARGZ_CREATE_SEP
/* Define to 1 if you have the <argz.h> header file. */
#undef HAVE_ARGZ_H
/* Define to 1 if you have the `argz_insert' function. */
#undef HAVE_ARGZ_INSERT
/* Define to 1 if you have the `argz_next' function. */
#undef HAVE_ARGZ_NEXT
/* Define to 1 if you have the `argz_stringify' function. */
#undef HAVE_ARGZ_STRINGIFY
/* Define to 1 if you have the <arpa/nameser.h> header file. */
#undef HAVE_ARPA_NAMESER_H
@ -15,15 +39,43 @@
/* Define to 1 if you have the `chroot' function. */
#undef HAVE_CHROOT
/* Define to 1 if you have the `closedir' function. */
#undef HAVE_CLOSEDIR
/* Define to 1 if you have the declaration of `cygwin_conv_path', and to 0 if
you don't. */
#undef HAVE_DECL_CYGWIN_CONV_PATH
/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define if you have the GNU dld library. */
#undef HAVE_DLD
/* Define to 1 if you have the <dld.h> header file. */
#undef HAVE_DLD_H
/* Define to 1 if you have the `dlerror' function. */
#undef HAVE_DLERROR
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <dl.h> header file. */
#undef HAVE_DL_H
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#undef HAVE_DOPRNT
/* Define if you have the _dyld_func_lookup function. */
#undef HAVE_DYLD
/* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
/* Define to 1 if the system has the type `error_t'. */
#undef HAVE_ERROR_T
/* Define to 1 if you have the `fcntl' function. */
#undef HAVE_FCNTL
@ -78,6 +130,12 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define if you have the libdl library or equivalent. */
#undef HAVE_LIBDL
/* Define if libdlloader will be built on this platform */
#undef HAVE_LIBDLLOADER
/* Define to 1 if you have the `osip2' library (-losip2). */
#undef HAVE_LIBOSIP2
@ -90,6 +148,9 @@
/* Define to 1 if you have the `listen' function. */
#undef HAVE_LISTEN
/* Define this if a modern libltdl is already installed */
#undef HAVE_LTDL
/* Define to 1 if you have the `lt_dlclose' function. */
#undef HAVE_LT_DLCLOSE
@ -99,15 +160,24 @@
/* Define to 1 if you have the `lt_dlsym' function. */
#undef HAVE_LT_DLSYM
/* Define to 1 if you have the <mach-o/dyld.h> header file. */
#undef HAVE_MACH_O_DYLD_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
/* Define to 1 if you have the `opendir' function. */
#undef HAVE_OPENDIR
/* Define to 1 if you have the `osip_MD5Init' function. */
#undef HAVE_OSIP_MD5INIT
/* Define if libtool can extract symbol lists from object files. */
#undef HAVE_PRELOADED_SYMBOLS
/* Define if you have POSIX threads libraries and header files. */
#undef HAVE_PTHREAD
@ -120,6 +190,9 @@
/* Define to 1 if you have the `read' function. */
#undef HAVE_READ
/* Define to 1 if you have the `readdir' function. */
#undef HAVE_READDIR
/* Define to 1 if you have the <resolv.h> header file. */
#undef HAVE_RESOLV_H
@ -147,6 +220,9 @@
/* Define to 1 if you have the `setuid' function. */
#undef HAVE_SETUID
/* Define if you have the shl_load function. */
#undef HAVE_SHL_LOAD
/* Define to 1 if you have the `socket' function. */
#undef HAVE_SOCKET
@ -183,6 +259,12 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strlcat' function. */
#undef HAVE_STRLCAT
/* Define to 1 if you have the `strlcpy' function. */
#undef HAVE_STRLCPY
/* Define to 1 if you have the `strncpy' function. */
#undef HAVE_STRNCPY
@ -192,6 +274,9 @@
/* Define to 1 if you have the `syslog' function. */
#undef HAVE_SYSLOG
/* Define to 1 if you have the <sys/dl.h> header file. */
#undef HAVE_SYS_DL_H
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
@ -219,6 +304,41 @@
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* This value is set to 1 to indicate that the system argz facility works */
#undef HAVE_WORKING_ARGZ
/* Define if the OS needs help to load dependent libraries for dlopen(). */
#undef LTDL_DLOPEN_DEPLIBS
/* lt_preloaded_symbols undefined */
#undef LTDL_FIX2
/* Define to the system default library search path. */
#undef LT_DLSEARCH_PATH
/* The archive extension */
#undef LT_LIBEXT
/* The archive prefix */
#undef LT_LIBPREFIX
/* Define to the extension used for runtime loadable modules, say, ".so". */
#undef LT_MODULE_EXT
/* Define to the name of the environment variable that determines the run-time
module search path. */
#undef LT_MODULE_PATH_VAR
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Define to the shared library suffix, say, ".dylib". */
#undef LT_SHARED_EXT
/* Define if dlsym() requires a leading underscore in symbol names. */
#undef NEED_USCORE
/* Name of package */
#undef PACKAGE
@ -234,6 +354,9 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
@ -295,9 +418,15 @@
/* building on unknown platform */
#undef _UNKNOWN
/* Define so that glibc/gnulib argp.h does not typedef error_t. */
#undef __error_t_defined
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to a type to use for `error_t' if it is not otherwise available. */
#undef error_t
/* function osip_MD5Final */
#undef osip_MD5Final
@ -310,7 +439,7 @@
/* type osip_MD5_CTX */
#undef osip_MD5_CTX
/* Define to `unsigned' if <sys/types.h> does not define. */
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
/* typedef socklen_t available */

View File

@ -54,33 +54,23 @@ dnl 09-Jan-2011 tries use CFLAGS -Wall only with GCC compiler
dnl 15-Sep-2011 tries added --with-included-libtool to force the
dnl use of the included libltdl
dnl 17-Jul-2015 tries added --with-ltdl-fix
dnl 28-May-2017 tries going for CentOS7 as development platform,
dnl lots of cleanup needed for autoconf (2.69),
dnl automake (1.13.4), libtool/libltdl (2.4.2)
dnl
dnl
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/siproxd.c)
dnl ******************************************************************
dnl Version Number
AC_INIT([siproxd], [0.8.3dev])
dnl
dnl Release Version
dnl
SPD_MAJOR_VERSION=0
SPD_MINOR_VERSION=8
SPD_MICRO_VERSION=3dev
SPD_VERSION=$SPD_MAJOR_VERSION.$SPD_MINOR_VERSION.$SPD_MICRO_VERSION
dnl *********************************************************************
dnl
dnl Initialize automake stuff
dnl
dnl Initialize autoconf / automake stuff
AC_CONFIG_SRCDIR([src/siproxd.c])
AC_CONFIG_AUX_DIR(scripts)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(siproxd, $SPD_VERSION)
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
dnl
@ -133,54 +123,39 @@ dnl **********************************************
dnl
dnl We require the ltdl (libtool portable dynamic loader)
dnl for our plugins. As this would require the automake/libtool
dnl packages to be present we include that library with
dnl packages to be present we optinally include that library with
dnl the siproxd package as so called "convenience library"
dnl
AC_CHECK_LIB(ltdl, lt_dlopen, [
echo "Good: native libltdl found, using it.";
use_native_ltdl="yes";
],[
echo "*** WARNING: no native libltdl found, using convenience libltdl!";
use_native_ltdl="no";
],)
dnl Configure libtool
AC_PROG_LIBTOOL
LT_CONFIG_LTDL_DIR([libltdl])
LT_INIT([dlopen])
LTDL_INIT([recursive])
AC_CONFIG_FILES([libltdl/Makefile])
AC_ARG_WITH(included-libtool,
[ --with-included-libtool force the use of included libltdl (libtool)],
use_native_ltdl="no";echo "*** FORCED to use included convenience libltdl",
)
AC_MSG_CHECKING(using system provided libltdl)
if test yes = "$with_included_ltdl"; then
AC_MSG_RESULT([no, using included libltdl])
echo "*** WARNING: using convenience libltdl!";
else
AC_MSG_RESULT([yes, using system provided libltdl])
fi
if test yes != "$with_included_ltdl"; then
AC_ARG_WITH(ltdl-fix,
[ --with-ltdl-fix work around broken ltdl versions (fix linking
error "undefined reference to lt__PROGRAM..."],
AC_DEFINE(WITH_LTDL_FIX,,[ltdl workaround for undefined reference linking error]),
)
if test "x$use_native_ltdl" = "xno"; then
AC_LIBLTDL_CONVENIENCE
AM_CONDITIONAL(use_convenience_ltdl,true)
else
AM_CONDITIONAL(use_convenience_ltdl,false)
fi
dnl
dnl Check for dlopen support
AC_LIBTOOL_DLOPEN
dnl
dnl Configure libtool
AC_PROG_LIBTOOL
dnl
dnl Substitute LTDLINCL and LIBLTDL in the Makefiles
dnl this is only done if no native libltdl is found.
if test "x$use_native_ltdl" = "xyes"; then
true;
LIBS="$LIBS -lltdl";
else
true;
AC_SUBST(LTDLINCL)
AC_SUBST(LIBLTDL)
fi
AC_CONFIG_SUBDIRS(libltdl)
AC_CHECK_DECL(lt_preloaded_symbols,,[AC_DEFINE(LTDL_FIX2,,[lt_preloaded_symbols undefined])],
[[$ac_includes_default]
[#include <ltdl.h>]
]
)
dnl **********************************************

File diff suppressed because it is too large Load Diff

View File

@ -19,14 +19,12 @@
#
if use_convenience_ltdl
LTDLDEF = -DLTDL_CONVLIB
endif
AM_CFLAGS = -D_GNU_SOURCE $(LTDLDEF) \
-Werror-implicit-function-declaration \
-DBUILDSTR="\"`cat .buildno`\"" \
-DBUILDDATE="\"`date -u '+%Y-%m-%dT%H:%M:%S'`\""
#&&&INCLUDES = $(LTDLINCL)
AM_CPPFLAGS = $(LTDLINCL)
#
# Plugin modules, installed in "pkglib" directory ($prefix/lib/siproxd/)
@ -64,50 +62,50 @@ DLOPENPLUGINS = -dlopen plugin_demo.la \
-dlopen plugin_blacklist.la
#
plugin_demo_la_SOURCES = plugin_demo.c
plugin_demo_la_LDFLAGS = -module -avoid-version -shrext '.so'
plugin_demo_la_LDFLAGS = -module -avoid-version -shared -export-dynamic -shrext '.so'
#
plugin_shortdial_la_SOURCES = plugin_shortdial.c
plugin_shortdial_la_LDFLAGS = -module -avoid-version -shrext '.so'
plugin_shortdial_la_LDFLAGS = -module -avoid-version -shared -export-dynamic -shrext '.so'
#
plugin_logcall_la_SOURCES = plugin_logcall.c
plugin_logcall_la_LDFLAGS = -module -avoid-version -shrext '.so'
plugin_logcall_la_LDFLAGS = -module -avoid-version -shared -export-dynamic -shrext '.so'
#
plugin_defaulttarget_la_SOURCES = plugin_defaulttarget.c
plugin_defaulttarget_la_LDFLAGS = -module -avoid-version -shrext '.so'
plugin_defaulttarget_la_LDFLAGS = -module -avoid-version -shared -export-dynamic -shrext '.so'
#
plugin_fix_bogus_via_la_SOURCES = plugin_fix_bogus_via.c
plugin_fix_bogus_via_la_LDFLAGS = -module -avoid-version -shrext '.so'
plugin_fix_bogus_via_la_LDFLAGS = -module -avoid-version -shared -export-dynamic -shrext '.so'
#
plugin_fix_DTAG_la_SOURCES = plugin_fix_DTAG.c
plugin_fix_DTAG_la_LDFLAGS = -module -avoid-version -shrext '.so'
plugin_fix_DTAG_la_LDFLAGS = -module -avoid-version -shared -export-dynamic -shrext '.so'
#
plugin_stun_la_SOURCES = plugin_stun.c
plugin_stun_la_LDFLAGS = -module -avoid-version -shrext '.so'
plugin_stun_la_LDFLAGS = -module -avoid-version -shared -export-dynamic -shrext '.so'
#
plugin_prefix_la_SOURCES = plugin_prefix.c
plugin_prefix_la_LDFLAGS = -module -avoid-version -shrext '.so'
plugin_prefix_la_LDFLAGS = -module -avoid-version -shared -export-dynamic -shrext '.so'
#
plugin_regex_la_SOURCES = plugin_regex.c
plugin_regex_la_LDFLAGS = -module -avoid-version -shrext '.so'
plugin_regex_la_LDFLAGS = -module -avoid-version -shared -export-dynamic -shrext '.so'
#
plugin_codecfilter_la_SOURCES = plugin_codecfilter.c
plugin_codecfilter_la_LDFLAGS = -module -avoid-version -shrext '.so'
plugin_codecfilter_la_LDFLAGS = -module -avoid-version -shared -export-dynamic -shrext '.so'
#
plugin_stripheader_la_SOURCES = plugin_stripheader.c
plugin_stripheader_la_LDFLAGS = -module -avoid-version -shrext '.so'
plugin_stripheader_la_LDFLAGS = -module -avoid-version -shared -export-dynamic -shrext '.so'
#
plugin_siptrunk_la_SOURCES = plugin_siptrunk.c
plugin_siptrunk_la_LDFLAGS = -module -avoid-version -shrext '.so'
plugin_siptrunk_la_LDFLAGS = -module -avoid-version -shared -export-dynamic -shrext '.so'
#
plugin_fix_fbox_anoncall_la_SOURCES = plugin_fix_fbox_anoncall.c
plugin_fix_fbox_anoncall_la_LDFLAGS = -module -avoid-version -shrext '.so'
plugin_fix_fbox_anoncall_la_LDFLAGS = -module -avoid-version -shared -export-dynamic -shrext '.so'
#
plugin_stats_la_SOURCES = plugin_stats.c
plugin_stats_la_LDFLAGS = -module -avoid-version -shrext '.so'
plugin_stats_la_LDFLAGS = -module -avoid-version -shared -export-dynamic -shrext '.so'
#
plugin_blacklist_la_SOURCES = plugin_blacklist.c
plugin_blacklist_la_LDFLAGS = -module -avoid-version -shrext '.so' -lsqlite3
plugin_blacklist_la_LDFLAGS = -module -avoid-version -shared -export-dynamic -shrext '.so'
plugin_blacklist_la_LIBADD = -lsqlite3
#
# Siproxd itself
@ -115,8 +113,9 @@ plugin_blacklist_la_LDFLAGS = -module -avoid-version -shrext '.so' -lsqlite3
# else Cygwin goes beserk when building...)
#
sbin_PROGRAMS = siproxd
siproxd_LDFLAGS=-export-dynamic
siproxd_LDADD = $(LIBLTDL) $(DLOPENPLUGINS)
siproxd_LDFLAGS = -export-dynamic
#&&&siproxd_LDADD = $(LIBLTDL) $(DLOPENPLUGINS)
siproxd_LDADD = $(LIBLTDL)
siproxd_SOURCES = siproxd.c proxy.c register.c sock.c utils.c \
sip_utils.c sip_layer.c log.c readconf.c rtpproxy.c \
rtpproxy_relay.c accessctl.c route_processing.c \

View File

@ -67,7 +67,7 @@ int load_plugins (void) {
func_plugin_end_t plugin_end = NULL;
/* initialize the libtool dynamic loader */
LTDL_SET_PRELOADED_SYMBOLS();
// LTDL_SET_PRELOADED_SYMBOLS();
sts = lt_dlinit();
if (sts != 0) {
ERROR("ltdl (libtool dynamic loader) initialization failed.");

View File

@ -20,13 +20,7 @@
/* $Id$ */
#ifdef LTDL_CONVLIB
/* fetch local version of ltdl */
#include "../libltdl/ltdl.h"
#else
/* fetch system version of libltdl */
#include <ltdl.h>
#endif
#include <ltdl.h>
#ifdef WITH_LTDL_FIX
/* workaround for some broken libtool 2.2.6 (and others?) versions
@ -35,10 +29,10 @@
* error during linking state */
#ifndef lt__PROGRAM__LTX_preloaded_symbols
#define lt__PROGRAM__LTX_preloaded_symbols lt_libltdl_LTX_preloaded_symbols
//extern const void *lt_preloaded_symbols[];
#endif
#endif
/* Plugins must return STS_SUCCESS / SUCCESS_FAILURE */