forked from meetecho/janus-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
368 lines (320 loc) · 11.6 KB
/
configure.ac
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
AC_INIT([Janus Gateway],[0.0.9],[https://github.com/meetecho/janus-gateway],[janus-gateway],[https://janus.conf.meetecho.com])
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_MACRO_DIR([m4])
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_SILENT_RULES([yes])
AC_GNU_SOURCE
AC_PROG_CC
LT_PREREQ([2.2])
LT_INIT
case "$host_os" in
darwin*)
LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/local/opt/openssl/lib"
AM_CONDITIONAL([DARWIN_OS], true)
AM_CONDITIONAL([HAS_DTLS_WINDOW_SIZE], false)
;;
*)
AM_CONDITIONAL([DARWIN_OS], false)
AM_CONDITIONAL([HAS_DTLS_WINDOW_SIZE], true)
esac
glib_version=2.32
ssl_version=1.0.1
##
# Janus
##
AC_ARG_ENABLE([docs],
[AS_HELP_STRING([--disable-docs],
[Disable building documentation])],
[],
[enable_docs=yes])
AC_ARG_ENABLE([websockets],
[AS_HELP_STRING([--disable-websockets],
[Disable WebSockets support])],
[],
[enable_websockets=yes])
AC_ARG_ENABLE([data-channels],
[AS_HELP_STRING([--disable-data-channels],
[Disable DataChannels])],
[],
[enable_data_channels=yes])
AC_ARG_ENABLE([rabbitmq],
[AS_HELP_STRING([--disable-rabbitmq],
[Disable RabbitMQ integration])],
[],
[enable_rabbitmq=yes])
AC_ARG_ENABLE([turn-rest-api],
[AS_HELP_STRING([--disable-turn-rest-api],
[Disable TURN REST API client (via libcurl)])],
[],
[enable_turn_rest_api=yes])
PKG_CHECK_MODULES([JANUS],
[
glib-2.0 >= glib_version
nice
libmicrohttpd
jansson
libssl >= ssl_version
libcrypto
sofia-sip-ua
ini_config
])
AC_SUBST(JANUS_MANUAL_LIBS)
AC_CHECK_LIB([nice],
[nice_agent_set_port_range],
[AC_DEFINE(HAVE_PORTRANGE)],
[AC_MSG_NOTICE([libnice version does not have nice_agent_set_port_range])]
)
AC_CHECK_LIB([nice],
[nice_address_equal_no_port],
[AC_DEFINE(HAVE_LIBNICE_TCP)],
[AC_MSG_NOTICE([libnice version does not support TCP candidates])]
)
AC_CHECK_LIB([dl],
[dlopen],
[JANUS_MANUAL_LIBS+=" -ldl"],
[AC_MSG_ERROR([libdl not found.])])
AC_CHECK_LIB([srtp],
[srtp_init],
[JANUS_MANUAL_LIBS+=" -lsrtp"],
[AC_MSG_ERROR([libsrtp not found.])])
AC_CHECK_LIB([websockets_shared],
[libwebsocket_get_internal_extensions],
[
AS_IF([test "x$enable_websockets" = "xyes"],
[
AC_DEFINE(HAVE_WEBSOCKETS)
JANUS_MANUAL_LIBS+=" -lwebsockets_shared"
])
],
[
AC_CHECK_LIB([websockets],
[libwebsocket_get_internal_extensions],
[
AS_IF([test "x$enable_websockets" = "xyes"],
[
AC_DEFINE(HAVE_WEBSOCKETS)
JANUS_MANUAL_LIBS+=" -lwebsockets"
])
],
[
AS_IF([test "x$enable_websockets" = "xyes"],
[AC_MSG_ERROR([libwebsockets not found. See README.md for installation instructions or use --disable-websockets])])
])
])
AM_CONDITIONAL([ENABLE_WEBSOCKETS], [test "x$enable_websockets" = "xyes"])
AC_CHECK_LIB([usrsctp],
[usrsctp_finish],
[
AS_IF([test "x$enable_data_channels" = "xyes"],
[
AC_DEFINE(HAVE_SCTP)
JANUS_MANUAL_LIBS+=" -lusrsctp"
])
],
[
AS_IF([test "x$enable_data_channels" = "xyes"],
[AC_MSG_ERROR([libusrsctp not found. See README.md for installation instructions or use --disable-data-channels])])
])
AM_CONDITIONAL([ENABLE_SCTP], [test "x$enable_data_channels" = "xyes"])
AC_CHECK_LIB([rabbitmq],
[amqp_error_string2],
[
AS_IF([test "x$enable_rabbitmq" = "xyes"],
[
AC_DEFINE(HAVE_RABBITMQ)
JANUS_MANUAL_LIBS+=" -lrabbitmq"
])
],
[
AS_IF([test "x$enable_rabbitmq" = "xyes"],
[AC_MSG_ERROR([rabbitmq-c not found. See README.md for installation instructions or use --disable-rabbitmq])])
])
AM_CONDITIONAL([ENABLE_RABBITMQ], [test "x$enable_rabbitmq" = "xyes"])
PKG_CHECK_MODULES([LIBCURL],
[libcurl],
[
AS_IF(
[test "x$enable_turn_rest_api" = "xyes"],
[
AC_DEFINE(HAVE_LIBCURL)
JANUS_MANUAL_LIBS+=" -lcurl"
enable_turn_rest_api=yes
],
[
enable_turn_rest_api=no
])
],
[
AC_MSG_NOTICE(libcurl not found. The TURN REST API client will not be built.)
enable_turn_rest_api=no
])
AM_CONDITIONAL([ENABLE_TURN_REST_API], [test "x$enable_turn_rest_api" = "xyes"])
AC_CHECK_PROG([DOXYGEN],
[doxygen],
[doxygen])
AC_CHECK_PROG([DOT],
[dot],
[dot])
AS_IF([test -z "$DOXYGEN" -o -z "$DOT"],
[
AS_IF([test "x$enable_docs" = "xyes"],
[AC_MSG_ERROR([doxygen or dot not found. See README.md for installation instructions or use --disable-docs])])
])
AM_CONDITIONAL([ENABLE_DOCS], [test "x$enable_docs" = "xyes"])
AC_CHECK_PROG([GENGETOPT_CHECK],
[gengetopt],
[yes])
if test x"$GENGETOPT_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install gengetopt before installing.])
fi
##
# Plugins
##
PKG_CHECK_MODULES([PLUGINS],
[
glib-2.0 >= glib_version
sofia-sip-ua
jansson
ini_config
])
AC_ARG_ENABLE([plugin-audiobridge],
[AS_HELP_STRING([--disable-plugin-audiobridge],
[Disable audiobridge plugin])],
[],
[enable_plugin_audiobridge=yes])
AC_ARG_ENABLE([plugin-echotest],
[AS_HELP_STRING([--disable-plugin-echotest],
[Disable echotest plugin])],
[],
[enable_plugin_echotest=yes])
AC_ARG_ENABLE([plugin-recordplay],
[AS_HELP_STRING([--disable-plugin-recordplay],
[Disable record&play plugin])],
[],
[enable_plugin_recordplay=yes])
AC_ARG_ENABLE([plugin-sip],
[AS_HELP_STRING([--disable-plugin-sip],
[Disable sip plugin])],
[],
[enable_plugin_sip=yes])
AC_ARG_ENABLE([plugin-streaming],
[AS_HELP_STRING([--disable-plugin-streaming],
[Disable streaming plugin])],
[],
[enable_plugin_streaming=yes])
AC_ARG_ENABLE([plugin-videocall],
[AS_HELP_STRING([--disable-plugin-videocall],
[Disable videocall plugin])],
[],
[enable_plugin_videocall=yes])
AC_ARG_ENABLE([plugin-videoroom],
[AS_HELP_STRING([--disable-plugin-videoroom],
[Disable videoroom plugin])],
[],
[enable_plugin_videoroom=yes])
AC_ARG_ENABLE([plugin-voicemail],
[AS_HELP_STRING([--disable-plugin-voicemail],
[Disable voicemail plugin])],
[],
[enable_plugin_voicemail=yes])
PKG_CHECK_MODULES([OPUS],
[opus],
[],
[
AC_MSG_NOTICE(libopus not found. The audiobridge plugin will not be built.)
enable_plugin_audiobridge=no
])
PKG_CHECK_MODULES([OGG],
[ogg],
[],
[
AC_MSG_NOTICE(libogg not found. The voicemail plugin will not be built.)
enable_plugin_voicemail=no
])
AM_CONDITIONAL([ENABLE_PLUGIN_AUDIOBRIDGE], [test "x$enable_plugin_audiobridge" = "xyes"])
AM_CONDITIONAL([ENABLE_PLUGIN_ECHOTEST], [test "x$enable_plugin_echotest" = "xyes"])
AM_CONDITIONAL([ENABLE_PLUGIN_RECORDPLAY], [test "x$enable_plugin_recordplay" = "xyes"])
AM_CONDITIONAL([ENABLE_PLUGIN_SIP], [test "x$enable_plugin_sip" = "xyes"])
AM_CONDITIONAL([ENABLE_PLUGIN_STREAMING], [test "x$enable_plugin_streaming" = "xyes"])
AM_CONDITIONAL([ENABLE_PLUGIN_VIDEOCALL], [test "x$enable_plugin_videocall" = "xyes"])
AM_CONDITIONAL([ENABLE_PLUGIN_VIDEOROOM], [test "x$enable_plugin_videoroom" = "xyes"])
AM_CONDITIONAL([ENABLE_PLUGIN_VOICEMAIL], [test "x$enable_plugin_voicemail" = "xyes"])
##
# Post-processing
##
AC_ARG_ENABLE([post-processing],
[AS_HELP_STRING([--enable-post-processing],
[Enable building post-processing utility])],
[],
[enable_post_processing=no])
AS_IF([test "x$enable_post_processing" = "xyes"],
[PKG_CHECK_MODULES([POST_PROCESSING],
[
glib-2.0,
jansson,
libavutil,
libavcodec,
libavformat,
ogg
])
])
AM_CONDITIONAL([ENABLE_POST_PROCESSING], [test "x$enable_post_processing" = "xyes"])
AC_CONFIG_FILES([
Makefile
html/Makefile
docs/Makefile
])
JANUS_MANUAL_LIBS+=" -pthread"
AC_OUTPUT
##
# Summary
##
echo
AM_COND_IF([ENABLE_RABBITMQ],
[echo "RabbitMQ support: yes"],
[echo "RabbitMQ support: no"])
AM_COND_IF([ENABLE_WEBSOCKETS],
[echo "WebSockets support: yes"],
[echo "WebSockets support: no"])
AM_COND_IF([ENABLE_SCTP],
[echo "DataChannels support: yes"],
[echo "DataChannels support: no"])
AM_COND_IF([ENABLE_POST_PROCESSING],
[echo "Recordings post-processor: yes"],
[echo "Recordings post-processor: no"])
AM_COND_IF([ENABLE_TURN_REST_API],
[echo "TURN REST API client: yes"],
[echo "TURN REST API client: no"])
AM_COND_IF([ENABLE_DOCS],
[echo "Doxygen documentation: yes"],
[echo "Doxygen documentation: no"])
echo "Plugins:"
AM_COND_IF([ENABLE_PLUGIN_ECHOTEST],
[echo " Echo Test: yes"],
[echo " Echo Test: no"])
AM_COND_IF([ENABLE_PLUGIN_STREAMING],
[echo " Streaming: yes"],
[echo " Streaming: no"])
AM_COND_IF([ENABLE_PLUGIN_VIDEOCALL],
[echo " Video Call: yes"],
[echo " Video Call: no"])
AM_COND_IF([ENABLE_PLUGIN_SIP],
[echo " SIP Gateway: yes"],
[echo " SIP Gateway: no"])
AM_COND_IF([ENABLE_PLUGIN_AUDIOBRIDGE],
[echo " Audio Bridge: yes"],
[echo " Audio Bridge: no"])
AM_COND_IF([ENABLE_PLUGIN_VIDEOROOM],
[echo " Video Room: yes"],
[echo " Video Room: no"])
AM_COND_IF([ENABLE_PLUGIN_VOICEMAIL],
[echo " Voice Mail: yes"],
[echo " Voice Mail: no"])
AM_COND_IF([ENABLE_PLUGIN_RECORDPLAY],
[echo " Record&Play: yes"],
[echo " Record&Play: no"])
echo
echo "If this configuration is ok for you, do a make to start building Janus"
echo