]>
Commit | Line | Data |
---|---|---|
b91df8ec | 1 | ARFLAGS = cr |
8110851d | 2 | |
86a52964 MB |
3 | man_MANS = $(top_srcdir)/man/shairport-sync.7 |
4 | ||
0cc97d50 | 5 | lib_pair_ap_a_CFLAGS = -Wall -g -DCONFIG_GCRYPT -pthread |
8110851d | 6 | lib_tinyhttp_a_CFLAGS = -pthread |
580d75a6 MB |
7 | lib_dbus_interface_a_CFLAGS = -pthread |
8 | lib_mpris_interface_a_CFLAGS = -pthread | |
9 | ||
5bdc16e3 | 10 | |
e223a543 | 11 | bin_PROGRAMS = shairport-sync |
1e07e1e0 | 12 | |
8110851d MB |
13 | BUILT_SOURCES = |
14 | noinst_HEADERS = | |
15 | CLEANFILES = | |
16 | shairport_sync_LDADD = | |
17 | noinst_LIBRARIES = | |
18 | ||
79e610fa | 19 | # See below for the flags for the test client program |
1e07e1e0 | 20 | |
3162977c | 21 | shairport_sync_SOURCES = shairport.c rtsp.c mdns.c common.c rtp.c player.c alac.c audio.c loudness.c activity_monitor.c |
9d450966 | 22 | |
c458114c MB |
23 | if BUILD_FOR_DARWIN |
24 | AM_CXXFLAGS = -I/usr/local/include -Wno-multichar -Wall -Wextra -Wno-deprecated-declarations -pthread -DSYSCONFDIR=\"$(sysconfdir)\" | |
25 | AM_CFLAGS = -Wno-multichar -Wall -Wextra -Wno-deprecated-declarations -pthread -DSYSCONFDIR=\"$(sysconfdir)\" | |
26 | else | |
0df8bf31 | 27 | if BUILD_FOR_FREEBSD |
580d75a6 MB |
28 | AM_CXXFLAGS = -I/usr/local/include -Wno-multichar -Wall -Wextra -pthread -DSYSCONFDIR=\"$(sysconfdir)\" |
29 | AM_CFLAGS = -Wno-multichar -Wall -Wextra -pthread -DSYSCONFDIR=\"$(sysconfdir)\" | |
283e4930 MB |
30 | else |
31 | if BUILD_FOR_OPENBSD | |
25d02d18 | 32 | AM_CXXFLAGS = -I/usr/local/include -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"$(sysconfdir)\" |
07c45454 | 33 | AM_CFLAGS = -Wno-multichar -Wall -Wextra -pthread -DSYSCONFDIR=\"$(sysconfdir)\" |
0df8bf31 | 34 | else |
36ed65fc MB |
35 | AM_CXXFLAGS = -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"$(sysconfdir)\" |
36 | AM_CFLAGS = -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread -DSYSCONFDIR=\"$(sysconfdir)\" | |
0df8bf31 | 37 | endif |
283e4930 | 38 | endif |
c458114c | 39 | endif |
945483d9 | 40 | |
a0e9c0ac | 41 | # include information generated by 'git describe --tags --dirty --broken' if requested |
2203d6a3 | 42 | if USE_GIT_VERSION |
1fb0276b | 43 | shairport_sync_SOURCES += gitversion.c |
2203d6a3 | 44 | gitversion.h: .git/index |
1f821095 | 45 | printf "// Do not edit!\n" > gitversion.h |
a0e9c0ac | 46 | printf "// This file is automatically generated by 'git describe --tags --dirty --broken', if available.\n" >> gitversion.h |
1f821095 | 47 | printf " char git_version_string[] = \"" >> gitversion.h |
a0e9c0ac | 48 | git describe --tags --dirty --broken | tr -d '[[:space:]]' >> gitversion.h |
1f821095 | 49 | printf "\";\n" >> gitversion.h |
1fb0276b MB |
50 | gitversion.c: gitversion.h |
51 | touch gitversion.c | |
52 | BUILT_SOURCES += gitversion.c gitversion.h | |
53 | noinst_HEADERS += $(BUILT_SOURCES) | |
54 | # Correctly clean the generated headers, but keep the xml description | |
55 | CLEANFILES += $(BUILT_SOURCES) | |
2203d6a3 MB |
56 | endif |
57 | ||
c9b3d2a2 | 58 | if USE_APPLE_ALAC |
945483d9 MB |
59 | shairport_sync_SOURCES += apple_alac.cpp |
60 | endif | |
391b48f6 | 61 | |
043363fb | 62 | if USE_CUSTOMPIDDIR |
391b48f6 MB |
63 | AM_CFLAGS+= \ |
64 | -DPIDDIR=\"$(CUSTOM_PID_DIR)\" | |
12f26893 | 65 | endif |
e223a543 MB |
66 | |
67 | if USE_AVAHI | |
68 | shairport_sync_SOURCES += mdns_avahi.c | |
69 | endif | |
70 | ||
71 | if USE_TINYSVCMDNS | |
72 | shairport_sync_SOURCES += mdns_tinysvcmdns.c tinysvcmdns.c | |
73 | endif | |
8d0b2702 | 74 | |
3162977c MB |
75 | if USE_EXTERNAL_MDNS |
76 | shairport_sync_SOURCES += mdns_external.c | |
77 | endif | |
78 | ||
9d450966 | 79 | if USE_ALSA |
e223a543 | 80 | shairport_sync_SOURCES += audio_alsa.c |
9d450966 MB |
81 | endif |
82 | ||
8cabb16f MB |
83 | if USE_JACK |
84 | shairport_sync_SOURCES += audio_jack.c | |
85 | endif | |
86 | ||
9d450966 | 87 | if USE_SNDIO |
e223a543 | 88 | shairport_sync_SOURCES += audio_sndio.c |
9d450966 MB |
89 | endif |
90 | ||
a090a14c MB |
91 | if USE_STDOUT |
92 | shairport_sync_SOURCES += audio_stdout.c | |
93 | endif | |
94 | ||
95 | if USE_PIPE | |
96 | shairport_sync_SOURCES += audio_pipe.c | |
97 | endif | |
98 | ||
99 | if USE_DUMMY | |
100 | shairport_sync_SOURCES += audio_dummy.c | |
101 | endif | |
102 | ||
9d450966 | 103 | if USE_AO |
e223a543 | 104 | shairport_sync_SOURCES += audio_ao.c |
9d450966 MB |
105 | endif |
106 | ||
71fc1a2c | 107 | if USE_SOUNDIO |
108 | shairport_sync_SOURCES += audio_soundio.c | |
109 | endif | |
110 | ||
b3ae05ea MB |
111 | if USE_PA |
112 | shairport_sync_SOURCES += audio_pa.c | |
113 | endif | |
114 | ||
ec232363 LR |
115 | if USE_PW |
116 | shairport_sync_SOURCES += audio_pw.c | |
117 | endif | |
118 | ||
7b9cd28e YP |
119 | if USE_CONVOLUTION |
120 | shairport_sync_SOURCES += FFTConvolver/AudioFFT.cpp FFTConvolver/FFTConvolver.cpp FFTConvolver/Utilities.cpp FFTConvolver/convolver.cpp | |
25d02d18 | 121 | AM_CXXFLAGS += -std=c++11 |
7b9cd28e YP |
122 | endif |
123 | ||
9d450966 | 124 | if USE_DNS_SD |
e223a543 | 125 | shairport_sync_SOURCES += mdns_dns_sd.c |
9d450966 | 126 | endif |
12f26893 | 127 | |
9d9b0a18 | 128 | if USE_METADATA_HUB |
8110851d | 129 | shairport_sync_SOURCES += metadata_hub.c |
9d9b0a18 MB |
130 | endif |
131 | ||
02694948 | 132 | if USE_MQTT |
8110851d | 133 | shairport_sync_SOURCES += mqtt.c |
02694948 TZ |
134 | endif |
135 | ||
9d9b0a18 | 136 | if USE_DACP_CLIENT |
8110851d MB |
137 | shairport_sync_SOURCES += dacp.c |
138 | shairport_sync_LDADD += lib_tinyhttp.a | |
139 | noinst_LIBRARIES += lib_tinyhttp.a | |
140 | lib_tinyhttp_a_SOURCES = tinyhttp/chunk.c tinyhttp/header.c tinyhttp/http.c | |
141 | endif | |
142 | ||
143 | if USE_AIRPLAY_2 | |
144 | shairport_sync_SOURCES += ptp-utilities.c plist_xml_strings.c | |
493e9604 | 145 | shairport_sync_LDADD += lib_pair_ap.a |
8110851d | 146 | lib_pair_ap_a_SOURCES = pair_ap/pair.c pair_ap/pair_fruit.c pair_ap/pair_homekit.c pair_ap/pair-tlv.c |
493e9604 | 147 | noinst_LIBRARIES += lib_pair_ap.a |
8110851d | 148 | plist_xml_strings.h: plists/get_info_response.xml |
1092a8c1 MB |
149 | printf "// Do not edit!\n" > plist_xml_strings.h |
150 | printf "// This file is automatically generated from files in the plists folder.\n\n" >> plist_xml_strings.h | |
151 | xxd -i $(top_srcdir)/plists/get_info_response.xml - | sed -e 's/[^ ]*plists_get_info_response_xml/plists_get_info_response_xml/g' >> plist_xml_strings.h | |
152 | printf "\n" >> plist_xml_strings.h | |
8110851d MB |
153 | plist_xml_strings.c: plist_xml_strings.h |
154 | touch plist_xml_strings.c | |
155 | ||
156 | BUILT_SOURCES += plist_xml_strings.c plist_xml_strings.h | |
157 | noinst_HEADERS += $(BUILT_SOURCES) | |
158 | # Correctly clean the generated headers, but keep the xml description | |
159 | CLEANFILES += $(BUILT_SOURCES) | |
9d9b0a18 MB |
160 | endif |
161 | ||
1e07e1e0 | 162 | if USE_DBUS |
b91df8ec MB |
163 | shairport_sync_LDADD += lib_dbus_interface.a |
164 | noinst_LIBRARIES += lib_dbus_interface.a | |
165 | lib_dbus_interface_a_SOURCES = dbus-interface.c | |
166 | shairport_sync_SOURCES += dbus-service.c | |
8110851d | 167 | BUILT_SOURCES += dbus-interface.h dbus-interface.c |
d4eae76f | 168 | # We don't want to install this header |
0e260bcc | 169 | noinst_HEADERS += $(BUILT_SOURCES) |
d4eae76f | 170 | # Correctly clean the generated headers, but keep the xml description |
0e260bcc | 171 | CLEANFILES += $(BUILT_SOURCES) |
d4eae76f | 172 | |
1092a8c1 MB |
173 | |
174 | ||
203f0260 | 175 | dbus-interface.c: org.gnome.ShairportSync.xml |
1092a8c1 | 176 | gdbus-codegen --interface-prefix org.gnome --generate-c-code dbus-interface $(top_srcdir)/org.gnome.ShairportSync.xml |
35860f7b | 177 | dbus-interface.h: dbus-interface.c |
203f0260 | 178 | touch dbus-interface.h |
79e610fa | 179 | endif |
d4eae76f | 180 | |
74f41a17 | 181 | if USE_MPRIS |
b91df8ec MB |
182 | shairport_sync_LDADD += lib_mpris_interface.a |
183 | noinst_LIBRARIES += lib_mpris_interface.a | |
184 | lib_mpris_interface_a_SOURCES = mpris-interface.c | |
185 | shairport_sync_SOURCES += mpris-service.c | |
26d7b079 | 186 | BUILT_SOURCES += mpris-interface.h mpris-interface.c |
74f41a17 | 187 | # We don't want to install this header |
0e260bcc | 188 | noinst_HEADERS += $(BUILT_SOURCES) |
74f41a17 | 189 | # Correctly clean the generated headers, but keep the xml description |
0e260bcc | 190 | CLEANFILES += $(BUILT_SOURCES) |
74f41a17 | 191 | |
203f0260 | 192 | mpris-interface.c: org.mpris.MediaPlayer2.xml |
1092a8c1 | 193 | gdbus-codegen --interface-prefix org.mpris --generate-c-code mpris-interface $(top_srcdir)/org.mpris.MediaPlayer2.xml |
35860f7b | 194 | mpris-interface.h: mpris-interface.c |
203f0260 | 195 | touch mpris-interface.h |
74f41a17 MB |
196 | endif |
197 | ||
9776b378 MB |
198 | noinst_PROGRAMS = |
199 | ||
79e610fa MB |
200 | if USE_DBUS_CLIENT |
201 | #Make it, but don't install it anywhere | |
9776b378 | 202 | noinst_PROGRAMS += shairport-sync-dbus-test-client |
b91df8ec MB |
203 | shairport_sync_dbus_test_client_SOURCES = shairport-sync-dbus-test-client.c |
204 | shairport_sync_dbus_test_client_LDADD = lib_dbus_interface.a | |
df7c48f0 MB |
205 | endif |
206 | ||
207 | if USE_MPRIS_CLIENT | |
208 | #Make it, but don't install it anywhere | |
9776b378 | 209 | noinst_PROGRAMS += shairport-sync-mpris-test-client |
b91df8ec MB |
210 | shairport_sync_mpris_test_client_SOURCES = shairport-sync-mpris-test-client.c |
211 | shairport_sync_mpris_test_client_LDADD = lib_mpris_interface.a | |
1e07e1e0 MB |
212 | endif |
213 | ||
931c7ed2 LR |
214 | if INSTALL_CONFIG_FILES |
215 | ||
216 | CONFIG_FILE_INSTALL_TARGET = config-file-install-local | |
217 | $(CONFIG_FILE_INSTALL_TARGET): scripts/shairport-sync.conf | |
218 | install -d $(DESTDIR)$(sysconfdir) | |
1092a8c1 | 219 | install -m 0644 $(top_srcdir)/scripts/shairport-sync.conf $(DESTDIR)$(sysconfdir)/shairport-sync.conf.sample |
14bda21b | 220 | [ -f $(DESTDIR)$(sysconfdir)/shairport-sync.conf ] || cp $(top_srcdir)/scripts/shairport-sync.conf $(DESTDIR)$(sysconfdir)/shairport-sync.conf |
931c7ed2 | 221 | |
4aea4cc5 | 222 | if BUILD_FOR_LINUX |
931c7ed2 | 223 | DBUS_POLICY_DIR = /etc/dbus-1/system.d |
4aea4cc5 | 224 | else |
931c7ed2 | 225 | DBUS_POLICY_DIR = $(sysconfdir)/dbus-1/system.d |
4aea4cc5 | 226 | endif |
931c7ed2 | 227 | |
1e07e1e0 | 228 | if USE_DBUS |
931c7ed2 | 229 | |
623b9b4b | 230 | if INSTALL_CYGWIN_SERVICE |
931c7ed2 | 231 | DBUS_POLICY_FILE = scripts/shairport-sync-dbus-policy-cygwin.conf |
623b9b4b | 232 | else |
931c7ed2 LR |
233 | DBUS_POLICY_FILE = scripts/shairport-sync-dbus-policy.conf |
234 | endif # INSTALL_CYGWIN_SERVICE | |
235 | ||
236 | DBUS_POLICY_INSTALL_TARGET = dbus-policy-install-local | |
237 | ||
238 | $(DBUS_POLICY_INSTALL_TARGET): $(DBUS_POLICY_FILE) | |
239 | install -d $(DESTDIR)$(DBUS_POLICY_DIR) | |
1092a8c1 | 240 | install -m 0644 $(top_srcdir)/$(DBUS_POLICY_FILE) $(DESTDIR)$(DBUS_POLICY_DIR)/shairport-sync-dbus.conf |
931c7ed2 LR |
241 | |
242 | endif # USE_DBUS | |
243 | ||
da3366a2 | 244 | if USE_MPRIS |
931c7ed2 | 245 | |
623b9b4b | 246 | if INSTALL_CYGWIN_SERVICE |
931c7ed2 | 247 | MPRIS_POLICY_FILE = scripts/shairport-sync-mpris-policy-cygwin.conf |
623b9b4b | 248 | else |
931c7ed2 LR |
249 | MPRIS_POLICY_FILE = scripts/shairport-sync-mpris-policy.conf |
250 | endif # INSTALL_CYGWIN_SERVICE | |
251 | ||
252 | MPRIS_POLICY_INSTALL_TARGET = mpris-policy-install-local | |
253 | ||
254 | $(MPRIS_POLICY_INSTALL_TARGET): $(MPRIS_POLICY_FILE) | |
255 | install -d $(DESTDIR)$(DBUS_POLICY_DIR) | |
1092a8c1 | 256 | install -m 0644 $(top_srcdir)/$(MPRIS_POLICY_FILE) $(DESTDIR)$(DBUS_POLICY_DIR)/shairport-sync-mpris.conf |
931c7ed2 LR |
257 | |
258 | endif # USE_MPRIS | |
259 | ||
260 | endif # INSTALL_CONFIG_FILES | |
261 | ||
262 | INSTALL_GROUP_TARGET = install-group-local | |
263 | ||
264 | $(INSTALL_GROUP_TARGET): | |
b3db7e88 | 265 | getent group shairport-sync &>/dev/null || groupadd -r shairport-sync &>/dev/null |
931c7ed2 LR |
266 | |
267 | INSTALL_USER_TARGET = install-user-local | |
268 | ||
269 | $(INSTALL_USER_TARGET): $(INSTALL_GROUP_TARGET) | |
b3db7e88 | 270 | getent passwd shairport-sync &>/dev/null || useradd -r -M -g shairport-sync -s /usr/sbin/nologin -G audio shairport-sync &>/dev/null |
931c7ed2 LR |
271 | |
272 | if INSTALL_SYSTEMV | |
273 | ||
274 | INSTALL_SYSTEMV_TARGET = install-systemv-local | |
275 | ||
7f9e8116 MB |
276 | # watch out -- shairport-sync is created during the ./configure step and |
277 | # will be stored in a scripts folder in the _build_ folder | |
278 | # which will be the source folder if you're not using a separate build folder | |
279 | ||
931c7ed2 LR |
280 | $(INSTALL_SYSTEMV_TARGET): scripts/shairport-sync $(INSTALL_USER_TARGET) |
281 | install -d $(DESTDIR)$(sysconfdir)/init.d | |
1296b8f2 | 282 | [ -e $(DESTDIR)$(sysconfdir)/init.d/shairport-sync ] || install -m 0755 scripts/shairport-sync $(DESTDIR)$(sysconfdir)/init.d |
931c7ed2 LR |
283 | |
284 | endif # INSTALL_SYSTEMV | |
285 | ||
f6eca4ca | 286 | if INSTALL_SYSTEMD |
931c7ed2 | 287 | |
38bbad6f | 288 | if USE_AVAHI |
931c7ed2 | 289 | SYSTEMD_SERVICE = shairport-sync.service-avahi |
38bbad6f | 290 | else |
931c7ed2 LR |
291 | SYSTEMD_SERVICE = shairport-sync.service |
292 | endif # USE_AVAHI | |
293 | ||
294 | INSTALL_SYSTEMD_TARGET = install-systemd-local | |
295 | ||
7f9e8116 MB |
296 | # watch out -- shairport-sync.service is created during the ./configure step and |
297 | # will be stored in a scripts folder in the _build_ folder | |
298 | # which will be the source folder if you're not using a separate build folder | |
299 | ||
931c7ed2 LR |
300 | $(INSTALL_SYSTEMD_TARGET): scripts/$(SYSTEMD_SERVICE) $(INSTALL_USER_TARGET) |
301 | install -d $(DESTDIR)$(systemdsystemunitdir) | |
7f9e8116 | 302 | [ -e $(DESTDIR)$(systemdsystemunitdir)/shairport-sync.service ] || install -m 0644 scripts/$(SYSTEMD_SERVICE) $(DESTDIR)$(systemdsystemunitdir)/shairport-sync.service |
931c7ed2 LR |
303 | |
304 | endif # INSTALL_SYSTEMD | |
305 | ||
f6eca4ca | 306 | if INSTALL_FREEBSD_SERVICE |
931c7ed2 LR |
307 | |
308 | # Choose a uid and gid of 801 completely arbitrarity, except that it should be below 1000. FreeBSD doesn't seem to allow you to say "an ID in the range of..." | |
309 | install-freebsd-user-local: | |
feaa9319 MB |
310 | pw showgroup shairport-sync > /dev/null 2>&1 || pw addgroup -n shairport-sync -g 801 > /dev/null 2>&1 |
311 | pw showuser shairport-sync > /dev/null 2>&1 || pw adduser -c "shairport-sync unprivileged user" -n shairport-sync -u 801 -s /usr/sbin/nologin -d /nonexistent > /dev/null 2>&1 | |
931c7ed2 LR |
312 | |
313 | INSTALL_FREEBSD_TARGET = install-freebsd-local | |
314 | ||
315 | $(INSTALL_FREEBSD_TARGET): scripts/shairport-sync.freebsd install-freebsd-user-local | |
316 | install -d -o shairport-sync -g shairport-sync $(DESTDIR)/var/run/shairport-sync | |
317 | install -d $(DESTDIR)/usr/local/etc/rc.d/ | |
1092a8c1 | 318 | install -m 0555 $(top_srcdir)/scripts/shairport-sync.freebsd $(DESTDIR)/usr/local/etc/rc.d/shairport_sync |
931c7ed2 LR |
319 | |
320 | endif # INSTALL_FREEBSD_SERVICE | |
321 | ||
623b9b4b | 322 | if INSTALL_CYGWIN_SERVICE |
931c7ed2 LR |
323 | |
324 | INSTALL_CYGWIN_TARGET = install-cygwin-local | |
325 | ||
326 | $(INSTALL_CYGWIN_TARGET): scripts/shairport-sync-config | |
327 | install -d $(DESTDIR)/usr/local/bin | |
1092a8c1 | 328 | [ -e $(DESTDIR)/usr/local/bin/shairport-sync-config ] || install -m 0755 $(top_srcdir)/scripts/shairport-sync-config $(DESTDIR)/usr/local/bin/ |
931c7ed2 LR |
329 | |
330 | endif # INSTALL_CYGWIN_SERVICE | |
331 | ||
332 | install-exec-hook: $(CONFIG_FILE_INSTALL_TARGET) \ | |
333 | $(DBUS_POLICY_INSTALL_TARGET) \ | |
334 | $(MPRIS_POLICY_INSTALL_TARGET) \ | |
335 | $(INSTALL_SYSTEMV_TARGET) \ | |
336 | $(INSTALL_SYSTEMD_TARGET) \ | |
337 | $(INSTALL_FREEBSD_TARGET) \ | |
338 | $(INSTALL_CYGWIN_TARGET) |