Commit 521ed448 authored by Kai Vehmanen's avatar Kai Vehmanen

Added build time options to disable STUN and NTH/HTTP library modules.

darcs-hash:20070206180829-7659e-ccf73b73cf63fbac4410f078963b4ff66f9cb3f7.gz
parent 897727b1
......@@ -46,7 +46,6 @@ The Sofia-SIP su submodule also provides some small utilities:
- localinfo (libsofia-sip-ua/su), prints information about
local network interfaces
References
----------
......
......@@ -109,6 +109,10 @@ Notes on new features
registration is not closed until client is unregisters, or the whole stack
is shut down.
- New build time options have been added: ability to build without
STUN and HTTP support. See 'docs/devel_platform_notes.txt' for some
additional notes to distributors.
<information about major new features
- new/changed/removed functionality
- links to further documentation
......
......@@ -83,6 +83,15 @@ elif test x${HAVE_OPENSSL} != x1 ; then
else
AC_DEFINE([HAVE_SOFIA_STUN], 1, [Define to 1 if we use STUN library])
fi
AM_CONDITIONAL([HAVE_STUN], [test "x$enable_stun" = xyes])
AC_ARG_ENABLE(nth,
[ --disable-nth disable nth and http modules (enabled)],
, enable_nth=yes)
AM_CONDITIONAL([HAVE_NTH], [test "x$enable_nth" = xyes])
if test x$enable_nth = xyes ; then
AC_DEFINE([HAVE_SOFIA_NTH], 1, [Define to 1 if we use NTH library])
fi
dnl Disable NTLM support by default
AC_ARG_ENABLE(ntlm,
......
......@@ -11,14 +11,30 @@ up-to-date autotools. Autoconf should be at least 2.57 and automake should
be at least 1.7. You can avoid running autoreconf explicitly if you use
./configure option --enable-maintainer-mode.
Notes to distributors
----------------------
Build options such as "--disable-stun" (HAVE_SOFIA_STUN) and
"--disable-nth" (HAVE_SOFIA_NTH) modify the public library API/ABI,
by omitting certain interfaces from the resulting library and installed
header files.
Options such as '--disable-size-compat' modify the library
ABI by changing the types used in public library function
signatures.
Generic POSIX (GNU/Linux, BSD, ...)
-----------------------------------
Sofia-SIP should compile out-of-the-box on generic POSIX
machines. Use the standard GNU autotool 'configure+make'
procedure to build the software. See top-level INSTALL
procedure to build the software. See top-level README file
for more information.
The configure script accepts various options. See "./configure --help"
for the full list.
Mac OS X
--------
......
......@@ -9,9 +9,23 @@
AUTOMAKE_OPTIONS = foreign
# select whicn optional sofia-sip modules have been enabled
# in the build
OPT_LIBADD =
OPT_SUBDIRS_STUN =
OPT_SUBDIRS_NTH =
if HAVE_STUN
OPT_LIBADD += stun/libstun.la
OPT_SUBDIRS_STUN += stun
endif
if HAVE_NTH
OPT_LIBADD += nth/libnth.la http/libhttp.la
OPT_SUBDIRS_NTH += nth http
endif
# note: order does matter in the subdir list
SUBDIRS = su features bnf sresolv sdp url msg sip stun ipt soa \
tport http nta nea iptsec nth nua
SUBDIRS = su features bnf sresolv sdp url msg sip $(OPT_SUBDIRS_STUN) ipt soa \
tport nta nea iptsec $(OPT_SUBDIRS_NTH) nua
DIST_SUBDIRS = $(SUBDIRS) docs
DOXYGEN = doxygen
......@@ -26,17 +40,15 @@ libsofia_sip_ua_la_LIBADD = bnf/libbnf.la \
msg/libmsg.la \
nea/libnea.la \
nta/libnta.la \
nth/libnth.la \
nua/libnua.la \
http/libhttp.la \
sdp/libsdp.la \
sip/libsip.la \
soa/libsoa.la \
sresolv/libsresolv.la \
su/libsu.la \
stun/libstun.la \
tport/libtport.la \
url/liburl.la
url/liburl.la \
$(OPT_LIBADD)
# set the libtool version info version:revision:age for libsofia-sip-ua
# - soname to 'libsofia-sip-ua.so.(CUR-AGE)'
......
......@@ -31,6 +31,12 @@ TESTS = test_auth_digest
BUILT_SOURCES = auth_tag_ref.c
HTTP_SRC = auth_plugin_http.c
if HAVE_NTH
USE_HTTP_SRC = $(HTTP_SRC)
OPT_LDDD = ../http/libhttp.la
endif
nobase_include_sofia_HEADERS = \
sofia-sip/auth_common.h \
sofia-sip/auth_client.h sofia-sip/auth_digest.h \
......@@ -42,8 +48,9 @@ libiptsec_la_SOURCES = iptsec_debug.h \
auth_client.c auth_common.c auth_digest.c \
auth_module.c auth_tag.c auth_tag_ref.c \
auth_plugin.c auth_plugin_delayed.c \
auth_module_http.c auth_module_sip.c \
auth_module_sip.c \
$(NTLM_SOURCE) \
$(USE_HTTP_SOURCE) \
iptsec_debug.c
NTLM_HEADER = sofia-sip/auth_ntlm.h
......@@ -57,7 +64,7 @@ EXTRA_libiptsec_la_SOURCES = \
COVERAGE_INPUT = $(libiptsec_la_SOURCES) $(include_sofia_HEADERS)
LDADD = libiptsec.la \
../http/libhttp.la \
$(OPT_LDADD) \
../nta/libnta.la \
../sip/libsip.la \
../msg/libmsg.la \
......@@ -72,7 +79,7 @@ test_auth_digest_LDFLAGS = -static
# Install and distribution rules
EXTRA_DIST = Doxyfile iptsec.docs testpasswd \
auth_module_sip.c auth_module_http.c $(BUILT_SOURCES)
auth_module_sip.c $(HTTP_SRC) $(BUILT_SOURCES)
# ----------------------------------------------------------------------
# Sofia specific rules
......
......@@ -10272,8 +10272,12 @@ int nta_tport_keepalive(nta_outgoing_t *orq)
assert(orq); (void)tp;
#if HAVE_SOFIA_STUN
return tport_keepalive(orq->orq_tport, msg_addrinfo(orq->orq_request),
TAG_END());
#else
return -1;
#endif
}
/** Close all transports. @since Experimental in @VERSION_1_12_2. */
......
......@@ -35,20 +35,28 @@ nobase_include_sofia_HEADERS = \
sofia-sip/tport_plugins.h
TLS_SRC = tport_type_tls.c tport_tls.c tport_tls.h
if HAVE_TLS
USE_TLS_SRC = $(TLS_SRC)
endif
STUN_SRC = tport_stub_stun.c tport_type_stun.c
if HAVE_STUN
USE_STUN_SRC = $(STUN_SRC)
endif
HTTP_SRC = tport_type_connect.c
if HAVE_NTH
USE_HTTP_SRC = $(HTTP_SRC)
endif
libtport_la_SOURCES = tport.c tport_logging.c \
tport_stub_stun.c tport_stub_sigcomp.c \
tport_stub_sigcomp.c \
tport_type_udp.c tport_type_tcp.c tport_type_sctp.c \
tport_type_connect.c tport_type_stun.c \
tport_internal.h \
tport_tag.c tport_tag_ref.c $(USE_TLS_SRC)
tport_tag.c tport_tag_ref.c $(USE_HTTP_SRC) $(USE_TLS_SRC) $(USE_STUN_SRC)
# to make sure all files end up in the dist package
EXTRA_libtport_la_SOURCES = $(TLS_SRC)
EXTRA_libtport_la_SOURCES = $(TLS_SRC) $(STUN_SRC) $(HTTP_SRC)
# Disable for now
EXTRA_libtport_la_SOURCES += tport_sigcomp.c tport_threadpool.c
......
......@@ -492,7 +492,9 @@ tport_t *tport_tcreate(tp_stack_t *stack,
if (tick < 200)
tick = 200;
#if HAVE_SOFIA_STUN
tport_init_stun_server(mr, ta_args(ta));
#endif
mr->mr_timer = su_timer_create(su_root_task(root), tick);
su_timer_set(mr->mr_timer, tport_tick, mr);
......@@ -531,7 +533,9 @@ void tport_destroy(tport_t *self)
while (mr->mr_primaries)
tport_zap_primary(mr->mr_primaries);
#if HAVE_SOFIA_STUN
tport_deinit_stun_server(mr);
#endif
if (mr->mr_dump_file)
fclose(mr->mr_dump_file), mr->mr_dump_file = NULL;
......@@ -1035,7 +1039,9 @@ void tport_zap_secondary(tport_t *self)
mr = self->tp_master;
#if HAVE_SOFIA_STUN
tport_stun_server_remove_socket(self);
#endif
if (self->tp_index)
su_root_deregister(mr->mr_root, self->tp_index);
......@@ -1226,7 +1232,9 @@ extern tport_vtable_t const tport_threadpool_vtable;
tport_vtable_t const *tport_vtables[TPORT_NUMBER_OF_TYPES + 1] =
{
#if HAVE_SOFIA_NTH
&tport_http_connect_vtable,
#endif
#if HAVE_TLS
&tport_tls_client_vtable,
&tport_tls_vtable,
......@@ -1294,7 +1302,9 @@ tport_set_f const *tport_set_methods[TPORT_NUMBER_OF_TYPES + 1] =
tport_server_bind_set,
tport_client_bind_set,
tport_threadpool_set,
#if HAVE_SOFIA_NTH
tport_http_connect_set,
#endif
#if HAVE_TLS
tport_tls_set,
#endif
......@@ -2661,8 +2671,10 @@ void tport_recv_event(tport_t *self)
self->tp_time = su_time_ms(now);
#if HAVE_SOFIA_STUN
if (again == 3) /* STUN keepalive */
return;
#endif
if (again < 0) {
int error = su_errno();
......
......@@ -166,7 +166,9 @@ int tport_udp_init_primary(tport_primary_t *pri,
tport_check_trunc(pri->pri_primary, ai);
#if HAVE_SOFIA_STUN
tport_stun_server_add_socket(pri->pri_primary);
#endif
return 0;
}
......@@ -295,9 +297,11 @@ int tport_recv_dgram(tport_t *self)
/* SigComp */
return tport_recv_comp_dgram(self, self->tp_comp, &self->tp_msg,
from, fromlen);
#if HAVE_SOFIA_STUN
else if (sample[0] == 0 || sample[0] == 1)
/* STUN request or response */
return tport_recv_stun_dgram(self, &self->tp_msg, from, fromlen);
#endif
else
return 0;
}
......
......@@ -273,6 +273,9 @@
/* Define to 1 if you have the `socketpair' function. */
#undef HAVE_SOCKETPAIR
/* Define to 1 if we use NTH library */
#define HAVE_SOFIA_NTH 1
/* Define to 1 if we use NTLM library */
#undef HAVE_SOFIA_NTLM
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment