Use the agent's main main-context for the tcp-bsd callback as it's for sending
[sipe-libnice.git] / configure.ac
blob623bd0aee78fc44cf68a91df9ab166e55fb8f567
2 AC_PREREQ(2.59c)
4 dnl releases only do -Wall, cvs and prerelease does -Werror too
5 dnl use a three digit version number for releases, and four for cvs/prerelease
6 AC_INIT(libnice, 0.1.1.1)
7 LIBNICE_RELEASE="no"
9 AC_CONFIG_SRCDIR([agent/agent.c])
10 AC_CONFIG_HEADER([config.h])
11 AM_INIT_AUTOMAKE([-Wall])
12 AC_CONFIG_FILES([
13         Makefile
14         agent/Makefile
15         stun/Makefile
16         stun/tests/Makefile
17         stun/tools/Makefile
18         socket/Makefile
19         nice/Makefile
20         nice/nice.pc
21         random/Makefile
22         gst/Makefile
23         docs/Makefile
24         docs/reference/Makefile
25         docs/reference/libnice/Makefile
26         tests/Makefile
27         ])
29 # Set the libtool C/A/R version info
30 #    If the source code was changed, but there were no interface changes:
31 #      Increment REVISION.
32 #    If there was a compatible interface change:
33 #      Increment CURRENT and AGE. Set REVISION to 0
34 #    If there was an incompatible interface change:
35 #      Increment CURRENT. Set AGE and REVISION to 0
36 LIBNICE_CURRENT=10
37 LIBNICE_REVISION=1
38 LIBNICE_AGE=0
39 LIBNICE_LIBVERSION=${LIBNICE_CURRENT}:${LIBNICE_REVISION}:${LIBNICE_AGE}
40 LIBNICE_LT_LDFLAGS="-version-info ${LIBNICE_LIBVERSION}"
41 AC_SUBST(LIBNICE_LT_LDFLAGS)
44 dnl use pretty build output with automake >= 1.11
45 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
46   [AM_DEFAULT_VERBOSITY=1
47    AC_SUBST(AM_DEFAULT_VERBOSITY)])
50 # Checks for programs.
52 AC_PROG_CC
53 AC_USE_SYSTEM_EXTENSIONS
54 AC_PROG_LIBTOOL
57 # Checks for compiler features
59 AC_C_RESTRICT
60 AC_C_VARARRAYS
61 AC_HEADER_ASSERT
62 AC_HEADER_STDBOOL
63 AC_DEFINE([_FORTIFY_SOURCE], [2], [Define to `2' to get GNU/libc warnings.])
64 AC_DEFINE([NICEAPI_EXPORT], [ ], [Public library function implementation])
65 AC_CHECK_HEADERS([arpa/inet.h net/in.h ifaddrs.h], \
66                       [AC_DEFINE(HAVE_GETIFADDRS, [1], \
67                        [Whether getifaddrs() is available on the system])])
69 LIBNICE_CFLAGS="-Wall"
70 dnl if asked for, add -Werror if supported
71 if test "x$LIBNICE_RELEASE" != "xyes"; then
72   LIBNICE_CFLAGS="$LIBNICE_CFLAGS -Werror"
75 AC_SUBST(LIBNICE_CFLAGS)
76 AC_MSG_NOTICE([set LIBNICE_CFLAGS to $LIBNICE_CFLAGS])
78 # Checks for libraries.
79 AC_CHECK_LIB(rt, clock_gettime, [LIBRT="-lrt"], [LIBRT=""])
80 AC_CHECK_FUNCS([poll])
81 AC_SUBST(LIBRT)
83 PKG_CHECK_MODULES(GLIB, [dnl
84         glib-2.0 >= 2.10 dnl
85         gobject-2.0 >= 2.10 dnl
86         gthread-2.0 >= 2.10 dnl
87         ])
89 AC_ARG_WITH(gstreamer, 
90         AC_HELP_STRING([--with-gstreamer], [use GStreamer]),
91         [with_gstreamer=${withval}],
92         [with_gstreamer=auto])
94 AS_IF([test "$with_gstreamer" != no], [
95   
96         PKG_CHECK_MODULES(GST, [
97                 gstreamer-0.10 >= 0.10.0
98                 gstreamer-base-0.10 >= 0.10.0
99                 ],
100                 [
101                 with_gstreamer=yes
102                 GST_MAJORMINOR=0.10
103                 gstplugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
104                 ],
105                 [
106                 AS_IF([test "$with_gstreamer" = yes], [
107                         AC_MSG_ERROR([GStreamer support was requested but GStreamer libraries are not available])
108                 ])
110                 with_gstreamer=no
111                 ])
114 AC_SUBST(gstplugindir)
116 AM_CONDITIONAL(WITH_GSTREAMER, test "$with_gstreamer" = yes)
118 GUPNP_IGD_REQUIRED=0.1.2
120 AC_ARG_ENABLE([gupnp],
121         AC_HELP_STRING([--disable-gupnp], [Disable GUPnP IGD support]),
122         [case "${enableval}" in
123             yes) WANT_GUPNP=yes ;;
124             no)  WANT_GUPNP=no ;;
125             *) AC_MSG_ERROR(bad value ${enableval} for --enable-gupnp) ;;
126         esac],
127         WANT_GUPNP=test)
129 HAVE_GUPNP=no
130 if test "x$WANT_GUPNP" != "xno"; then
131    PKG_CHECK_MODULES(GUPNP, gupnp-igd-1.0 >= $GUPNP_IGD_REQUIRED,
132     [ HAVE_GUPNP=yes ],
133     [ HAVE_GUPNP=no ])
135 if test "x$WANT_GUPNP" = "xyes" && test "x$HAVE_GUPNP" = "xno"; then
136    AC_ERROR([Requested GUPnP IGD, but it is not available])
139 if test "x$HAVE_GUPNP" = "xyes"; then
140    AC_DEFINE(HAVE_GUPNP,,[Have the GUPnP IGD library])
143 AC_SUBST(HAVE_GUPNP)
145 dnl Test coverage
146 AC_ARG_ENABLE([coverage],
147         [AS_HELP_STRING([--enable-coverage],
148                 [build for test coverage (default disabled)])],,
149         [enable_coverage="no"])
150 AS_IF([test "${enable_coverage}" != "no"], [
151         CFLAGS="${CFLAGS} -g -O0 -fprofile-arcs -ftest-coverage"
152         LDFLAGS="-lgcov"
153         CCACHE_DISABLE=1
155 AC_SUBST(CCACHE_DISABLE)
157 case $host_os in
158   solaris*)
159     LDFLAGS="$LDFLAGS -lsocket -lnls"
160     ;;
161   *)
162     ;;
163 esac
165 # check for gtk-doc
166 GTK_DOC_CHECK(1.9)
167 AC_CONFIG_MACRO_DIR(m4)
169 AC_OUTPUT