configure.ac 5.29 KB
Newer Older
Olivier Crête's avatar
import  
Olivier Crête committed
1

2
AC_PREREQ(2.59c)
3
4
5

dnl releases only do -Wall, cvs and prerelease does -Werror too
dnl use a three digit version number for releases, and four for cvs/prerelease
Olivier Crête's avatar
Olivier Crête committed
6
7
AC_INIT(libnice, 0.1.3.1)
LIBNICE_RELEASE="no"
8

9
10
AC_CANONICAL_SYSTEM

11
AC_CONFIG_SRCDIR([agent/agent.c])
Olivier Crête's avatar
import  
Olivier Crête committed
12
AC_CONFIG_HEADER([config.h])
13
AM_INIT_AUTOMAKE([-Wall])
14

15
16
AC_CONFIG_FILES([
	Makefile
17
	agent/Makefile
18
	stun/Makefile
19
	stun/tests/Makefile
20
	stun/tools/Makefile
21
	socket/Makefile
Dafydd Harries's avatar
Dafydd Harries committed
22
	nice/Makefile
23
	nice/nice.pc
24
	random/Makefile
25
	gst/Makefile
Youness Alaoui's avatar
Youness Alaoui committed
26
27
28
	docs/Makefile
	docs/reference/Makefile
	docs/reference/libnice/Makefile
29
	tests/Makefile
30
	examples/Makefile
31
	])
Olivier Crête's avatar
import  
Olivier Crête committed
32

33
# Set the libtool C/A/R version info
Youness Alaoui's avatar
Youness Alaoui committed
34
35
36
37
38
39
#    If the source code was changed, but there were no interface changes:
#      Increment REVISION.
#    If there was a compatible interface change:
#      Increment CURRENT and AGE. Set REVISION to 0
#    If there was an incompatible interface change:
#      Increment CURRENT. Set AGE and REVISION to 0
Olivier Crête's avatar
Olivier Crête committed
40
41
42
LIBNICE_CURRENT=11
LIBNICE_REVISION=0
LIBNICE_AGE=1
43
LIBNICE_LIBVERSION=${LIBNICE_CURRENT}:${LIBNICE_REVISION}:${LIBNICE_AGE}
Siraj Razick's avatar
Siraj Razick committed
44
LIBNICE_LT_LDFLAGS="-version-info ${LIBNICE_LIBVERSION} -no-undefined"
45
AC_SUBST(LIBNICE_LT_LDFLAGS)
46

47

48
49
50
51
52
53
dnl use pretty build output with automake >= 1.11
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
  [AM_DEFAULT_VERBOSITY=1
   AC_SUBST(AM_DEFAULT_VERBOSITY)])


Olivier Crête's avatar
import  
Olivier Crête committed
54
55
56
# Checks for programs.

AC_PROG_CC
57
AC_USE_SYSTEM_EXTENSIONS
58
AC_PROG_LIBTOOL
Olivier Crête's avatar
import  
Olivier Crête committed
59

60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Check Operating System
AC_MSG_CHECKING([operating system])
case "$host" in
	*-*-*mingw*|*-*-*cygwin*)
		platform=win32
		AC_MSG_RESULT($platform)
		;;
	*)
		platform=linux/other
		AC_MSG_RESULT($platform)
		;;
esac

AM_CONDITIONAL([WINDOWS], [test "$platform" = "win32"])
74

75
76
77
# Checks for compiler features

