Statistics
| Branch: | Revision:

janus-gateway / configure.ac @ f70f4528

History | View | Annotate | Download (27.2 KB)

1
AC_INIT([Janus Gateway],[0.2.3],[https://github.com/meetecho/janus-gateway],[janus-gateway],[https://janus.conf.meetecho.com])
2
AC_CONFIG_AUX_DIR([.])
3
AC_CONFIG_MACRO_DIR([m4])
4

    
5
AC_ENABLE_SHARED(yes)
6
AC_ENABLE_STATIC(no)
7

    
8
AM_INIT_AUTOMAKE([foreign subdir-objects])
9
AM_SILENT_RULES([yes])
10

    
11
AC_GNU_SOURCE
12

    
13
AC_PROG_CC
14

    
15
LT_PREREQ([2.2])
16
LT_INIT
17

    
18
case "$host_os" in
19
darwin*)
20
	CFLAGS="$CFLAGS -I/usr/local/opt/openssl/include -I/usr/local/include"
21
	LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/opt/local/lib -L/usr/local/libsrtp/lib"
22
	AM_CONDITIONAL([DARWIN_OS], true)
23
	AM_CONDITIONAL([HAS_DTLS_WINDOW_SIZE], false)
24
;;
25
*)
26
	AM_CONDITIONAL([DARWIN_OS], false)
27
	AM_CONDITIONAL([HAS_DTLS_WINDOW_SIZE], true)
28
esac
29

    
30
glib_version=2.34
31
ssl_version=1.0.1
32

    
33
##
34
# Janus
35
##
36

    
37
AC_ARG_ENABLE([docs],
38
              [AS_HELP_STRING([--enable-docs],
39
                              [Enable building documentation])],
40
              [],
41
              [enable_docs=no])
42

    
43
AC_ARG_ENABLE([data-channels],
44
              [AS_HELP_STRING([--disable-data-channels],
45
                              [Disable DataChannels])],
46
              [],
47
              [enable_data_channels=maybe])
48

    
49
AC_ARG_ENABLE([boringssl],
50
              [AS_HELP_STRING([--enable-boringssl],
51
                              [Use BoringSSL instead of OpenSSL])],
52
              [
53
                case "${enableval}" in
54
                  yes) boringssl_dir=/opt/boringssl ;;
55
                  no)  boringssl_dir= ;;
56
                  *) boringssl_dir=${enableval} ;;
57
                esac
58
              ],
59
              [boringssl_dir=])
60

    
61
AC_ARG_ENABLE([libsrtp2],
62
              [AS_HELP_STRING([--enable-libsrtp2],
63
                              [Use libsrtp 2.0.x instead of libsrtp 1.5.x])],
64
              [],
65
              [enable_libsrtp2=maybe])
66

    
67
AC_ARG_ENABLE([dtls-settimeout],
68
              [AS_HELP_STRING([--enable-dtls-settimeout],
69
                              [Use DTLSv1_set_initial_timeout_duration (only available in recent BoringSSL versions)])],
70
              [],
71
              [enable_dtls_settimeout=no])
72

    
73
AC_ARG_ENABLE([turn-rest-api],
74
              [AS_HELP_STRING([--disable-turn-rest-api],
75
                              [Disable TURN REST API client (via libcurl)])],
76
              [],
77
              [enable_turn_rest_api=maybe])
78

    
79
AC_ARG_ENABLE([all-plugins],
80
              [AS_HELP_STRING([--disable-all-plugins],
81
                              [Disable building all plugins (except those manually enabled)])],
82
              [
83
               AS_IF([test "x$enable_plugin_audiobridge" != "xyes"],
84
                     [enable_plugin_audiobridge=no])
85
               AS_IF([test "x$enable_plugin_echotest" != "xyes"],
86
                     [enable_plugin_echotest=no])
87
               AS_IF([test "x$enable_plugin_recordplay" != "xyes"],
88
                     [enable_plugin_recordplay=no])
89
               AS_IF([test "x$enable_plugin_sip" != "xyes"],
90
                     [enable_plugin_sip=no])
91
               AS_IF([test "x$enable_plugin_sipre" != "xyes"],
92
                     [enable_plugin_sipre=no])
93
               AS_IF([test "x$enable_plugin_streaming" != "xyes"],
94
                     [enable_plugin_streaming=no])
95
               AS_IF([test "x$enable_plugin_textroom" != "xyes"],
96
                     [enable_plugin_textroom=no])
97
               AS_IF([test "x$enable_plugin_videocall" != "xyes"],
98
                     [enable_plugin_videocall=no])
99
               AS_IF([test "x$enable_plugin_videoroom" != "xyes"],
100
                     [enable_plugin_videoroom=no])
101
               AS_IF([test "x$enable_plugin_voicemail" != "xyes"],
102
                     [enable_plugin_voicemail=no])
103
              ],
104
              [])
