Commit 17d8474e authored by Olivier Crête's avatar Olivier Crête

merge bellet

parents 55276cbf 14b2f2d9
......@@ -2,5 +2,6 @@
"phabricator.uri" : "https:\/\/phabricator.freedesktop.org\/",
"history.immutable" : true,
"project.name" : "libnice",
"repository.callsign" : "LIBNICE"
"repository.callsign" : "LIBNICE",
"default-reviewers" : "#libnice"
}
......@@ -154,6 +154,7 @@ tests/test-restart
tests/test-tcp
tests/test-thread
tests/test-new-dribble
tests/test-nomination
# examples/ stuff
examples/simple-example
......
......@@ -17,8 +17,8 @@ SUBDIRS = \
agent \
nice \
gst \
docs \
tests \
docs \
examples
DISTCHECK_CONFIGURE_FLAGS = --disable-assert -enable-gtk-doc --enable-introspection
......@@ -47,6 +47,7 @@ dist_check_SCRIPTS = \
# but not Linux, for no particular reason. They can’t be removed without
# breaking ABI. FIXME: Remove them when we next break ABI.
win32/vs9/libnice.def: nice/libnice.sym
$(MKDIR_P) $(dir $@)
$(AM_V_GEN)(echo "LIBRARY libnice"; \
echo ""; \
echo "EXPORTS"; \
......
libnice 0.1.14 (2017-04-03)
===========================
Improved RFC compliance
Split verbose logs into a separate option
Numerous bug fixes
Use GnuTLS for hash functions
Implement NewReno in PseudoTCP
Requires GLib 2.44 GnuTLS 2.12
libnice 0.1.13 (2015-04-28)
===========================
Fix build on non-Windows platforms that don't have getifaddrs()
......
......@@ -5,7 +5,7 @@ Nice: GLib ICE library
Copyright
---------
(C) 2006-2011 Collabora Ltd.
(C) 2006-2017 Collabora Ltd.
(C) 2006-2011 Nokia Corporation
License
......@@ -16,10 +16,12 @@ See the file COPYING.
Requirements
------------
glib >= 2.10
glib >= 2.44
pkg-config
gnutls >= 2.12.0
gupnp-igd >= 0.1.2 (optional)
gstreamer-0.10 >= 0.10.0 (optional)
gstreamer-1.0 (optional)
Build instructions
------------------
......@@ -50,7 +52,7 @@ Relevant standards
These standards are relevant to nice's current implementation.
ICE draft 15
ICE RFC 5245
http://tools.ietf.org/html/rfc5245
STUN
http://tools.ietf.org/html/rfc3489
......
......@@ -22,6 +22,12 @@ if WINDOWS
AM_CFLAGS += -DWINVER=0x0501 # _WIN32_WINNT_WINXP
endif
BUILT_SOURCES = \
agent-enum-types.h \
agent-enum-types.c
CLEANFILES += $(BUILT_SOURCES)
noinst_LTLIBRARIES = libagent.la
libagent_la_SOURCES = \
......@@ -54,6 +60,23 @@ libagent_la_SOURCES = \
pseudo-tcp-output-stream.h \
$(BUILT_SOURCES)
agent-enum-types.h: agent.h Makefile
$(AM_V_GEN)$(GLIB_MKENUMS) \
--fhead "#ifndef __AGENT_ENUM_TYPES_H__\n#define __AGENT_ENUM_TYPES_H__ 1\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
--fprod "/* enumerations from \"@filename@\" */\n" \
--vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define NICE_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
--ftail "G_END_DECLS\n\n#endif /* !AGENT_ENUM_TYPES_H */" \
$(addprefix $(srcdir)/,agent.h) > $@
agent-enum-types.c: agent.h Makefile agent-enum-types.h
$(AM_V_GEN)$(GLIB_MKENUMS) \
--fhead "#include <config.h>\n#include <glib-object.h>\n#include \"agent.h\"\n#include \"agent-enum-types.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static GType type = 0;\n if (!type) {\n static const G@Type@Value values[] = {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n type = g_@type@_register_static (\"@EnumName@\", values);\n }\n return type;\n}\n\n" \
$(addprefix $(srcdir)/,agent.h) > $@
libagent_la_LIBADD = \
$(top_builddir)/random/libnice-random.la \
$(top_builddir)/socket/libsocket.la \
......
......@@ -116,12 +116,32 @@ nice_input_message_iter_compare (const NiceInputMessageIter *a,
* MTU and estimated typical sizes of ICE STUN packet */
#define MAX_STUN_DATAGRAM_PAYLOAD 1300
#define NICE_COMPONENT_MAX_VALID_CANDIDATES 50 /* maximum number of validates remote candidates to keep, the number is arbitrary but hopefully large enough */
/* A convenient macro to test if the agent is compatible with RFC5245
* or OC2007R2. Specifically these two modes share the support
* of the regular or aggressive nomination mode */
#define NICE_AGENT_IS_COMPATIBLE_WITH_RFC5245_OR_OC2007R2(obj) \
((obj)->compatibility == NICE_COMPATIBILITY_RFC5245 || \
(obj)->compatibility == NICE_COMPATIBILITY_OC2007R2)
/* A grace period before declaring a component as failed, in msecs. This
* delay is added to reduce the chance to see the agent receiving new
* stun activity just after the conncheck list has been declared failed,
* reactiviting conncheck activity, and causing a (valid) state
* transitions like that: connecting -> failed -> connecting ->
* connected -> ready.
* Such transitions are not buggy per-se, but may break the
* test-suite, that counts precisely the number of time each state
* has been set, and doesnt expect these transcient failed states.
*/
#define NICE_AGENT_MAX_TIMER_GRACE_PERIOD 1000
struct _NiceAgent
{
GObject parent; /* gobject pointer */
gboolean full_mode; /* property: full-mode */
GTimeVal next_check_tv; /* property: next conncheck timestamp */
gchar *stun_server_ip; /* property: STUN server IP */
guint stun_server_port; /* property: STUN server port */
gchar *proxy_ip; /* property: Proxy server IP */
......@@ -134,6 +154,7 @@ struct _NiceAgent
guint max_conn_checks; /* property: max connectivity checks */
gboolean force_relay; /* property: force relay */
gboolean turn_short_term; /* property: turn short term credentials */
NiceNominationMode nomination_mode; /* property: Nomination mode */
GSList *local_addresses; /* list of NiceAddresses for local
interfaces */
......@@ -167,6 +188,8 @@ struct _NiceAgent
guint16 rfc4571_expecting_length;
gboolean use_ice_udp;
gboolean use_ice_tcp;
guint conncheck_timer_grace_period; /* ongoing delay before timer stop */
/* XXX: add pointer to internal data struct for ABI-safe extensions */
};
......
This diff is collapsed.
......@@ -372,6 +372,26 @@ typedef enum
NICE_PROXY_TYPE_LAST = NICE_PROXY_TYPE_HTTP,
} NiceProxyType;
/**
* NiceNominationMode:
* @NICE_NOMINATION_MODE_AGGRESSIVE: Aggressive nomination mode
* @NICE_NOMINATION_MODE_REGULAR: Regular nomination mode
*
* An enum to specity the kind of nomination mode to use by
* the agent, as described in RFC 5245. Two modes exists,
* regular and aggressive. They differ by the way the controlling
* agent chooses to put the USE-CANDIDATE attribute in its STUN
* messages. The aggressive mode is supposed to nominate a pair
* faster, than the regular mode, potentially causing the nominated
* pair to change until the connection check completes.
*
* Since: UNRELEASED
*/
typedef enum
{
NICE_NOMINATION_MODE_REGULAR = 0,
NICE_NOMINATION_MODE_AGGRESSIVE,
} NiceNominationMode;
/**
* NiceAgentRecvFunc:
......@@ -404,6 +424,26 @@ typedef void (*NiceAgentRecvFunc) (
NiceAgent *
nice_agent_new (GMainContext *ctx, NiceCompatibility compat);
/**
* nice_agent_new_regular_nomination:
* @ctx: The Glib Mainloop Context to use for timers
* @compat: The compatibility mode of the agent
*
* Create a new #NiceAgent with regular nomination mode. The nomination
* mode is defined in the ICE specification and decribes the way pairs of
* connection candidates are selected by the agents. Two modes are
* available, aggressive and regular. libnice default mode is
* aggressive.
* The returned object must be freed with g_object_unref()
* <para> See also: #NiceNominationMode </para>
*
* Since: UNRELEASED
*
* Returns: The new agent GObject
*/
NiceAgent *
nice_agent_new_regular_nomination (GMainContext *ctx, NiceCompatibility compat);
/**
* nice_agent_add_local_address:
* @agent: The #NiceAgent Object
......
......@@ -191,21 +191,21 @@ nice_candidate_ice_local_preference (const NiceCandidate *candidate)
{
case NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE:
if (candidate->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE ||
candidate->type == NICE_CANDIDATE_TYPE_PREF_NAT_ASSISTED)
candidate->type == NICE_CANDIDATE_TYPE_HOST)
direction_preference = 4;
else
direction_preference = 6;
break;
case NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE:
if (candidate->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE ||
candidate->type == NICE_CANDIDATE_TYPE_PREF_NAT_ASSISTED)
candidate->type == NICE_CANDIDATE_TYPE_HOST)
direction_preference = 2;
else
direction_preference = 4;
break;
case NICE_CANDIDATE_TRANSPORT_TCP_SO:
if (candidate->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE ||
candidate->type == NICE_CANDIDATE_TYPE_PREF_NAT_ASSISTED)
candidate->type == NICE_CANDIDATE_TYPE_HOST)
direction_preference = 6;
else
direction_preference = 2;
......@@ -360,3 +360,14 @@ nice_candidate_copy (const NiceCandidate *candidate)
return copy;
}
NICEAPI_EXPORT gboolean
nice_candidate_equal_target (const NiceCandidate *candidate1,
const NiceCandidate *candidate2)
{
g_return_val_if_fail (candidate1 != NULL, FALSE);
g_return_val_if_fail (candidate2 != NULL, FALSE);
return (candidate1->transport == candidate2->transport &&
nice_address_equal (&candidate1->addr, &candidate2->addr));
}
......@@ -230,7 +230,23 @@ nice_candidate_free (NiceCandidate *candidate);
NiceCandidate *
nice_candidate_copy (const NiceCandidate *candidate);
GType nice_candidate_get_type (void);
/**
* nice_candidate_equal_target:
* @candidate1: A candidate
* @candidate2: A candidate
*
* Verifies that the candidates point to the same place, meaning they have
* the same transport and the same address. It ignores all other aspects.
*
* Returns: %TRUE if the candidates point to the same place
*
* Since: 0.1.15
*/
gboolean
nice_candidate_equal_target (const NiceCandidate *candidate1,
const NiceCandidate *candidate2);
GType nice_candidate_get_type (void);
/**
* NICE_TYPE_CANDIDATE:
......
......@@ -105,6 +105,13 @@ socket_source_attach (SocketSource *socket_source, GMainContext *context)
if (socket_source->socket->fileno == NULL)
return;
/* Do not create a GSource for UDP turn socket, because it
* would duplicate the packets already received on the base
* UDP socket.
*/
if (socket_source->socket->type == NICE_SOCKET_TYPE_UDP_TURN)
return;
/* Create a source. */
source = g_socket_create_source (socket_source->socket->fileno,
G_IO_IN, NULL);
......@@ -402,7 +409,7 @@ nice_component_restart (NiceComponent *cmp)
for (i = cmp->remote_candidates; i; i = i->next) {
NiceCandidate *candidate = i->data;
/* note: do not remove the local candidate that is
/* note: do not remove the remote candidate that is
* currently part of the 'selected pair', see ICE
* 9.1.1.1. "ICE Restarts" (ID-19) */
if (candidate == cmp->selected_pair.remote) {
......@@ -457,6 +464,8 @@ nice_component_update_selected_pair (NiceComponent *component, const CandidatePa
component->selected_pair.remote = pair->remote;
component->selected_pair.priority = pair->priority;
component->selected_pair.prflx_priority = pair->prflx_priority;
nice_component_add_valid_candidate (component, pair->remote);
}
/*
......@@ -536,6 +545,11 @@ nice_component_set_selected_remote_candidate (NiceComponent *component,
component->selected_pair.remote = remote;
component->selected_pair.priority = priority;
/* Get into fallback mode where packets from any source is accepted once
* this has been called. This is the expected behavior of pre-ICE SIP.
*/
component->fallback_mode = TRUE;
return local;
}
......@@ -1026,7 +1040,7 @@ nice_component_class_init (NiceComponentClass *klass)
*
* The unique numeric ID of the component.
*
* Since: UNRELEASED
* Since: 0.1.14
*/
g_object_class_install_property (object_class, PROP_ID,
g_param_spec_uint (
......@@ -1041,7 +1055,7 @@ nice_component_class_init (NiceComponentClass *klass)
*
* The #NiceAgent this component belongs to.
*
* Since: UNRELEASED
* Since: 0.1.14
*/
g_object_class_install_property (object_class, PROP_AGENT,
g_param_spec_object (
......@@ -1056,7 +1070,7 @@ nice_component_class_init (NiceComponentClass *klass)
*
* The #NiceStream this component belongs to.
*
* Since: UNRELEASED
* Since: 0.1.14
*/
g_object_class_install_property (object_class, PROP_STREAM,
g_param_spec_object (
......@@ -1193,6 +1207,9 @@ nice_component_finalize (GObject *obj)
g_warn_if_fail (cmp->remote_candidates == NULL);
g_warn_if_fail (cmp->incoming_checks == NULL);
g_list_free_full (cmp->valid_candidates,
(GDestroyNotify) nice_candidate_free);
g_clear_object (&cmp->stop_cancellable);
g_clear_object (&cmp->datagram_based);
g_mutex_clear (&cmp->io_mutex);
......@@ -1630,3 +1647,83 @@ turn_server_unref (TurnServer *turn)
g_slice_free (TurnServer, turn);
}
}
void
nice_component_add_valid_candidate (NiceComponent *component,
const NiceCandidate *candidate)
{
guint count = 0;
GList *item, *last = NULL;
for (item = component->valid_candidates; item; item = item->next) {
NiceCandidate *cand = item->data;
last = item;
count++;
if (nice_candidate_equal_target (cand, candidate))
return;
}
/* New candidate */
if (nice_debug_is_enabled ()) {
char str[INET6_ADDRSTRLEN];
nice_address_to_string (&candidate->addr, str);
nice_debug ("Agent %p : %d:%d Adding valid source"
" candidate: %s:%d trans: %d\n", component->agent,
candidate->stream_id, candidate->component_id, str,
nice_address_get_port (&candidate->addr), candidate->transport);
}
component->valid_candidates = g_list_prepend (
component->valid_candidates, nice_candidate_copy (candidate));
/* Delete the last one to make sure we don't have a list that is too long,
* the candidates are not freed on ICE restart as this would be more complex,
* we just keep the list not too long.
*/
if (count > NICE_COMPONENT_MAX_VALID_CANDIDATES) {
NiceCandidate *cand = last->data;
component->valid_candidates = g_list_delete_link (
component->valid_candidates, last);
nice_candidate_free (cand);
}
}
gboolean
nice_component_verify_remote_candidate (NiceComponent *component,
const NiceAddress *address, NiceSocket *nicesock)
{
GList *item;
if (component->fallback_mode)
return TRUE;
for (item = component->valid_candidates; item; item = item->next) {
NiceCandidate *cand = item->data;
if (((nicesock->type == NICE_SOCKET_TYPE_TCP_BSD &&
(cand->transport == NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE ||
cand->transport == NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE ||
cand->transport == NICE_CANDIDATE_TRANSPORT_TCP_SO)) ||
cand->transport == NICE_CANDIDATE_TRANSPORT_UDP) &&
nice_address_equal (address, &cand->addr)) {
/* fast return if it's already the first */
if (item == component->valid_candidates)
return TRUE;
/* Put the current candidate at the top so that in the normal use-case,
* this function becomes O(1).
*/
component->valid_candidates = g_list_remove_link (
component->valid_candidates, item);
component->valid_candidates = g_list_concat (item,
component->valid_candidates);
return TRUE;
}
}
return FALSE;
}
......@@ -160,12 +160,14 @@ struct _NiceComponent {
NiceComponentState state;
GSList *local_candidates; /* list of NiceCandidate objs */
GSList *remote_candidates; /* list of NiceCandidate objs */
GList *valid_candidates; /* list of owned remote NiceCandidates that are part of valid pairs */
GSList *socket_sources; /* list of SocketSource objs; must only grow monotonically */
guint socket_sources_age; /* incremented when socket_sources changes */
GSList *incoming_checks; /* list of IncomingCheck objs */
GList *turn_servers; /* List of TurnServer objs */
CandidatePair selected_pair; /* independent from checklists,
see ICE 11.1. "Sending Media" (ID-19) */
gboolean fallback_mode; /* in this case, accepts packets from all, ignore candidate validation */
NiceCandidate *restart_candidate; /* for storing active remote candidate during a restart */
NiceCandidate *turn_candidate; /* for storing active turn candidate if turn servers have been cleared */
/* I/O handling. The main context must always be non-NULL, and is used for all
......@@ -297,6 +299,14 @@ turn_server_ref (TurnServer *turn);
void
turn_server_unref (TurnServer *turn);
void
nice_component_add_valid_candidate (NiceComponent *component,
const NiceCandidate *candidate);
gboolean
nice_component_verify_remote_candidate (NiceComponent *component,
const NiceAddress *address, NiceSocket *nicesock);
G_END_DECLS
......
This diff is collapsed.
......@@ -56,7 +56,6 @@
* @NICE_CHECK_SUCCEEDED: Connection successfully checked.
* @NICE_CHECK_FAILED: No connectivity; retransmissions ceased.
* @NICE_CHECK_FROZEN: Waiting to be scheduled to %NICE_CHECK_WAITING.
* @NICE_CHECK_CANCELLED: Check cancelled.
* @NICE_CHECK_DISCOVERED: A valid candidate pair not on the check list.
*
* States for checking a candidate pair.
......@@ -68,7 +67,6 @@ typedef enum
NICE_CHECK_SUCCEEDED,
NICE_CHECK_FAILED,
NICE_CHECK_FROZEN,
NICE_CHECK_CANCELLED,
NICE_CHECK_DISCOVERED,
} NiceCheckState;
......@@ -85,9 +83,14 @@ struct _CandidateCheckPair
gchar foundation[NICE_CANDIDATE_PAIR_MAX_FOUNDATION];
NiceCheckState state;
gboolean nominated;
gboolean controlling;
gboolean timer_restarted;
gboolean valid;
gboolean use_candidate_on_next_check;
gboolean mark_nominated_on_response_arrival;
gboolean recheck_on_timeout;
guint recheck_on_timeout_count;
gboolean stop_retransmit_on_timeout;
struct _CandidateCheckPair *discovered_pair;
struct _CandidateCheckPair *succeeded_pair;
guint64 priority;
guint32 prflx_priority;
GTimeVal next_tick; /* next tick timestamp */
......@@ -105,7 +108,7 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair);
void conn_check_prune_stream (NiceAgent *agent, NiceStream *stream);
gboolean conn_check_handle_inbound_stun (NiceAgent *agent, NiceStream *stream, NiceComponent *component, NiceSocket *udp_socket, const NiceAddress *from, gchar *buf, guint len);
gint conn_check_compare (const CandidateCheckPair *a, const CandidateCheckPair *b);
void conn_check_remote_candidates_set(NiceAgent *agent, NiceStream *stream, NiceComponent *component);
void conn_check_remote_credentials_set(NiceAgent *agent, NiceStream *stream);
NiceCandidateTransport conn_check_match_transport (NiceCandidateTransport transport);
void
conn_check_prune_socket (NiceAgent *agent, NiceStream *stream, NiceComponent *component,
......
......@@ -102,7 +102,7 @@ void nice_debug_init (void)
flags |= g_parse_debug_string (gflags_string, gkeys, 4);
if (gflags_string && strstr (gflags_string, "libnice-pseudotcp-verbose"))
flags |= NICE_DEBUG_PSEUDOTCP_VERBOSE;
if (gflags_string && strstr (gflags_string, "libnice-nice-verbose")) {
if (gflags_string && strstr (gflags_string, "libnice-verbose")) {
flags |= NICE_DEBUG_NICE_VERBOSE;
}
......
......@@ -1075,7 +1075,7 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
stun_timer_start_reliable (&cand->timer,
STUN_TIMER_DEFAULT_RELIABLE_TIMEOUT);
} else {
stun_timer_start (&cand->timer, 200,
stun_timer_start (&cand->timer, 100,
STUN_TIMER_DEFAULT_MAX_RETRANSMISSIONS);
}
......
......@@ -276,6 +276,11 @@ nice_interfaces_get_local_ips (gboolean include_loopback)
nice_debug ("Ignoring loopback interface");
g_free (addr_string);
}
#ifdef IGNORED_IFACE_PREFIX
} else if (g_str_has_prefix (ifa->ifa_name, IGNORED_IFACE_PREFIX)) {
nice_debug ("Ignoring %s interface", ifa->ifa_name);
g_free (addr_string);
#endif
} else {
if (nice_interfaces_is_private_ip (ifa->ifa_addr))
ips = add_ip_to_list (ips, addr_string, TRUE);
......
......@@ -2707,7 +2707,7 @@ process(PseudoTcpSocket *self, Segment *seg)
/* @received_fin is set when, and only when, all segments preceding the FIN
* have been acknowledged. This is to handle the case where the FIN arrives
* out of order with a preceding data segment. */
if (seg->flags & FLAG_FIN && priv->rcv_fin == 0) {
if (seg->flags & FLAG_FIN) {
priv->rcv_fin = seg->seq;
DEBUG (PSEUDO_TCP_DEBUG_NORMAL, "Setting rcv_fin = %u", priv->rcv_fin);
} else if (seg->flags & FLAG_FIN && seg->seq != priv->rcv_fin) {
......
......@@ -103,27 +103,6 @@ nice_stream_find_component_by_id (NiceStream *stream, guint id)
return NULL;
}
/*
* Returns true if all components of the stream are either
* 'CONNECTED' or 'READY' (connected plus nominated).
*/
gboolean
nice_stream_all_components_ready (NiceStream *stream)
{
GSList *i;
for (i = stream->components; i; i = i->next) {
NiceComponent *component = i->data;
if (component &&
!(component->state == NICE_COMPONENT_STATE_CONNECTED ||
component->state == NICE_COMPONENT_STATE_READY))
return FALSE;
}
return TRUE;
}
/*
* Initialized the local crendentials for the stream.
*/
......
......@@ -88,6 +88,7 @@ struct _NiceStream {
gboolean gathering;
gboolean gathering_started;
gint tos;
guint tick_counter;
};
typedef struct {
......@@ -102,9 +103,6 @@ nice_stream_new (guint n_components, NiceAgent *agent);
void
nice_stream_close (NiceStream *stream);
gboolean
nice_stream_all_components_ready (NiceStream *stream);
NiceComponent *
nice_stream_find_component_by_id (NiceStream *stream, guint id);
......
......@@ -4,6 +4,8 @@ pkgincludedir = $(includedir)/nice
check-valgrind:
$(MAKE) TESTS_ENVIRONMENT="sh $$(cd "$(top_srcdir)" && pwd)/scripts/valgrind.sh" check
$(MAKE) TESTS_ENVIRONMENT="USE_VALGRIND=1 " check
LOG_DRIVER=$(top_srcdir)/scripts/valgrind-test-driver
.PHONY: check-valgrind
......@@ -5,7 +5,7 @@ dnl Always compile with -Wall; if --enable-compile-warnings=error is passed,
dnl also use -Werror. git and pre-releases default to -Werror
dnl use a three digit version number for releases, and four for cvs/prerelease
AC_INIT([libnice],[0.1.13.1])
AC_INIT([libnice],[0.1.14.1])
LIBNICE_RELEASE="no"
AC_CANONICAL_TARGET
......@@ -39,9 +39,9 @@ AC_CONFIG_FILES([
# Increment CURRENT and AGE. Set REVISION to 0
# If there was an incompatible interface change:
# Increment CURRENT. Set AGE and REVISION to 0
LIBNICE_CURRENT=16
LIBNICE_REVISION=2
LIBNICE_AGE=6
LIBNICE_CURRENT=17
LIBNICE_REVISION=0
LIBNICE_AGE=7
LIBNICE_LIBVERSION=${LIBNICE_CURRENT}:${LIBNICE_REVISION}:${LIBNICE_AGE}
LIBNICE_LT_LDFLAGS="-version-info ${LIBNICE_LIBVERSION} -no-undefined"
AC_SUBST(LIBNICE_LT_LDFLAGS)
......@@ -57,6 +57,7 @@ AC_PROG_CC
AM_PROG_AR
LT_PREREQ([2.2.6])
LT_INIT([dlopen win32-dll disable-static])
AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
# Check Operating System
AC_MSG_CHECKING([operating system])
......@@ -108,7 +109,7 @@ AC_ARG_ENABLE(compile-warnings,
[enable_compile_warnings="error"])])
AC_DEFUN([NICE_ADD_FLAG],
AS_COMPILER_FLAG([$1], LIBNICE_CFLAGS="$LIBNICE_CFLAGS $1", [])
AS_COMPILER_FLAG([-Werror $1], LIBNICE_CFLAGS="$LIBNICE_CFLAGS $1", [])
)
NICE_ADD_FLAG([-fno-strict-aliasing])
......@@ -145,7 +146,6 @@ AS_IF([test "$enable_compile_warnings" = "yes" -o \
NICE_ADD_FLAG([-Winline])
NICE_ADD_FLAG([-Wpacked])
NICE_ADD_FLAG([-Wmissing-format-attribute])
NICE_ADD_FLAG([-Wmissing-noreturn])
NICE_ADD_FLAG([-Winit-self])
NICE_ADD_FLAG([-Wredundant-decls])
NICE_ADD_FLAG([-Wmissing-include-dirs])
......@@ -184,14 +184,20 @@ AC_CHECK_FUNCS([poll])
AC_SUBST(LIBRT)
# Dependencies
GNUTLS_PACKAGES_PRIVATE="gnutls >= 2.12.0"
PKG_CHECK_MODULES(GNUTLS, [$GNUTLS_PACKAGES_PRIVATE])
NICE_PACKAGES_PUBLIC="glib-2.0 >= $GLIB_REQ gio-2.0 >= $GLIB_REQ gobject-2.0 >= $GLIB_REQ"
NICE_PACKAGES_PRIVATE="gthread-2.0"
NICE_PACKAGES="$NICE_PACKAGES_PUBLIC $NICE_PACKAGES_PRIVATE"
PKG_CHECK_MODULES(GLIB, [$NICE_PACKAGES_PUBLIC $NICE_PACKAGES_PRIVATE])
NICE_PACKAGES_PRIVATE="$NICE_PACKAGES_PRIVATE $GNUTLS_PACKAGES_PRIVATE"
AC_SUBST([NICE_PACKAGES_PUBLIC])
AC_SUBST([NICE_PACKAGES_PRIVATE])
AC_SUBST([NICE_PACKAGES])
PKG_CHECK_MODULES(GLIB, [$NICE_PACKAGES])
AC_ARG_WITH(gstreamer,
AS_HELP_STRING([--with-gstreamer],[build GStreamer plugin]),
......@@ -341,7 +347,7 @@ esac
# check for gtk-doc
m4_ifdef([GTK_DOC_CHECK], [
GTK_DOC_CHECK([1.9],[--flavour no-tmpl])
GTK_DOC_CHECK([1.10],[--flavour no-tmpl])