AC_C_RESTRICT
78
AC_C_VARARRAYS
79
80
AC_HEADER_ASSERT
AC_HEADER_STDBOOL
81
82
83
84
85
86
AH_VERBATIM([_FORTIFY_SOURCE], 
[/* Define to `2' to get GNU/libc warnings. */
/* Only define if -O1 or more is enabled */
#if defined __OPTIMIZE__ && __OPTIMIZE__ > 0
# define _FORTIFY_SOURCE 2
#endif])
87
AC_DEFINE([NICEAPI_EXPORT], [ ], [Public library function implementation])
88
89
AC_CHECK_HEADERS([arpa/inet.h net/in.h])
AC_CHECK_HEADERS([ifaddrs.h], \
90
91
		      [AC_DEFINE(HAVE_GETIFADDRS, [1], \
		       [Whether getifaddrs() is available on the system])])
92

93
LIBNICE_CFLAGS="-Wall"
94
dnl if asked for, add -Werror if supported
95
96
if test "x$LIBNICE_RELEASE" != "xyes"; then
  LIBNICE_CFLAGS="$LIBNICE_CFLAGS -Werror"
97
98
fi

99
100
AC_SUBST(LIBNICE_CFLAGS)
AC_MSG_NOTICE([set LIBNICE_CFLAGS to $LIBNICE_CFLAGS])
101

Olivier Crête's avatar
import  
Olivier Crête committed
102
# Checks for libraries.
103
AC_CHECK_LIB(rt, clock_gettime, [LIBRT="-lrt"], [LIBRT=""])
104
AC_CHECK_FUNCS([poll])
105
106
AC_SUBST(LIBRT)

107
PKG_CHECK_MODULES(GLIB, [dnl
108
109
110
	glib-2.0 >= 2.13 dnl
	gobject-2.0 >= 2.13 dnl
	gthread-2.0 >= 2.13 dnl
Filippo Della Betta's avatar
Filippo Della Betta committed
111
	gio-2.0 >= 2.13 dnl
112
	])
Olivier Crête's avatar
import  
Olivier Crête committed
113

114
AC_ARG_WITH(gstreamer, 
115
	AC_HELP_STRING([--with-gstreamer], [build GStreamer plugin]),
116
117
118
	[with_gstreamer=${withval}],
	[with_gstreamer=auto])

119
120
121
122
123
AC_ARG_WITH(gstreamer-0.10, 
	AC_HELP_STRING([--with-gstreamer-0.10], [build GStreamer 0.10 plugin]),
	[with_gstreamer010=${withval}],
	[with_gstreamer010=auto])

124
AS_IF([test "$with_gstreamer" != no], [
125
  
126
	PKG_CHECK_MODULES(GST, [
127
128
		gstreamer-1.0 >= 0.11.91
		gstreamer-base-1.0 >= 0.11.91
129
		],
130
131
		[
		with_gstreamer=yes
Sjoerd Simons's avatar
Sjoerd Simons committed
132
		GST_MAJORMINOR=1.0
133
		gstplugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
134
		],
135
		[
136
		AS_IF([test "$with_gstreamer" = yes], [
137
			AC_MSG_ERROR([GStreamer 1.0 support was requested but GStreamer 1.0 libraries are not available])
138
		])
139
140
141

		with_gstreamer=no
		])
142
])
143

144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
AS_IF([test "$with_gstreamer010" != no], [
  
	PKG_CHECK_MODULES(GST010, [
		gstreamer-0.10 >= 0.10.10
		gstreamer-base-0.10 >= 0.10.10
		],
		[
		with_gstreamer010=yes
		GST_MAJORMINOR=0.10
		gstplugin010dir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
		],
		[
		AS_IF([test "$with_gstreamer010" = yes], [
			AC_MSG_ERROR([GStreamer 0.10 support was requested but GStreamer 0.10 libraries are not available])
		])

		with_gstreamer010=no
		])
])

164
AC_SUBST(gstplugindir)
165
AC_SUBST(gstplugin010dir)
166

167
AM_CONDITIONAL(WITH_GSTREAMER, test "$with_gstreamer" = yes)
168
AM_CONDITIONAL(WITH_GSTREAMER010, test "$with_gstreamer010" = yes)
169

170
171
GUPNP_IGD_REQUIRED=0.1.2

Youness Alaoui's avatar
Youness Alaoui committed
172
173
174
175
176
177
178
179
180
181
182
AC_ARG_ENABLE([gupnp],
        AC_HELP_STRING([--disable-gupnp], [Disable GUPnP IGD support]),
        [case "${enableval}" in
            yes) WANT_GUPNP=yes ;;
            no)  WANT_GUPNP=no ;;
            *) AC_MSG_ERROR(bad value ${enableval} for --enable-gupnp) ;;
        esac],
        WANT_GUPNP=test)

HAVE_GUPNP=no
if test "x$WANT_GUPNP" != "xno"; then
183
   PKG_CHECK_MODULES(GUPNP, gupnp-igd-1.0 >= $GUPNP_IGD_REQUIRED,
Youness Alaoui's avatar
Youness Alaoui committed
184
185
186
187
188
189
190
191
192
193
194
195
196
    [ HAVE_GUPNP=yes ],
    [ HAVE_GUPNP=no ])
fi
if test "x$WANT_GUPNP" = "xyes" && test "x$HAVE_GUPNP" = "xno"; then
   AC_ERROR([Requested GUPnP IGD, but it is not available])
fi

if test "x$HAVE_GUPNP" = "xyes"; then
   AC_DEFINE(HAVE_GUPNP,,[Have the GUPnP IGD library])
fi

AC_SUBST(HAVE_GUPNP)

197
198
199
200
201
202
203
204
205
206
207
208
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)

Apostolos Syropoulos's avatar
Apostolos Syropoulos committed
209
210
211
212
213
214
215
216
case $host_os in
  solaris*)
    LDFLAGS="$LDFLAGS -lsocket -lnls"
    ;;
  *)
    ;;
esac

Youness Alaoui's avatar
Youness Alaoui committed
217
# check for gtk-doc
218
m4_ifdef([GTK_DOC_CHECK], [
Youness Alaoui's avatar
Youness Alaoui committed
219
GTK_DOC_CHECK(1.9)
220
221
222
],[
AM_CONDITIONAL([ENABLE_GTK_DOC], false)
])
Youness Alaoui's avatar
Youness Alaoui committed
223
AC_CONFIG_MACRO_DIR(m4)
224

Olivier Crête's avatar
import  
Olivier Crête committed
225
226
AC_OUTPUT