105

    
106
AC_ARG_ENABLE([all-transports],
107
              [AS_HELP_STRING([--disable-all-transports],
108
                              [Disable building all transports (except those manually enabled)])],
109
              [
110
               AS_IF([test "x$enable_rest" != "xyes"],
111
                     [enable_rest=no])
112
               AS_IF([test "x$enable_websockets" != "xyes"],
113
                     [enable_websockets=no])
114
               AS_IF([test "x$enable_rabbitmq" != "xyes"],
115
                     [enable_rabbitmq=no])
116
               AS_IF([test "x$enable_mqtt" != "xyes"],
117
                     [enable_mqtt=no])
118
               AS_IF([test "x$enable_unix_sockets" != "xyes"],
119
                     [enable_unix_sockets=no])
120
              ],
121
              [])
122

    
123
AC_ARG_ENABLE([all-handlers],
124
              [AS_HELP_STRING([--disable-all-handlers],
125
                              [Disable building all event handlers (except those manually enabled)])],
126
              [
127
               AS_IF([test "x$enable_sample_event_handler" != "xyes"],
128
                     [enable_sample_event_handler=no])
129
              ],
130
              [])
131

    
132
AC_ARG_ENABLE([rest],
133
              [AS_HELP_STRING([--disable-rest],
134
                              [Disable REST (HTTP/HTTPS) support])],
135
              [AS_IF([test "x$enable_rest" != "xyes"],
136
                     [enable_rest=no])],
137
              [enable_rest=maybe])
138

    
139
AC_ARG_ENABLE([websockets],
140
              [AS_HELP_STRING([--disable-websockets],
141
                              [Disable WebSockets support])],
142
              [AS_IF([test "x$enable_websockets" != "xyes"],
143
                     [enable_websockets=no])],
144
              [enable_websockets=maybe])
145

    
146
AC_ARG_ENABLE([rabbitmq],
147
              [AS_HELP_STRING([--disable-rabbitmq],
148
                              [Disable RabbitMQ integration])],
149
              [AS_IF([test "x$enable_rabbitmq" != "xyes"],
150
                     [enable_rabbitmq=no])],
151
              [enable_rabbitmq=maybe])
152

    
153
AC_ARG_ENABLE([mqtt],
154
              [AS_HELP_STRING([--disable-mqtt],
155
                              [Disable MQTT integration])],
156
              [AS_IF([test "x$enable_mqtt" != "xyes"],
157
                     [enable_mqtt=no])],
158
              [enable_mqtt=maybe])
159

    
160
AC_ARG_ENABLE([unix-sockets],
161
              [AS_HELP_STRING([--disable-unix-sockets],
162
                              [Disable Unix Sockets integration])],
163
              [AS_IF([test "x$enable_unix_sockets" != "xyes"],
164
                     [enable_unix_sockets=no])],
165
              [enable_unix_sockets=maybe])
166

    
167
AC_ARG_ENABLE([sample-event-handler],
168
              [AS_HELP_STRING([--disable-sample-event-handler],
169
                              [Disable sample event handler (HTTP POST) ])],
170
              [AS_IF([test "x$enable_sample_event_handler" != "xyes"],
171
                     [enable_sample_event_handler=no])],
172
              [enable_sample_event_handler=maybe])
173

    
174
PKG_CHECK_MODULES([JANUS],
175
                  [
176
                    glib-2.0 >= $glib_version
177
                    nice
178
                    jansson
179
                    libssl >= $ssl_version
180
                    libcrypto
181
                  ])
