forked from mikebrady/shairport-sync
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.am
181 lines (147 loc) · 6.37 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
SUBDIRS = man
bin_PROGRAMS = shairport-sync
# See below for the flags for the test client program
shairport_sync_SOURCES = shairport.c rtsp.c mdns.c mdns_external.c common.c rtp.c player.c alac.c audio.c loudness.c
AM_CFLAGS = -Wno-multichar -DSYSCONFDIR=\"$(sysconfdir)\"
if BUILD_FOR_FREEBSD
AM_CPPFLAGS = -I/usr/local/include -Wno-multichar -DSYSCONFDIR=\"$(sysconfdir)\" -O2
else
if BUILD_FOR_OPENBSD
AM_CPPFLAGS = -I/usr/local/include -Wno-multichar -DSYSCONFDIR=\"$(sysconfdir)\"
else
AM_CPPFLAGS = -Wno-multichar -DSYSCONFDIR=\"$(sysconfdir)\"
endif
endif
if USE_APPLE_ALAC
shairport_sync_SOURCES += apple_alac.cpp
endif
if USE_CUSTOMPIDDIR
AM_CFLAGS+= \
-DPIDDIR=\"$(CUSTOM_PID_DIR)\"
endif
if USE_AVAHI
shairport_sync_SOURCES += mdns_avahi.c
endif
if USE_TINYSVCMDNS
shairport_sync_SOURCES += mdns_tinysvcmdns.c tinysvcmdns.c
endif
if USE_ALSA
shairport_sync_SOURCES += audio_alsa.c
endif
if USE_SNDIO
shairport_sync_SOURCES += audio_sndio.c
endif
if USE_STDOUT
shairport_sync_SOURCES += audio_stdout.c
endif
if USE_PIPE
shairport_sync_SOURCES += audio_pipe.c
endif
if USE_DUMMY
shairport_sync_SOURCES += audio_dummy.c
endif
if USE_AO
shairport_sync_SOURCES += audio_ao.c
endif
if USE_SOUNDIO
shairport_sync_SOURCES += audio_soundio.c
endif
if USE_PA
shairport_sync_SOURCES += audio_pa.c
endif
if USE_CONVOLUTION
shairport_sync_SOURCES += FFTConvolver/AudioFFT.cpp FFTConvolver/FFTConvolver.cpp FFTConvolver/Utilities.cpp FFTConvolver/convolver.cpp
AM_CXXFLAGS = -std=c++11
endif
if USE_GL
shairport_sync_SOURCES += audio_gl.c GLESVisualizer/Arabesque.c GLESVisualizer/colorspace.c GLESVisualizer/eglcore.c GLESVisualizer/encoding.c GLESVisualizer/glcore.c GLESVisualizer/noise.c GLESVisualizer/OpenGLES2Core.c GLESVisualizer/FreeType3D.c GLESVisualizer/globaltime.c GLESVisualizer/simpleJPEG.c GLESVisualizer/simplePNG.c
endif
if USE_HUE
shairport_sync_SOURCES += audio_hue.c
endif
if USE_I2C
shairport_sync_SOURCES += audio_i2c.c
endif
if USE_SPP
shairport_sync_SOURCES += audio_spp.c
endif
if USE_DNS_SD
shairport_sync_SOURCES += mdns_dns_sd.c
endif
if USE_DBUS
shairport_sync_SOURCES += dbus-service.c dbus-interface.c
BUILT_SOURCES = dbus-interface.h dbus-interface.c
# We don't want to install this header
noinst_HEADERS = $(BUILT_SOURCES)
# Correctly clean the generated headers, but keep the xml description
CLEANFILES = $(BUILT_SOURCES)
#Rule to generate the binding headers
dbus-interface.h: org.gnome.ShairportSync.xml
gdbus-codegen --interface-prefix org.gnome --generate-c-code dbus-interface org.gnome.ShairportSync.xml
dbus-interface.c: org.gnome.ShairportSync.xml
gdbus-codegen --interface-prefix org.gnome --generate-c-code dbus-interface org.gnome.ShairportSync.xml
endif
if USE_DBUS_CORE_AND_DACP
shairport_sync_SOURCES += dacp.c
endif
if USE_MPRIS
shairport_sync_SOURCES += mpris-service.c mpris-interface.c mpris-player-interface.c
BUILT_SOURCES = mpris-interface.h mpris-interface.c mpris-player-interface.h mpris-player-interface.c
# We don't want to install this header
noinst_HEADERS = $(BUILT_SOURCES)
# Correctly clean the generated headers, but keep the xml description
CLEANFILES = $(BUILT_SOURCES)
#Rule to generate the binding headers
mpris-interface.h: org.mpris.MediaPlayer2.xml
gdbus-codegen --interface-prefix org.mpris --generate-c-code mpris-interface org.mpris.MediaPlayer2.xml
mpris-interface.c: org.mpris.MediaPlayer2.xml
gdbus-codegen --interface-prefix org.mpris --generate-c-code mpris-interface org.mpris.MediaPlayer2.xml
mpris-player-interface.h: org.mpris.MediaPlayer2.Player.xml
gdbus-codegen --interface-prefix org.mpris --generate-c-code mpris-player-interface org.mpris.MediaPlayer2.Player.xml
mpris-player-interface.c: org.mpris.MediaPlayer2.Player.xml
gdbus-codegen --interface-prefix org.mpris --generate-c-code mpris-player-interface org.mpris.MediaPlayer2.Player.xml
endif
if USE_DBUS_CLIENT
#Make it, but don't install it anywhere
noinst_PROGRAMS = shairport-sync-dbus-test-client
shairport_sync_dbus_test_client_SOURCES = dbus-interface.c dbus-interface.h shairport-sync-dbus-test-client.c
endif
if USE_MPRIS_CLIENT
#Make it, but don't install it anywhere
noinst_PROGRAMS = shairport-sync-mpris-test-client
shairport_sync_mpris_test_client_SOURCES = mpris-interface.c mpris-interface.h mpris-player-interface.c mpris-player-interface.h shairport-sync-mpris-test-client.c
endif
install-exec-hook:
if INSTALL_CONFIG_FILES
[ -e $(DESTDIR)$(sysconfdir) ] || mkdir $(DESTDIR)$(sysconfdir)
cp scripts/shairport-sync.conf $(DESTDIR)$(sysconfdir)/shairport-sync.conf.sample
[ -f $(DESTDIR)$(sysconfdir)/shairport-sync.conf ] || cp scripts/shairport-sync.conf $(DESTDIR)$(sysconfdir)/shairport-sync.conf
if USE_DBUS
cp scripts/shairport-sync-dbus-policy.conf $(DESTDIR)$(sysconfdir)/dbus-1/system.d/shairport-sync-dbus.conf
endif
if USE_MPRIS
cp scripts/shairport-sync-mpris-policy.conf $(DESTDIR)$(sysconfdir)/dbus-1/system.d/shairport-sync-mpris.conf
endif
endif
if INSTALL_SYSTEMV
getent group shairport-sync &>/dev/null || groupadd -r shairport-sync >/dev/null
getent passwd shairport-sync &> /dev/null || useradd -r -M -g shairport-sync -s /usr/bin/nologin -G audio shairport-sync >/dev/null
[ -e /var/run/shairport-sync ] || mkdir -p /var/run/shairport-sync
chown shairport-sync:shairport-sync /var/run/shairport-sync
[ -e $(DESTDIR)$(sysconfdir)/init.d ] || mkdir -p $(DESTDIR)$(sysconfdir)/init.d
[ -f $(DESTDIR)$(sysconfdir)/init.d/shairport-sync ] || cp scripts/shairport-sync $(DESTDIR)$(sysconfdir)/init.d/
endif
if INSTALL_SYSTEMD
getent group shairport-sync &>/dev/null || groupadd -r shairport-sync >/dev/null
getent passwd shairport-sync &> /dev/null || useradd -r -M -g shairport-sync -s /usr/bin/nologin -G audio shairport-sync >/dev/null
[ -e $(DESTDIR)$(systemdsystemunitdir) ] || mkdir -p $(DESTDIR)$(systemdsystemunitdir)
[ -f $(DESTDIR)$(systemdsystemunitdir)/shairport-sync.service ] || cp scripts/shairport-sync.service $(DESTDIR)$(systemdsystemunitdir)
endif
if INSTALL_FREEBSD_SERVICE
pw showgroup shairport-sync > /dev/null 2>&1 || pw addgroup shairport-sync > /dev/null 2>&1
pw showuser shairport-sync > /dev/null 2>&1 || pw adduser shairport-sync > /dev/null 2>&1
[ -e /var/run/shairport-sync ] || mkdir -p /var/run/shairport-sync
chown shairport-sync:shairport-sync /var/run/shairport-sync
[ -f /usr/local/etc/rc.d/shairport_sync ] || cp scripts/shairport-sync.freebsd /usr/local/etc/rc.d/shairport_sync
chmod 555 /usr/local/etc/rc.d/shairport_sync
endif