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.3.1)
11 AC_CONFIG_SRCDIR([agent/agent.c])
12 AC_CONFIG_HEADER([config.h])
13 AM_INIT_AUTOMAKE([-Wall])
27 docs/reference/Makefile
28 docs/reference/libnice/Makefile
32 # Set the libtool C/A/R version info
33 # If the source code was changed, but there were no interface changes:
35 # If there was a compatible interface change:
36 # Increment CURRENT and AGE. Set REVISION to 0
37 # If there was an incompatible interface change:
38 # Increment CURRENT. Set AGE and REVISION to 0
42 LIBNICE_LIBVERSION=${LIBNICE_CURRENT}:${LIBNICE_REVISION}:${LIBNICE_AGE}
43 LIBNICE_LT_LDFLAGS="-version-info ${LIBNICE_LIBVERSION} -no-undefined"
44 AC_SUBST(LIBNICE_LT_LDFLAGS)
47 dnl use pretty build output with automake >= 1.11
48 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
49 [AM_DEFAULT_VERBOSITY=1
50 AC_SUBST(AM_DEFAULT_VERBOSITY)])
53 # Checks for programs.
56 AC_USE_SYSTEM_EXTENSIONS
59 # Check Operating System
60 AC_MSG_CHECKING([operating system])
62 *-*-*mingw*|*-*-*cygwin*)
64 AC_MSG_RESULT($platform)
68 AC_MSG_RESULT($platform)
72 AM_CONDITIONAL([WINDOWS], [test "$platform" = "win32"])
74 # Checks for compiler features
80 AH_VERBATIM([_FORTIFY_SOURCE],
81 [/* Define to `2' to get GNU/libc warnings. */
82 /* Only define if -O1 or more is enabled */
83 #if defined __OPTIMIZE__ && __OPTIMIZE__ > 0
84 # define _FORTIFY_SOURCE 2
86 AC_DEFINE([NICEAPI_EXPORT], [ ], [Public library function implementation])
87 AC_CHECK_HEADERS([arpa/inet.h net/in.h])
88 AC_CHECK_HEADERS([ifaddrs.h], \
89 [AC_DEFINE(HAVE_GETIFADDRS, [1], \
90 [Whether getifaddrs() is available on the system])])
92 LIBNICE_CFLAGS="-Wall"
93 dnl if asked for, add -Werror if supported
94 if test "x$LIBNICE_RELEASE" != "xyes"; then
95 LIBNICE_CFLAGS="$LIBNICE_CFLAGS -Werror"
98 AC_SUBST(LIBNICE_CFLAGS)
99 AC_MSG_NOTICE([set LIBNICE_CFLAGS to $LIBNICE_CFLAGS])
101 # Checks for libraries.
102 AC_CHECK_LIB(rt, clock_gettime, [LIBRT="-lrt"], [LIBRT=""])
103 AC_CHECK_FUNCS([poll])
106 PKG_CHECK_MODULES(GLIB, [dnl
108 gobject-2.0 >= 2.13 dnl
109 gthread-2.0 >= 2.13 dnl
113 AC_ARG_WITH(gstreamer,
114 AC_HELP_STRING([--with-gstreamer], [build GStreamer plugin]),
115 [with_gstreamer=${withval}],
116 [with_gstreamer=auto])
118 AC_ARG_WITH(gstreamer-0.10,
119 AC_HELP_STRING([--with-gstreamer-0.10], [build GStreamer 0.10 plugin]),
120 [with_gstreamer010=${withval}],
121 [with_gstreamer010=auto])
123 AS_IF([test "$with_gstreamer" != no], [
125 PKG_CHECK_MODULES(GST, [
126 gstreamer-1.0 >= 0.11.91
127 gstreamer-base-1.0 >= 0.11.91
132 gstplugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
135 AS_IF([test "$with_gstreamer" = yes], [
136 AC_MSG_ERROR([GStreamer 1.0 support was requested but GStreamer 1.0 libraries are not available])
143 AS_IF([test "$with_gstreamer010" != no], [
145 PKG_CHECK_MODULES(GST010, [
146 gstreamer-0.10 >= 0.10.10
147 gstreamer-base-0.10 >= 0.10.10
150 with_gstreamer010=yes
152 gstplugin010dir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
155 AS_IF([test "$with_gstreamer010" = yes], [
156 AC_MSG_ERROR([GStreamer 0.10 support was requested but GStreamer 0.10 libraries are not available])
163 AC_SUBST(gstplugindir)
164 AC_SUBST(gstplugin010dir)
166 AM_CONDITIONAL(WITH_GSTREAMER, test "$with_gstreamer" = yes)
167 AM_CONDITIONAL(WITH_GSTREAMER010, test "$with_gstreamer010" = yes)
169 GUPNP_IGD_REQUIRED=0.1.2
171 AC_ARG_ENABLE([gupnp],
172 AC_HELP_STRING([--disable-gupnp], [Disable GUPnP IGD support]),
173 [case "${enableval}" in
174 yes) WANT_GUPNP=yes ;;
176 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gupnp) ;;
181 if test "x$WANT_GUPNP" != "xno"; then
182 PKG_CHECK_MODULES(GUPNP, gupnp-igd-1.0 >= $GUPNP_IGD_REQUIRED,
186 if test "x$WANT_GUPNP" = "xyes" && test "x$HAVE_GUPNP" = "xno"; then
187 AC_ERROR([Requested GUPnP IGD, but it is not available])
190 if test "x$HAVE_GUPNP" = "xyes"; then
191 AC_DEFINE(HAVE_GUPNP,,[Have the GUPnP IGD library])
197 AC_ARG_ENABLE([coverage],
198 [AS_HELP_STRING([--enable-coverage],
199 [build for test coverage (default disabled)])],,
200 [enable_coverage="no"])
201 AS_IF([test "${enable_coverage}" != "no"], [
202 CFLAGS="${CFLAGS} -g -O0 -fprofile-arcs -ftest-coverage"
206 AC_SUBST(CCACHE_DISABLE)
210 LDFLAGS="$LDFLAGS -lsocket -lnls"
217 m4_ifdef([GTK_DOC_CHECK], [
220 AM_CONDITIONAL([ENABLE_GTK_DOC], false)
222 AC_CONFIG_MACRO_DIR(m4)