182
JANUS_MANUAL_LIBS+=" -lm"
183
AC_SUBST(JANUS_MANUAL_LIBS)
184

    
185
AS_IF([test "x${boringssl_dir}" != "x"],
186
	  [echo "Trying to use BoringSSL instead of OpenSSL...";
187
	   AC_MSG_NOTICE([BoringSSL directory is ${boringssl_dir}])
188
	   CFLAGS="$CFLAGS -I${boringssl_dir}/include";
189
	   BORINGSSL_CFLAGS=" -I${boringssl_dir}/include";
190
       AC_SUBST(BORINGSSL_CFLAGS)
191
	   BORINGSSL_LIBS=" -L${boringssl_dir}/lib";
192
       AC_SUBST(BORINGSSL_LIBS)
193
	   AC_CHECK_HEADERS([${boringssl_dir}/include/openssl/opensslconf.h],
194
	                    [AC_DEFINE(HAVE_BORINGSSL)],
195
	                    [AC_MSG_ERROR([BoringSSL headers not found in ${boringssl_dir}, use --disable-boringssl if you want to use OpenSSL instead])])
196
      ])
197
AM_CONDITIONAL([ENABLE_BORINGSSL], [test "x${boringssl_dir}" != "x"])
198

    
199
AS_IF([test "x$enable_dtls_settimeout" = "xyes"],
200
      [
201
      AC_DEFINE(HAVE_DTLS_SETTIMEOUT)
202
      AC_MSG_NOTICE([Assuming DTLSv1_set_initial_timeout_duration is available])
203
      ])
204
AM_CONDITIONAL([ENABLE_DTLS_SETTIMEOUT], [test "x$enable_dtls_settimeout" = "xyes"])
205

    
206
AC_CHECK_LIB([nice],
207
             [nice_agent_set_port_range],
208
             [AC_DEFINE(HAVE_PORTRANGE)],
209
             [AC_MSG_NOTICE([libnice version does not have nice_agent_set_port_range])]
210
             )
211

    
212
AC_CHECK_LIB([nice],
213
             [nice_address_equal_no_port],
214
             [AC_DEFINE(HAVE_LIBNICE_TCP)],
215
             [AC_MSG_NOTICE([libnice version does not support TCP candidates])]
216
             )
217

    
218
AC_CHECK_LIB([dl],
219
             [dlopen],
220
             [JANUS_MANUAL_LIBS+=" -ldl"],
221
             [AC_MSG_ERROR([libdl not found.])])
222

    
223
AM_CONDITIONAL([ENABLE_LIBSRTP_2], false)
224
AS_IF([test "x$enable_libsrtp2" != "xno"],
225
      [AC_CHECK_LIB([srtp2],
226
                    [srtp_init],
227
                    [
228
                      AC_CHECK_HEADER([srtp2/srtp.h],
229
                                      [
230
                                        AC_DEFINE(HAVE_SRTP_2)
231
                                        JANUS_MANUAL_LIBS+=" -lsrtp2"
232
                                        enable_libsrtp2=yes
233
                                        AM_CONDITIONAL([ENABLE_LIBSRTP_2], true)
234
                                      ],
235
                                      [
236
                                        AS_IF([test "x$enable_libsrtp2" = "xyes"],
237
                                              [AC_MSG_ERROR([libsrtp2 headers not found. See README.md for installation instructions or use --disable-libsrtp-2 to try and autodetect libsrtp 1.5.x instead])])
238
                                      ])
239
                    ],
240
                    [
241
                      AS_IF([test "x$enable_libsrtp2" = "xyes"],
242
                            [AC_MSG_ERROR([libsrtp2 not found. See README.md for installation instructions or use --disable-libsrtp-2 to try and autodetect libsrtp 1.5.x instead])])
243
                    ])
244
      ])
245
AM_COND_IF([ENABLE_LIBSRTP_2],
246
           [],
247
           [AC_CHECK_LIB([srtp],
248
                         [srtp_init],
249
                         [
250
                           AC_CHECK_HEADER([srtp/srtp.h],
251
                                           [
252
                                             JANUS_MANUAL_LIBS+=" -lsrtp"
253
                                             enable_libsrtp2=no
254
                                             PKG_CHECK_MODULES([SRTP15X],
255
                                                               [
256
                                                                 libsrtp >= 1.5.0
257
                                                               ])
258

    
259
                                           ],
260
                                           [AC_MSG_ERROR([libsrtp and libsrtp2 headers not found. See README.md for installation instructions])])
261
                         ],
262
                         [AC_MSG_ERROR([libsrtp and libsrtp2 not found. See README.md for installation instructions])])
263
           ])
