summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 8f9cee144583dc557399b2fb1144ffc61826a3b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

AC_PREREQ(2.59c)
AC_INIT(nice, 0.0.1)
AC_CONFIG_SRCDIR([agent/agent.c])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([-Wall])
AC_CONFIG_FILES([
	Makefile
	address/Makefile
	agent/Makefile
	tests/Makefile
	stun/Makefile
	stun/tests/Makefile
	stun/tools/Makefile
	local/Makefile
	udp/Makefile
	nice/Makefile
	nice/nice.pc
	random/Makefile
	gst/Makefile
	])

# Checks for programs.

AC_PROG_CC
dnl AC_PROG_CC_C99
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_LIBTOOL

# Checks for compiler features

AC_C_RESTRICT
AC_C_VARARRAYS
AC_HEADER_ASSERT
AC_HEADER_STDBOOL
AC_DEFINE([_FORTIFY_SOURCE], [2], [Define to `2' to get GNU/libc warnings.])
AC_DEFINE([NICEAPI_EXPORT], [ ], [Public library function implementation])
AC_CHECK_HEADERS([arpa/inet.h net/in.h ifaddrs.h])

# Checks for libraries.
AC_CHECK_LIB(rt, clock_gettime, [LIBRT="-lrt"], [LIBRT=""])
AC_CHECK_FUNCS([poll])
AC_SUBST(LIBRT)

PKG_CHECK_MODULES(OPENSSL, [openssl])

PKG_CHECK_MODULES(GLIB, [dnl
	glib-2.0 >= 2.10 dnl
	gobject-2.0 >= 2.10 dnl
	gthread-2.0 >= 2.10 dnl
	])

AC_ARG_WITH(gstreamer, 
	AC_HELP_STRING([--with-gstreamer], [use GStreamer]),
	[with_gstreamer=${withval}],
	[with_gstreamer=auto])

AS_IF([test "$with_gstreamer" != no], [
	PKG_CHECK_MODULES(GST, [
		gstreamer-0.10 >= 0.10.0
		gstreamer-base-0.10 >= 0.10.0
		],
		[
		with_gstreamer=yes
		gstplugindir=`$PKG_CONFIG --variable=pluginsdir gstreamer-0.10`
		],
		[
		AS_IF([test "$with_gstreamer" = yes], [
			AC_MSG_ERROR([GStreamer support was requested but GStreamer libraries are not available])
		])

		with_gstreamer=no
		])
])

AC_SUBST(gstplugindir)

AM_CONDITIONAL(WITH_GSTREAMER, test "$with_gstreamer" = yes)

dnl Test coverage
AC_ARG_ENABLE([coverage],
	[AS_HELP_STRING([--enable-coverage],
		[build for test coverage (default disabled)])],,
	[enable_coverage="no"])
AS_IF([test "${enable_coverage}" != "no"], [
	CFLAGS="${CFLAGS} -g -O0 -fprofile-arcs -ftest-coverage"
	LDFLAGS="-lgcov"
	CCACHE_DISABLE=1
])
AC_SUBST(CCACHE_DISABLE)


AC_OUTPUT