forked from meetecho/janus-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.am
271 lines (230 loc) · 7.38 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
# 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 -Waggregate-return -Wunused-but-set-variable \
-Warray-bounds -Wold-style-definition -Wsign-compare -Wlarger-than=65537
AM_CFLAGS += -Wno-undef # sophiasip is not -Wundef--safe
AM_CFLAGS += -Wredundant-decls # sophiasip also contains redundant declarations
# 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
# FIXME: make docs work with distcheck
DISTCHECK_CONFIGURE_FLAGS = --disable-docs --enable-post-processing
EXTRA_DIST = $(NULL)
CLEANFILES = $(NULL)
bin_PROGRAMS = janus
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)
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|[@]recordingsdir[@]|$(recordingsdir)|;\
s|[@]streamdir[@]|$(streamdir)|" \
$< > $@ || rm $@
EXTRA_DIST += conf/janus.cfg.sample.in
CLEANFILES += conf/janus.cfg.sample
##
# Janus
##
nobase_pkginclude_HEADERS = \
apierror.h \
cmdline.h \
config.h \
debug.h \
dtls.h \
ice.h \
janus.h \
mutex.h \
record.h \
rtcp.h \
rtp.h \
sctp.h \
sdp.h \
utils.h \
plugins/plugin.h \
$(NULL)
janus_SOURCES = \
apierror.c \
cmdline.c \
config.c \
dtls.c \
ice.c \
janus.c \
record.c \
rtcp.c \
sctp.c \
sdp.c \
utils.c \
plugins/plugin.c \
$(NULL)
janus_CFLAGS = \
$(AM_CFLAGS) \
$(JANUS_CFLAGS) \
-DPLUGINDIR=\"$(plugindir)\" \
-DCONFDIR=\"$(confdir)\" \
$(NULL)
janus_LDADD = \
$(JANUS_LIBS) \
$(JANUS_MANUAL_LIBS) \
-lsrtp \
$(NULL)
BUILT_SOURCES = cmdline.c cmdline.h
cmdline.c: janus.ggo
gengetopt --set-package="janus" --set-version="$(VERSION)" < $^
EXTRA_DIST += janus.ggo
CLEANFILES += cmdline.c cmdline.h
##
# Plugins
##
plugins_cflags = \
$(AM_CFLAGS) \
$(PLUGINS_CFLAGS) \
$(NULL)
plugins_libadd = \
$(PLUGINS_LIBS) \
$(NULL)
plugins_ldflags = \
-export-dynamic \
-no-undefined \
-avoid-version \
-module \
$(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)
plugins_libjanus_audiobridge_la_LDFLAGS = $(plugins_ldflags) -lopus
plugins_libjanus_audiobridge_la_LIBADD = $(plugins_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) $(PLUGIN_SIP_CFLAGS)
plugins_libjanus_sip_la_LDFLAGS = $(plugins_ldflags) $(PLUGIN_SIP_LDFLAGS)
plugins_libjanus_sip_la_LIBADD = $(plugins_libadd) $(PLUGIN_SIP_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_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
##
# Post-processing
##
if ENABLE_POST_PROCESSING
bin_PROGRAMS += janus-pp-rec
janus_pp_rec_SOURCES = \
postprocessing/pp-opus.c \
postprocessing/pp-opus.h \
postprocessing/pp-rtp.h \
postprocessing/pp-webm.c \
postprocessing/pp-webm.h \
postprocessing/janus-pp-rec.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))";)