264

    
265
AC_CHECK_LIB([usrsctp],
266
             [usrsctp_finish],
267
             [
268
               AS_IF([test "x$enable_data_channels" != "xno"],
269
               [
270
                  AC_DEFINE(HAVE_SCTP)
271
                  JANUS_MANUAL_LIBS+=" -lusrsctp"
272
                  enable_data_channels=yes
273
               ])
274
             ],
275
             [
276
               AS_IF([test "x$enable_data_channels" = "xyes"],
277
                     [AC_MSG_ERROR([libusrsctp not found. See README.md for installation instructions or use --disable-data-channels])])
278
             ])
279
AM_CONDITIONAL([ENABLE_SCTP], [test "x$enable_data_channels" = "xyes"])
280

    
281
PKG_CHECK_MODULES([LIBCURL],
282
                  [libcurl],
283
                  [
284
                    AS_IF(
285
                      [test "x$enable_turn_rest_api" != "xno"],
286
                      [
287
                        AC_DEFINE(HAVE_LIBCURL)
288
                        JANUS_MANUAL_LIBS+=" -lcurl"
289
                        enable_turn_rest_api=yes
290
                      ])
291
                    AS_IF([test "x$enable_sample_event_handler" != "xno"],
292
                      [
293
                        AC_DEFINE(HAVE_SAMPLEEVH)
294
                        JANUS_MANUAL_LIBS+=" -lcurl"
295
                        enable_sample_event_handler=yes
296
                      ])
297
                  ],
298
                  [
299
                    AS_IF([test "x$enable_turn_rest_api" = "xyes"],
300
                          [AC_MSG_ERROR([libcurl not found. See README.md for installation instructions or use --disable-turn-rest-api])])
301
                    AS_IF([test "x$enable_sample_event_handler" = "xyes"],
302
                          [AC_MSG_ERROR([libcurl not found. See README.md for installation instructions or use --disable-sample-event-handler])])
303
                  ])
304
AM_CONDITIONAL([ENABLE_TURN_REST_API], [test "x$enable_turn_rest_api" = "xyes"])
305
AM_CONDITIONAL([ENABLE_SAMPLEEVH], [test "x$enable_sample_event_handler" = "xyes"])
306

    
307
AC_CHECK_PROG([DOXYGEN],
308
              [doxygen],
309
              [doxygen])
310
AC_CHECK_PROG([DOT],
311
              [dot],
312
              [dot])
313
AS_IF([test -z "$DOXYGEN" -o -z "$DOT"],
314
      [
315
        AS_IF([test "x$enable_docs" = "xyes"],
316
              [AC_MSG_ERROR([doxygen or dot not found. See README.md for installation instructions or remove --enable-docs])])
317
      ])
318
AM_CONDITIONAL([ENABLE_DOCS], [test "x$enable_docs" = "xyes"])
319

    
320
AC_CHECK_PROG([GENGETOPT_CHECK],
321
              [gengetopt],
322
              [yes])
323
if test x"$GENGETOPT_CHECK" != x"yes" ; then
324
    AC_MSG_ERROR([Please install gengetopt before installing.])
325
fi
326

    
327

    
328
##
329
# Transports
330
##
331

    
332
PKG_CHECK_MODULES([TRANSPORTS],
333
                  [
334
                    glib-2.0 >= $glib_version
335
                    jansson
336
                  ])
337

    
338
PKG_CHECK_MODULES([MHD],
339
                  [libmicrohttpd],
340
                  [
341
                    AS_IF([test "x$enable_rest" = "xmaybe"],
342
                          [enable_rest=yes])
343
                  ],
344
                  [
345
                    AS_IF([test "x$enable_rest" = "xyes"],
346
                          [AC_MSG_ERROR([libmicrohttpd not found. See README.md for installation instructions or use --disable-rest])])
347
                  ])
348
AC_SUBST([MHD_CFLAGS])
349
AC_SUBST([MHD_LIBS])
350
AM_CONDITIONAL([ENABLE_REST], [test "x$enable_rest" = "xyes"])
351

    
352
AM_CONDITIONAL([ENABLE_WEBSOCKETS_NEWAPI], false)
353
AC_CHECK_LIB([websockets],
354
             [libwebsocket_create_context],
355
             [
356
               AS_IF([test "x$enable_websockets" != "xno"],
357
               [
358
                  AC_DEFINE(HAVE_WEBSOCKETS)
359
                  WS_MANUAL_LIBS="-lwebsockets"
360
                  enable_websockets=yes
361
               ])
362
             ],
363
             [
364
				AC_CHECK_LIB([websockets],
365
							 [lws_create_context],
366
							 [
367
							   AS_IF([test "x$enable_websockets" != "xno"],
368
							   [
369
								  AC_DEFINE(HAVE_WEBSOCKETS)
370
								  AC_DEFINE(HAVE_LIBWEBSOCKETS_NEWAPI)
371
								  AM_CONDITIONAL([ENABLE_WEBSOCKETS_NEWAPI], true)
372
								  WS_MANUAL_LIBS="-lwebsockets"
373
								  enable_websockets=yes
374
							   ])
375
							 ],
376
							 [
377
							   AS_IF([test "x$enable_websockets" = "xyes"],
378
									 [AC_MSG_ERROR([libwebsockets not found. See README.md for installation instructions or use --disable-websockets])])
379
							 ])
380
             ])
