forked from meetecho/janus-gateway
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.am
432 lines (371 loc) · 13 KB
/
Makefile.am
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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
ACLOCAL_AMFLAGS = -I m4
# FIXME: These flags should be produced in configure.ac using AX_APPEND_COMPILE_FLAGS
AM_CFLAGS = \
-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \
-Wunused -fstrict-aliasing -Wextra -Wformat=2 -Winit-self -Winline \
-Wpacked -Wpointer-arith -Wmissing-format-attribute -Wmissing-noreturn \
-Wnested-externs -Wstrict-prototypes -Wunsafe-loop-optimizations \
-Wwrite-strings -Wno-missing-field-initializers -Wno-unused-parameter \
-Wcast-align -Wformat-nonliteral -Wformat-security -Wswitch-default \
-Wmissing-include-dirs -Wno-aggregate-return -Wunused-but-set-variable \
-Warray-bounds -Wold-style-definition -Wsign-compare -Wlarger-than=65537
AM_CFLAGS += -Wno-undef # sofiasip is not -Wundef--safe
AM_CFLAGS += -Wno-redundant-decls # sofiasip also contains redundant declarations
AM_CFLAGS += -Wno-override-init # we need this for JANUS_PLUGIN_INIT and JANUS_TRANSPORT_INIT and JANUS_EVENTHANDLER_INIT
# FIXME: These should be enabled once the code is safe for them. That requires
# some fairly big refactoring though, which can wait.
# AM_CFLAGS += -Wshadow -Wstrict-aliasing=2
AM_CFLAGS += -fstack-protector-all -g -ggdb -fPIC -rdynamic -pthread
# FIXME: make docs work with distcheck
DISTCHECK_CONFIGURE_FLAGS = --disable-docs --enable-post-processing
EXTRA_DIST = $(NULL)
CLEANFILES = $(NULL)
bin_PROGRAMS = janusclient
headerdir = $(includedir)/janus
header_HEADERS = \
plugins/plugin.h transports/transport.h events/eventhandler.h \
apierror.h config.h debug.h dtls.h events.h janus.h ice.h mutex.h \
record.h rtcp.h rtp.h sctp.h sdp.h sdp-utils.h turnrest.h utils.h log.h
confdir = $(sysconfdir)/janus
conf_DATA = conf/janus.cfg.sample
certdir = $(datadir)/janus/certs
cert_DATA = certs/mycert.key certs/mycert.pem
plugindir = $(libdir)/janus/plugins
plugin_LTLIBRARIES = $(NULL)
transportdir = $(libdir)/janus/transports
transport_LTLIBRARIES = $(NULL)
eventdir = $(libdir)/janus/events
event_LTLIBRARIES = $(NULL)
SUBDIRS = html
html_DATA = README.md
streamdir = $(datadir)/janus/streams
stream_DATA = $(NULL)
recordingsdir = $(datadir)/janus/recordings
recordings_DATA = $(NULL)
%.sample: %.sample.in
$(MKDIR_P) $(@D)
$(AM_V_GEN) sed -e "\
s|[@]confdir[@]|$(confdir)|;\
s|[@]certdir[@]|$(certdir)|;\
s|[@]plugindir[@]|$(plugindir)|;\
s|[@]transportdir[@]|$(transportdir)|;\
s|[@]eventdir[@]|$(eventdir)|;\
s|[@]recordingsdir[@]|$(recordingsdir)|;\
s|[@]streamdir[@]|$(streamdir)|" \
$< > $@ || rm $@
EXTRA_DIST += conf/janus.cfg.sample.in
CLEANFILES += conf/janus.cfg.sample
##
# Janus
##
janusclient_SOURCES = \
apierror.c \
apierror.h \
auth.c \
auth.h \
cmdline.c \
cmdline.h \
config.c \
config.h \
debug.h \
dtls.c \
dtls.h \
dtls-bio.c \
dtls-bio.h \
events.c \
events.h \
ice.c \
ice.h \
janusclient.c \
janus.h \
log.c \
log.h \
mutex.h \
record.c \
record.h \
rtcp.c \
rtcp.h \
rtp.c \
rtp.h \
sctp.c \
sctp.h \
sdp.c \
sdp.h \
sdp-utils.c \
sdp-utils.h \
turnrest.c \
turnrest.h \
utils.c \
utils.h \
plugins/plugin.c \
plugins/plugin.h \
transports/transport.h \
events/eventhandler.h \
$(NULL)
janusclient_CFLAGS = \
$(AM_CFLAGS) \
$(JANUS_CFLAGS) \
-DPLUGINDIR=\"$(plugindir)\" \
-DTRANSPORTDIR=\"$(transportdir)\" \
-DEVENTDIR=\"$(eventdir)\" \
-DCONFDIR=\"$(confdir)\" \
$(BORINGSSL_CFLAGS) \
$(NULL)
janusclient_LDADD = \
$(BORINGSSL_LIBS) \
$(JANUS_LIBS) \
$(JANUS_MANUAL_LIBS) \
$(NULL)
man1_MANS = janus.1
BUILT_SOURCES = cmdline.c cmdline.h
cmdline.c: janus.ggo
gengetopt --set-package="janusclient" --set-version="$(VERSION)" < $^
EXTRA_DIST += janus.ggo
CLEANFILES += cmdline.c cmdline.h
##
# Transports
##
transports_cflags = \
$(AM_CFLAGS) \
$(TRANSPORTS_CFLAGS) \
$(NULL)
transports_libadd = \
$(TRANSPORTS_LIBS) \
$(NULL)
if ENABLE_REST
transport_LTLIBRARIES += transports/libjanus_http.la
transports_libjanus_http_la_SOURCES = transports/janus_http.c
transports_libjanus_http_la_CFLAGS = $(transports_cflags) $(MHD_CFLAGS)
transports_libjanus_http_la_LDFLAGS = $(transports_ldflags) $(MHD_LDFLAGS) $(MHD_LIBS)
transports_libjanus_http_la_LIBADD = $(transports_libadd) $(MHD_LDFLAGS)
conf_DATA += conf/janus.transport.http.cfg.sample
EXTRA_DIST += conf/janus.transport.http.cfg.sample.in
CLEANFILES += conf/janus.transport.http.cfg.sample
endif
if ENABLE_WEBSOCKETS
transport_LTLIBRARIES += transports/libjanus_wsclient.la
transports_libjanus_wsclient_la_SOURCES = transports/janus_websocket_client.c
transports_libjanus_wsclient_la_CFLAGS = $(transports_cflags)
transports_libjanus_wsclient_la_LDFLAGS = $(transports_ldflags) $(WS_MANUAL_LIBS)
transports_libjanus_wsclient_la_LIBADD = $(transports_libadd)
conf_DATA += conf/janus.transport.wsclient.cfg.sample
EXTRA_DIST += conf/janus.transport.wsclient.cfg.sample.in
CLEANFILES += conf/janus.transport.wsclient.cfg.sample
endif
if ENABLE_RABBITMQ
transport_LTLIBRARIES += transports/libjanus_rabbitmq.la
transports_libjanus_rabbitmq_la_SOURCES = transports/janus_rabbitmq.c
transports_libjanus_rabbitmq_la_CFLAGS = $(transports_cflags)
transports_libjanus_rabbitmq_la_LDFLAGS = $(transports_ldflags) -lrabbitmq
transports_libjanus_rabbitmq_la_LIBADD = $(transports_libadd)
conf_DATA += conf/janus.transport.rabbitmq.cfg.sample
EXTRA_DIST += conf/janus.transport.rabbitmq.cfg.sample
endif
if ENABLE_MQTT
transport_LTLIBRARIES += transports/libjanus_mqtt.la
transports_libjanus_mqtt_la_SOURCES = transports/janus_mqtt.c
transports_libjanus_mqtt_la_CFLAGS = $(transports_cflags)
transports_libjanus_mqtt_la_LDFLAGS = $(transports_ldflags) -lpaho-mqtt3a
transports_libjanus_mqtt_la_LIBADD = $(transports_libadd)
conf_DATA += conf/janus.transport.mqtt.cfg.sample
EXTRA_DIST += conf/janus.transport.mqtt.cfg.sample
endif
if ENABLE_PFUNIX
transport_LTLIBRARIES += transports/libjanus_pfunix.la
transports_libjanus_pfunix_la_SOURCES = transports/janus_pfunix.c
transports_libjanus_pfunix_la_CFLAGS = $(transports_cflags)
transports_libjanus_pfunix_la_LDFLAGS = $(transports_ldflags)
transports_libjanus_pfunix_la_LIBADD = $(transports_libadd)
conf_DATA += conf/janus.transport.pfunix.cfg.sample
EXTRA_DIST += conf/janus.transport.pfunix.cfg.sample
endif
##
# Event handlers
##
events_cflags = \
$(AM_CFLAGS) \
$(EVENTS_CFLAGS) \
$(NULL)
events_libadd = \
$(EVENTS_LIBS) \
$(NULL)
if ENABLE_SAMPLEEVH
event_LTLIBRARIES += events/libjanus_sampleevh.la
events_libjanus_sampleevh_la_SOURCES = events/janus_sampleevh.c
events_libjanus_sampleevh_la_CFLAGS = $(events_cflags)
events_libjanus_sampleevh_la_LDFLAGS = $(events_ldflags) -lcurl
events_libjanus_sampleevh_la_LIBADD = $(events_libadd)
conf_DATA += conf/janus.eventhandler.sampleevh.cfg.sample
EXTRA_DIST += conf/janus.eventhandler.sampleevh.cfg.sample
endif
##
# Plugins
##
plugins_cflags = \
$(AM_CFLAGS) \
$(PLUGINS_CFLAGS) \
$(NULL)
plugins_libadd = \
$(PLUGINS_LIBS) \
$(NULL)
if ENABLE_PLUGIN_AUDIOBRIDGE
plugin_LTLIBRARIES += plugins/libjanus_audiobridge.la
plugins_libjanus_audiobridge_la_SOURCES = plugins/janus_audiobridge.c
plugins_libjanus_audiobridge_la_CFLAGS = $(plugins_cflags) $(OPUS_CFLAGS)
plugins_libjanus_audiobridge_la_LDFLAGS = $(plugins_ldflags) $(OPUS_LDFLAGS) $(OPUS_LIBS)
plugins_libjanus_audiobridge_la_LIBADD = $(plugins_libadd) $(OPUS_LIBADD)
conf_DATA += conf/janus.plugin.audiobridge.cfg.sample
EXTRA_DIST += conf/janus.plugin.audiobridge.cfg.sample
endif
if ENABLE_PLUGIN_ECHOTEST
plugin_LTLIBRARIES += plugins/libjanus_echotest.la
plugins_libjanus_echotest_la_SOURCES = plugins/janus_echotest.c
plugins_libjanus_echotest_la_CFLAGS = $(plugins_cflags)
plugins_libjanus_echotest_la_LDFLAGS = $(plugins_ldflags)
plugins_libjanus_echotest_la_LIBADD = $(plugins_libadd)
conf_DATA += conf/janus.plugin.echotest.cfg.sample
EXTRA_DIST += conf/janus.plugin.echotest.cfg.sample
endif
if ENABLE_PLUGIN_RECORDPLAY
plugin_LTLIBRARIES += plugins/libjanus_recordplay.la
plugins_libjanus_recordplay_la_SOURCES = plugins/janus_recordplay.c
plugins_libjanus_recordplay_la_CFLAGS = $(plugins_cflags)
plugins_libjanus_recordplay_la_LDFLAGS = $(plugins_ldflags)
plugins_libjanus_recordplay_la_LIBADD = $(plugins_libadd)
conf_DATA += conf/janus.plugin.recordplay.cfg.sample
recordings_DATA += \
plugins/recordings/1234.nfo \
plugins/recordings/rec-sample-audio.mjr \
plugins/recordings/rec-sample-video.mjr
EXTRA_DIST += \
conf/janus.plugin.recordplay.cfg.sample.in \
$(recordings_DATA)
CLEANFILES += conf/janus.plugin.recordplay.cfg.sample
endif
if ENABLE_PLUGIN_SIP
plugin_LTLIBRARIES += plugins/libjanus_sip.la
plugins_libjanus_sip_la_SOURCES = plugins/janus_sip.c
plugins_libjanus_sip_la_CFLAGS = $(plugins_cflags) $(SOFIA_CFLAGS)
plugins_libjanus_sip_la_LDFLAGS = $(plugins_ldflags) $(SOFIA_LDFLAGS) $(SOFIA_LIBS)
plugins_libjanus_sip_la_LIBADD = $(plugins_libadd) $(SOFIA_LIBADD)
conf_DATA += conf/janus.plugin.sip.cfg.sample
EXTRA_DIST += conf/janus.plugin.sip.cfg.sample
endif
if ENABLE_PLUGIN_STREAMING
plugin_LTLIBRARIES += plugins/libjanus_streaming.la
plugins_libjanus_streaming_la_SOURCES = plugins/janus_streaming.c
plugins_libjanus_streaming_la_CFLAGS = $(plugins_cflags)
plugins_libjanus_streaming_la_LDFLAGS = $(plugins_ldflags)
plugins_libjanus_streaming_la_LIBADD = $(plugins_libadd)
conf_DATA += conf/janus.plugin.streaming.cfg.sample
stream_DATA += \
plugins/streams/music.mulaw \
plugins/streams/radio.alaw \
plugins/streams/test_gstreamer.sh \
plugins/streams/test_gstreamer_1.sh
EXTRA_DIST += \
conf/janus.plugin.streaming.cfg.sample.in \
$(stream_DATA)
CLEANFILES += conf/janus.plugin.streaming.cfg.sample
endif
if ENABLE_PLUGIN_VIDEOCALL
plugin_LTLIBRARIES += plugins/libjanus_videocall.la
plugins_libjanus_videocall_la_SOURCES = plugins/janus_videocall.c
plugins_libjanus_videocall_la_CFLAGS = $(plugins_cflags)
plugins_libjanus_videocall_la_LDFLAGS = $(plugins_ldflags)
plugins_libjanus_videocall_la_LIBADD = $(plugins_libadd)
conf_DATA += conf/janus.plugin.videocall.cfg.sample
EXTRA_DIST += conf/janus.plugin.videocall.cfg.sample
endif
if ENABLE_PLUGIN_NATIVECLIENT
plugin_LTLIBRARIES += plugins/libjanus_nativeclient.la
plugins_libjanus_nativeclient_la_SOURCES = plugins/janus_nativeclient_plugin.c
plugins_libjanus_nativeclient_la_CFLAGS = $(plugins_cflags) $(GST_CFLAGS)
plugins_libjanus_nativeclient_la_LDFLAGS = $(plugins_ldflags) $(GST_LDFLAGS) $(GST_LIBS)
plugins_libjanus_nativeclient_la_LIBADD = $(plugins_libadd) $(GST_LIBADD)
conf_DATA += conf/janus.plugin.nativeclient.cfg.sample
EXTRA_DIST += conf/janus.plugin.nativeclient.cfg.sample
endif
if ENABLE_PLUGIN_VIDEOCALLTRANSCODE
plugin_LTLIBRARIES += plugins/libjanus_transcode.la
plugins_libjanus_transcode_la_SOURCES = plugins/janus_transcode_videocall.c
plugins_libjanus_transcode_la_CFLAGS = $(plugins_cflags) $(GST_CFLAGS)
plugins_libjanus_transcode_la_LDFLAGS = $(plugins_ldflags) $(GST_LDFLAGS) $(GST_LIBS)
plugins_libjanus_transcode_la_LIBADD = $(plugins_libadd) $(GST_LIBADD)
conf_DATA += conf/janus.plugin.transcode.cfg.sample
EXTRA_DIST += conf/janus.plugin.transcode.cfg.sample
endif
if ENABLE_PLUGIN_VIDEOROOM
plugin_LTLIBRARIES += plugins/libjanus_videoroom.la
plugins_libjanus_videoroom_la_SOURCES = plugins/janus_videoroom.c
plugins_libjanus_videoroom_la_CFLAGS = $(plugins_cflags)
plugins_libjanus_videoroom_la_LDFLAGS = $(plugins_ldflags)
plugins_libjanus_videoroom_la_LIBADD = $(plugins_libadd)
conf_DATA += conf/janus.plugin.videoroom.cfg.sample
EXTRA_DIST += conf/janus.plugin.videoroom.cfg.sample
endif
if ENABLE_PLUGIN_VOICEMAIL
plugin_LTLIBRARIES += plugins/libjanus_voicemail.la
plugins_libjanus_voicemail_la_SOURCES = plugins/janus_voicemail.c
plugins_libjanus_voicemail_la_CFLAGS = $(plugins_cflags)
plugins_libjanus_voicemail_la_LDFLAGS = $(plugins_ldflags) -logg
plugins_libjanus_voicemail_la_LIBADD = $(plugins_libadd)
conf_DATA += conf/janus.plugin.voicemail.cfg.sample
EXTRA_DIST += conf/janus.plugin.voicemail.cfg.sample
endif
if ENABLE_PLUGIN_TEXTROOM
plugin_LTLIBRARIES += plugins/libjanus_textroom.la
plugins_libjanus_textroom_la_SOURCES = plugins/janus_textroom.c
plugins_libjanus_textroom_la_CFLAGS = $(plugins_cflags)
plugins_libjanus_textroom_la_LDFLAGS = $(plugins_ldflags)
plugins_libjanus_textroom_la_LIBADD = $(plugins_libadd)
conf_DATA += conf/janus.plugin.textroom.cfg.sample
EXTRA_DIST += conf/janus.plugin.textroom.cfg.sample
endif
##
# Post-processing
##
if ENABLE_POST_PROCESSING
bin_PROGRAMS += janus-pp-rec
man1_MANS += postprocessing/janus-pp-rec.1
janus_pp_rec_SOURCES = \
postprocessing/pp-g711.c \
postprocessing/pp-g711.h \
postprocessing/pp-h264.c \
postprocessing/pp-h264.h \
postprocessing/pp-opus.c \
postprocessing/pp-opus.h \
postprocessing/pp-opus-silence.h \
postprocessing/pp-rtp.h \
postprocessing/pp-srt.c \
postprocessing/pp-srt.h \
postprocessing/pp-webm.c \
postprocessing/pp-webm.h \
postprocessing/janus-pp-rec.c \
log.c \
$(NULL)
janus_pp_rec_CFLAGS = \
$(AM_CFLAGS) \
$(POST_PROCESSING_CFLAGS) \
$(NULL)
janus_pp_rec_LDADD = \
$(POST_PROCESSING_LIBS) \
$(NULL)
endif
##
# Docs
##
if ENABLE_DOCS
SUBDIRS += docs
endif
##
# Configuration
##
configs:
$(MKDIR_P) $(DESTDIR)$(confdir)
$(foreach config,$(conf_DATA),cp "$(CURDIR)/$(config)" "$(DESTDIR)$(confdir)/$(notdir $(basename $(config) .sample))";)
##
# Extra cleanup
##
clean-local:
-rm -f docs/doxygen_sqlite3.db