381
AM_CONDITIONAL([ENABLE_WEBSOCKETS], [test "x$enable_websockets" = "xyes"])
382
AC_SUBST(WS_MANUAL_LIBS)
383

    
384
AC_CHECK_LIB([rabbitmq],
385
             [amqp_error_string2],
386
             [
387
               AS_IF([test "x$enable_rabbitmq" != "xno"],
388
               [
389
                  AC_DEFINE(HAVE_RABBITMQ)
390
                  enable_rabbitmq=yes
391
               ])
392
             ],
393
             [
394
               AS_IF([test "x$enable_rabbitmq" = "xyes"],
395
                     [AC_MSG_ERROR([rabbitmq-c not found. See README.md for installation instructions or use --disable-rabbitmq])])
396
             ])
397
AC_CHECK_LIB([paho-mqtt3a],
398
             [MQTTAsync_create],
399
             [
400
               AS_IF([test "x$enable_mqtt" != "xno"],
401
               [
402
                  AC_DEFINE(HAVE_MQTT)
403
                  enable_mqtt=yes
404
               ])
405
             ],
406
             [
407
               AS_IF([test "x$enable_mqtt" = "xyes"],
408
                     [AC_MSG_ERROR([paho c client not found. See README.md for installation instructions or use --disable-mqtt])])
409
             ])
410
AM_CONDITIONAL([ENABLE_RABBITMQ], [test "x$enable_rabbitmq" = "xyes"])
411
AM_CONDITIONAL([ENABLE_MQTT], [test "x$enable_mqtt" = "xyes"])
412

    
413
AC_TRY_COMPILE([
414
               #include <stdlib.h>
415
               #include <sys/socket.h>
416
               #include <sys/un.h>
417
               void test() {
418
                 int pfd = socket(PF_UNIX, SOCK_SEQPACKET | SOCK_NONBLOCK, 0);
419
                 if(pfd < 0)
420
                   exit(1);
421
               }],
422
               [],
423
               [
424
                 AS_IF([test "x$enable_unix_sockets" != "xno"],
425
                 [
426
                    AC_DEFINE(HAVE_PFUNIX)
427
                    enable_unix_sockets=yes
428
                 ])
429
               ],
430
               [
431
                 AS_IF([test "x$enable_unix_sockets" = "xyes"],
432
                       [AC_MSG_ERROR([SOCK_SEQPACKET not defined in your OS. Use --disable-unix-sockets])])
433
               ])
434
AM_CONDITIONAL([ENABLE_PFUNIX], [test "x$enable_unix_sockets" = "xyes"])
435

    
436

    
437
##
438
# Plugins
439
##
440

    
441
PKG_CHECK_MODULES([PLUGINS],
442
                  [
443
                    glib-2.0 >= $glib_version
444
                    jansson
445
                  ])
446

    
447
AC_ARG_ENABLE([plugin-audiobridge],
448
              [AS_HELP_STRING([--disable-plugin-audiobridge],
449
                              [Disable audiobridge plugin])],
450
              [AS_IF([test "x$enable_plugin_audiobridge" != "xyes"],
451
                     [enable_plugin_audiobridge=no])],
452
              [enable_plugin_audiobridge=maybe])
453

    
454
AC_ARG_ENABLE([plugin-echotest],
455
              [AS_HELP_STRING([--disable-plugin-echotest],
456
                              [Disable echotest plugin])],
457
              [AS_IF([test "x$enable_plugin_echotest" != "xyes"],
458
                     [enable_plugin_echotest=no])],
459
              [enable_plugin_echotest=yes])
460

    
461
AC_ARG_ENABLE([plugin-recordplay],
462
              [AS_HELP_STRING([--disable-plugin-recordplay],
463
                              [Disable record&play plugin])],
464
              [AS_IF([test "x$enable_plugin_recordplay" != "xyes"],
465
                     [enable_plugin_recordplay=no])],
466
              [enable_plugin_recordplay=yes])
467

    
468
AC_ARG_ENABLE([plugin-sip],
469
              [AS_HELP_STRING([--disable-plugin-sip],
470
                              [Disable sip plugin])],
471
              [AS_IF([test "x$enable_plugin_sip" != "xyes"],
472
                     [enable_plugin_sip=no])],
473
              [enable_plugin_sip=maybe])
474

    
475
AC_ARG_ENABLE([plugin-sipre],
476
              [AS_HELP_STRING([--disable-plugin-sipre],
477
                              [Disable sipre plugin])],
478
              [AS_IF([test "x$enable_plugin_sipre" != "xyes"],
479
                     [enable_plugin_sipre=no])],
480
              [enable_plugin_sipre=maybe])
481

    
482
AC_ARG_ENABLE([plugin-streaming],
483
              [AS_HELP_STRING([--disable-plugin-streaming],
484
                              [Disable streaming plugin])],
485
              [AS_IF([test "x$enable_plugin_streaming" != "xyes"],
486
                     [enable_plugin_streaming=no])],
487
              [enable_plugin_streaming=yes])
488

    
489
AC_ARG_ENABLE([plugin-textroom],
490
              [AS_HELP_STRING([--disable-plugin-textroom],
491
                              [Disable textroom plugin])],
492
              [AS_IF([test "x$enable_plugin_textroom" != "xyes"],
493
                     [enable_plugin_textroom=no])],
494
              [enable_plugin_textroom=yes])
495

    
496
AC_ARG_ENABLE([plugin-videocall],
497
              [AS_HELP_STRING([--disable-plugin-videocall],
498
                              [Disable videocall plugin])],
499
              [AS_IF([test "x$enable_plugin_videocall" != "xyes"],
500
                     [enable_plugin_videocall=no])],
501
              [enable_plugin_videocall=yes])
502

    
503
AC_ARG_ENABLE([plugin-videoroom],
504
              [AS_HELP_STRING([--disable-plugin-videoroom],
505
                              [Disable videoroom plugin])],
506
              [AS_IF([test "x$enable_plugin_videoroom" != "xyes"],
507
                     [enable_plugin_videoroom=no])],
508
              [enable_plugin_videoroom=yes])
509

    
510
AC_ARG_ENABLE([plugin-voicemail],
511
              [AS_HELP_STRING([--disable-plugin-voicemail],
512
                              [Disable voicemail plugin])],
513
              [AS_IF([test "x$enable_plugin_voicemail" != "xyes"],
514
                     [enable_plugin_voicemail=no])],
515
              [enable_plugin_voicemail=maybe])
516

    
517
PKG_CHECK_MODULES([SOFIA],
518
                  [sofia-sip-ua],
519
                  [
520
                    AS_IF([test "x$enable_plugin_sip" = "xmaybe"],
521
                          [enable_plugin_sip=yes])
522
                  ],
523
                  [
524
                    AS_IF([test "x$enable_plugin_sip" = "xyes"],
525
                          [AC_MSG_ERROR([sofia-sip-ua not found. See README.md for installation instructions or use --disable-plugin-sip])])
526
                  ])
527
AC_SUBST([SOFIA_CFLAGS])
528
AC_SUBST([SOFIA_LIBS])
529

    
530
PKG_CHECK_MODULES([LIBRE],
531
                  [libre],
532
                  [
533
                    AS_IF([test "x$enable_plugin_sipre" = "xmaybe"],
534
                          [
535
                           enable_plugin_sipre=yes
536
                           AC_CHECK_LIB([re],
537
                                        [sip_set_trace],
538
                                        [AC_DEFINE(HAVE_LIBRE_SIPTRACE)],
539
                                        [AC_MSG_NOTICE([libre version does not have sip_set_trace])]
540
                                       )
541
                          ])
542
                  ],
543
                  [
544
                    AS_IF([test "x$enable_plugin_sipre" = "xyes"],
545
                          [AC_MSG_ERROR([libre not found. See README.md for installation instructions or use --disable-plugin-sip])])
546
                  ])
547
AC_SUBST([SOFIA_CFLAGS])
548
AC_SUBST([SOFIA_LIBS])
549

    
550
PKG_CHECK_MODULES([OPUS],
551
                  [opus],
552
                  [
553
                    AS_IF([test "x$enable_plugin_audiobridge" = "xmaybe"],
554
                          [enable_plugin_audiobridge=yes])
555
                  ],
556
                  [
557
                    AS_IF([test "x$enable_plugin_audiobridge" = "xyes"],
558
                          [AC_MSG_ERROR([libopus not found. See README.md for installation instructions or use --disable-plugin-audiobridge])])
559
                  ])
560
AC_SUBST([OPUS_CFLAGS])
561
AC_SUBST([OPUS_LIBS])
562

    
563
PKG_CHECK_MODULES([OGG],
564
                  [ogg],
565
                  [
566
                    AS_IF([test "x$enable_plugin_voicemail" = "xmaybe"],
567
                          [enable_plugin_voicemail=yes])
568
                  ],
569
                  [
570
                    AS_IF([test "x$enable_plugin_voicemail" = "xyes"],
571
                          [AC_MSG_ERROR([libogg not found. See README.md for installation instructions or use --disable-plugin-voicemail])])
572
                  ])
573
AC_SUBST([OGG_CFLAGS])
574
AC_SUBST([OGG_LIBS])
575

    
576
AM_CONDITIONAL([ENABLE_PLUGIN_AUDIOBRIDGE], [test "x$enable_plugin_audiobridge" = "xyes"])
577
AM_CONDITIONAL([ENABLE_PLUGIN_ECHOTEST], [test "x$enable_plugin_echotest" = "xyes"])
578
AM_CONDITIONAL([ENABLE_PLUGIN_RECORDPLAY], [test "x$enable_plugin_recordplay" = "xyes"])
579
AM_CONDITIONAL([ENABLE_PLUGIN_SIP], [test "x$enable_plugin_sip" = "xyes"])
580
AM_CONDITIONAL([ENABLE_PLUGIN_SIPRE], [test "x$enable_plugin_sipre" = "xyes"])
581
AM_CONDITIONAL([ENABLE_PLUGIN_STREAMING], [test "x$enable_plugin_streaming" = "xyes"])
582
AM_CONDITIONAL([ENABLE_PLUGIN_VIDEOCALL], [test "x$enable_plugin_videocall" = "xyes"])
583
AM_CONDITIONAL([ENABLE_PLUGIN_VIDEOROOM], [test "x$enable_plugin_videoroom" = "xyes"])
584
AM_CONDITIONAL([ENABLE_PLUGIN_VOICEMAIL], [test "x$enable_plugin_voicemail" = "xyes"])
585
AM_CONDITIONAL([ENABLE_PLUGIN_TEXTROOM], [test "x$enable_plugin_textroom" = "xyes"])
586

    
587

    
588
##
589
# Event handlers
590
##
591

    
592
PKG_CHECK_MODULES([EVENTS],
593
                  [
594
                    glib-2.0 >= $glib_version
595
                    jansson
596
                  ])
597

    
598

    
599
##
600
# Post-processing
601
##
602

    
603
AC_ARG_ENABLE([post-processing],
604
              [AS_HELP_STRING([--enable-post-processing],
605
                              [Enable building post-processing utility])],
606
              [],
607
              [enable_post_processing=no])
608

    
609
AS_IF([test "x$enable_post_processing" = "xyes"],
610
      [PKG_CHECK_MODULES([POST_PROCESSING],
611
                         [
612
                           glib-2.0,
613
                           jansson,
614
                           libavutil,
615
                           libavcodec,
616
                           libavformat,
617
                           ogg
618
                         ])
619
      ])
620

    
621
AM_CONDITIONAL([ENABLE_POST_PROCESSING], [test "x$enable_post_processing" = "xyes"])
622

    
623
AC_CONFIG_FILES([
624
  Makefile
625
  html/Makefile
626
  docs/Makefile
627
])
628

    
629
JANUS_MANUAL_LIBS+=" -pthread"
630

    
631
AC_OUTPUT
632

    
633
##
634
# Summary
635
##
636
echo
637

    
638
AM_COND_IF([ENABLE_LIBSRTP_2],
639
	[echo "libsrtp version:           2.0.x"],
640
	[echo "libsrtp version:           1.5.x"])
641
AM_COND_IF([ENABLE_BORINGSSL],
642
	[echo "SSL/crypto library:        BoringSSL"
643
	 AM_COND_IF([ENABLE_DTLS_SETTIMEOUT],
644
		[echo "DTLS set-timeout:          yes"],
645
		[echo "DTLS set-timeout:          no"])
646
	],
647
	[echo "SSL/crypto library:        OpenSSL"
648
	 echo "DTLS set-timeout:          not available"])
649
AM_COND_IF([ENABLE_SCTP],
650
	[echo "DataChannels support:      yes"],
651
	[echo "DataChannels support:      no"])
652
AM_COND_IF([ENABLE_POST_PROCESSING],
653
	[echo "Recordings post-processor: yes"],
654
	[echo "Recordings post-processor: no"])
655
AM_COND_IF([ENABLE_TURN_REST_API],
656
	[echo "TURN REST API client:      yes"],
657
	[echo "TURN REST API client:      no"])
658
AM_COND_IF([ENABLE_DOCS],
659
	[echo "Doxygen documentation:     yes"],
660
	[echo "Doxygen documentation:     no"])
661
echo "Transports:"
662
AM_COND_IF([ENABLE_REST],
663
	[echo "    REST (HTTP/HTTPS):     yes"],
664
	[echo "    REST (HTTP/HTTPS):     no"])
665
AM_COND_IF([ENABLE_WEBSOCKETS],
666
	[
667
     AM_COND_IF([ENABLE_WEBSOCKETS_NEWAPI],
668
		[echo "    WebSockets:            yes (new API)"],
669
		[echo "    WebSockets:            yes (old API)"])
670
	],
671
	[echo "    WebSockets:            no"])
672
AM_COND_IF([ENABLE_RABBITMQ],
673
	[echo "    RabbitMQ:              yes"],
674
	[echo "    RabbitMQ:              no"])
675
AM_COND_IF([ENABLE_MQTT],
676
	[echo "    MQTT:                  yes"],
677
	[echo "    MQTT:                  no"])
678
AM_COND_IF([ENABLE_PFUNIX],
679
	[echo "    Unix Sockets:          yes"],
680
	[echo "    Unix Sockets:          no"])
681
echo "Plugins:"
682
AM_COND_IF([ENABLE_PLUGIN_ECHOTEST],
683
	[echo "    Echo Test:             yes"],
684
	[echo "    Echo Test:             no"])
685
AM_COND_IF([ENABLE_PLUGIN_STREAMING],
686
	[echo "    Streaming:             yes"],
687
	[echo "    Streaming:             no"])
688
AM_COND_IF([ENABLE_PLUGIN_VIDEOCALL],
689
	[echo "    Video Call:            yes"],
690
	[echo "    Video Call:            no"])
691
AM_COND_IF([ENABLE_PLUGIN_SIP],
692
	[echo "    SIP Gateway (Sofia):   yes"],
693
	[echo "    SIP Gateway (Sofia):   no"])
694
AM_COND_IF([ENABLE_PLUGIN_SIPRE],
695
	[echo "    SIP Gateway (libre):   yes"],
696
	[echo "    SIP Gateway (libre):   no"])
697
AM_COND_IF([ENABLE_PLUGIN_AUDIOBRIDGE],
698
	[echo "    Audio Bridge:          yes"],
699
	[echo "    Audio Bridge:          no"])
700
AM_COND_IF([ENABLE_PLUGIN_VIDEOROOM],
701
	[echo "    Video Room:            yes"],
702
	[echo "    Video Room:            no"])
703
AM_COND_IF([ENABLE_PLUGIN_VOICEMAIL],
704
	[echo "    Voice Mail:            yes"],
705
	[echo "    Voice Mail:            no"])
706
AM_COND_IF([ENABLE_PLUGIN_RECORDPLAY],
707
	[echo "    Record&Play:           yes"],
708
	[echo "    Record&Play:           no"])
709
AM_COND_IF([ENABLE_PLUGIN_TEXTROOM],
710
	[echo "    Text Room:             yes"],
711
	[echo "    Text Room:             no"])
712
echo "Event handlers:"
713
AM_COND_IF([ENABLE_SAMPLEEVH],
714
	[echo "    Sample event handler:  yes"],
715
	[echo "    Sample event handler:  no"])
716

    
717
echo
718
echo "If this configuration is ok for you, do a 'make' to start building Janus. A 'make install' will install Janus and its plugins to the specified prefix. Finally, a 'make configs' will install some sample configuration files too (something you'll only want to do the first time, though)."
719
echo