3 # This file is part of polypaudio.
5 # polypaudio is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # polypaudio is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with polypaudio; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 polypincludedir=$(includedir)/polyp
21 polypconfdir=$(sysconfdir)/polyp
23 AM_CFLAGS=-D_GNU_SOURCE -I$(top_srcdir) $(PTHREAD_CFLAGS)
24 AM_CFLAGS+= -DDLSEARCHDIR=\"$(pkglibdir)\"
25 AM_CFLAGS+="-DDEFAULT_CONFIG_FILE=\"$(polypconfdir)/polypaudio.pa\""
26 AM_CFLAGS+="-DPOLYPAUDIO_BINARY=\"$(bindir)/polypaudio\""
28 AM_LDADD=$(PTHREAD_LIBS) -lm
29 AM_LIBADD=$(PTHREAD_LIBS) -lm
31 EXTRA_DIST = polypaudio.pa depmod.py esdcompat.sh.in
32 bin_PROGRAMS = polypaudio pacat pactl
33 bin_SCRIPTS = esdcompat.sh
34 noinst_PROGRAMS = mainloop-test mainloop-test-glib mainloop-test-glib12 pacat-simple parec-simple cpulimit-test cpulimit-test2
36 polypconf_DATA=polypaudio.pa
38 BUILT_SOURCES=polyplib-version.h
40 polypinclude_HEADERS=polyplib.h \
46 polyplib-introspect.h \
47 polyplib-subscribe.h \
48 polyplib-operation.h \
58 pkglib_LTLIBRARIES=libiochannel.la \
73 libprotocol-simple.la \
74 libprotocol-esound.la \
75 libprotocol-native.la \
77 module-cli-protocol-tcp.la \
78 module-cli-protocol-unix.la \
80 module-pipe-source.la \
82 module-alsa-source.la \
85 module-simple-protocol-tcp.la \
86 module-simple-protocol-unix.la \
87 module-esound-protocol-tcp.la \
88 module-esound-protocol-unix.la \
89 module-native-protocol-tcp.la \
90 module-native-protocol-unix.la \
91 module-native-protocol-fd.la \
95 pkglib_LTLIBRARIES+=module-x11-bell.la
98 lib_LTLIBRARIES=libpolyp.la \
100 libpolyp-mainloop.la \
101 libpolyp-mainloop-glib.la \
102 libpolyp-mainloop-glib12.la \
105 polypaudio_SOURCES = idxset.c idxset.h \
109 mainloop.c mainloop.h \
110 memblock.c memblock.h \
112 sample-util.c sample-util.h \
113 memblockq.c memblockq.h \
116 source-output.c source-output.h \
117 sink-input.c sink-input.h \
121 mainloop-signal.c mainloop-signal.h \
122 mainloop-api.c mainloop-api.h \
124 hashmap.c hashmap.h \
125 namereg.c namereg.h \
127 resampler.c resampler.h \
129 memchunk.c memchunk.h \
130 sconv-s16le.c sconv-s16le.h \
131 sconv-s16be.c sconv-s16be.h \
133 modargs.c modargs.h \
134 cmdline.c cmdline.h \
135 cli-command.c cli-command.h \
136 cli-text.c cli-text.h \
137 tokenizer.c tokenizer.h \
138 dynarray.c dynarray.h \
140 sound-file.c sound-file.h \
141 play-memchunk.c play-memchunk.h \
142 autoload.c autoload.h \
143 xmalloc.c xmalloc.h \
144 subscribe.h subscribe.c \
146 sound-file-stream.c sound-file-stream.h \
147 cpulimit.c cpulimit.h \
151 polypaudio_CFLAGS = $(AM_CFLAGS) $(LIBSAMPLERATE_CFLAGS) $(LIBSNDFILE_CFLAGS)
152 polypaudio_INCLUDES = $(INCLTDL)
153 polypaudio_LDADD = $(AM_LDADD) $(LIBLTDL) $(LIBSAMPLERATE_LIBS) $(LIBSNDFILE_LIBS)
154 polypaudio_LDFLAGS=-export-dynamic
156 libprotocol_simple_la_SOURCES = protocol-simple.c protocol-simple.h
157 libprotocol_simple_la_LDFLAGS = -avoid-version
158 libprotocol_simple_la_LIBADD = $(AM_LIBADD) libsocket-server.la libiochannel.la
160 libsocket_server_la_SOURCES = socket-server.c socket-server.h
161 libsocket_server_la_LDFLAGS = -avoid-version
162 libsocket_server_la_LIBADD = $(AM_LIBADD) libiochannel.la libsocket-util.la
164 libsocket_client_la_SOURCES = socket-client.c socket-client.h
165 libsocket_client_la_LDFLAGS = -avoid-version
166 libsocket_client_la_LIBADD = $(AM_LIBADD) libiochannel.la libsocket-util.la
168 libpstream_la_SOURCES = pstream.c pstream.h
169 libpstream_la_LDFLAGS = -avoid-version
170 libpstream_la_LIBADD = $(AM_LIBADD) libpacket.la libiochannel.la
172 libpstream_util_la_SOURCES = pstream-util.c pstream-util.h
173 libpstream_util_la_LDFLAGS = -avoid-version
174 libpstream_util_la_LIBADD = $(AM_LIBADD) libpacket.la libpstream.la libtagstruct.la
176 libpdispatch_la_SOURCES = pdispatch.c pdispatch.h
177 libpdispatch_la_LDFLAGS = -avoid-version
178 libpdispatch_la_LIBADD = $(AM_LIBADD) libtagstruct.la
180 libiochannel_la_SOURCES = iochannel.c iochannel.h
181 libiochannel_la_LDFLAGS = -avoid-version
182 libiochannel_la_LIBADD = $(AM_LIBADD) libsocket-util.la
184 libpacket_la_SOURCES = packet.c packet.h
185 libpacket_la_LDFLAGS = -avoid-version
187 liboss_util_la_SOURCES = oss-util.c oss-util.h
188 liboss_util_la_LDFLAGS = -avoid-version
190 libalsa_util_la_SOURCES = alsa-util.c alsa-util.h
191 libalsa_util_la_LDFLAGS = -avoid-version
192 libalsa_util_la_LIBADD = $(AM_LIBADD) $(ASOUNDLIB_LIBS)
193 libalsa_util_la_CFLAGS = $(AM_CFLAGS) $(ASOUNDLIB_CFLAGS)
195 libioline_la_SOURCES = ioline.c ioline.h
196 libioline_la_LDFLAGS = -avoid-version
197 libioline_la_LIBADD = $(AM_LIBADD) libiochannel.la
199 libcli_la_SOURCES = cli.c cli.h
200 libcli_la_LDFLAGS = -avoid-version
201 libcli_la_LIBADD = $(AM_LIBADD) libiochannel.la libioline.la
203 libprotocol_cli_la_SOURCES = protocol-cli.c protocol-cli.h
204 libprotocol_cli_la_LDFLAGS = -avoid-version
205 libprotocol_cli_la_LIBADD = $(AM_LIBADD) libsocket-server.la libiochannel.la libcli.la
207 libprotocol_native_la_SOURCES = protocol-native.c protocol-native.h native-common.h
208 libprotocol_native_la_LDFLAGS = -avoid-version
209 libprotocol_native_la_LIBADD = $(AM_LIBADD) libsocket-server.la libpstream.la libpstream-util.la libpdispatch.la libtagstruct.la libauthkey.la
211 libtagstruct_la_SOURCES = tagstruct.c tagstruct.h
212 libtagstruct_la_LDFLAGS = -avoid-version
214 libprotocol_esound_la_SOURCES = protocol-esound.c protocol-esound.h esound.h
215 libprotocol_esound_la_LDFLAGS = -avoid-version
216 libprotocol_esound_la_LIBADD = $(AM_LIBADD) libsocket-server.la libiochannel.la libauthkey.la
218 libauthkey_la_SOURCES = authkey.c authkey.h
219 libauthkey_la_LDFLAGS = -avoid-version
221 libsocket_util_la_SOURCES = socket-util.c socket-util.h
222 libsocket_util_la_LDFLAGS = -avoid-version
224 module_simple_protocol_tcp_la_SOURCES = module-protocol-stub.c
225 module_simple_protocol_tcp_la_CFLAGS = -DUSE_TCP_SOCKETS -DUSE_PROTOCOL_SIMPLE $(AM_CFLAGS)
226 module_simple_protocol_tcp_la_LDFLAGS = -module -avoid-version
227 module_simple_protocol_tcp_la_LIBADD = $(AM_LIBADD) libprotocol-simple.la libsocket-server.la
229 module_simple_protocol_unix_la_SOURCES = module-protocol-stub.c
230 module_simple_protocol_unix_la_CFLAGS = -DUSE_UNIX_SOCKETS -DUSE_PROTOCOL_SIMPLE $(AM_CFLAGS)
231 module_simple_protocol_unix_la_LDFLAGS = -module -avoid-version
232 module_simple_protocol_unix_la_LIBADD = $(AM_LIBADD) libprotocol-simple.la libsocket-server.la libsocket-util.la
234 module_cli_protocol_tcp_la_SOURCES = module-protocol-stub.c
235 module_cli_protocol_tcp_la_CFLAGS = -DUSE_TCP_SOCKETS -DUSE_PROTOCOL_CLI $(AM_CFLAGS)
236 module_cli_protocol_tcp_la_LDFLAGS = -module -avoid-version
237 module_cli_protocol_tcp_la_LIBADD = $(AM_LIBADD) libprotocol-cli.la libsocket-server.la
239 module_cli_protocol_unix_la_SOURCES = module-protocol-stub.c
240 module_cli_protocol_unix_la_CFLAGS = -DUSE_UNIX_SOCKETS -DUSE_PROTOCOL_CLI $(AM_CFLAGS)
241 module_cli_protocol_unix_la_LDFLAGS = -module -avoid-version
242 module_cli_protocol_unix_la_LIBADD = $(AM_LIBADD) libprotocol-cli.la libsocket-server.la libsocket-util.la
244 module_native_protocol_tcp_la_SOURCES = module-protocol-stub.c
245 module_native_protocol_tcp_la_CFLAGS = -DUSE_TCP_SOCKETS -DUSE_PROTOCOL_NATIVE $(AM_CFLAGS)
246 module_native_protocol_tcp_la_LDFLAGS = -module -avoid-version
247 module_native_protocol_tcp_la_LIBADD = $(AM_LIBADD) libprotocol-native.la libsocket-server.la
249 module_native_protocol_unix_la_SOURCES = module-protocol-stub.c
250 module_native_protocol_unix_la_CFLAGS = -DUSE_UNIX_SOCKETS -DUSE_PROTOCOL_NATIVE $(AM_CFLAGS)
251 module_native_protocol_unix_la_LDFLAGS = -module -avoid-version
252 module_native_protocol_unix_la_LIBADD = $(AM_LIBADD) libprotocol-native.la libsocket-server.la libsocket-util.la
254 module_native_protocol_fd_la_SOURCES = module-native-protocol-fd.c
255 module_native_protocol_fd_la_CFLAGS = $(AM_CFLAGS)
256 module_native_protocol_fd_la_LDFLAGS = -module -avoid-version
257 module_native_protocol_fd_la_LIBADD = $(AM_LIBADD) libprotocol-native.la libsocket-server.la libsocket-util.la
259 module_esound_protocol_tcp_la_SOURCES = module-protocol-stub.c
260 module_esound_protocol_tcp_la_CFLAGS = -DUSE_TCP_SOCKETS -DUSE_PROTOCOL_ESOUND $(AM_CFLAGS)
261 module_esound_protocol_tcp_la_LDFLAGS = -module -avoid-version
262 module_esound_protocol_tcp_la_LIBADD = $(AM_LIBADD) libprotocol-esound.la libsocket-server.la
264 module_esound_protocol_unix_la_SOURCES = module-protocol-stub.c
265 module_esound_protocol_unix_la_CFLAGS = -DUSE_UNIX_SOCKETS -DUSE_PROTOCOL_ESOUND $(AM_CFLAGS)
266 module_esound_protocol_unix_la_LDFLAGS = -module -avoid-version
267 module_esound_protocol_unix_la_LIBADD = $(AM_LIBADD) libprotocol-esound.la libsocket-server.la libsocket-util.la
269 module_pipe_sink_la_SOURCES = module-pipe-sink.c
270 module_pipe_sink_la_LDFLAGS = -module -avoid-version
271 module_pipe_sink_la_LIBADD = $(AM_LIBADD) libiochannel.la
273 module_pipe_source_la_SOURCES = module-pipe-source.c
274 module_pipe_source_la_LDFLAGS = -module -avoid-version
275 module_pipe_source_la_LIBADD = $(AM_LIBADD) libiochannel.la
277 module_alsa_sink_la_SOURCES = module-alsa-sink.c
278 module_alsa_sink_la_LDFLAGS = -module -avoid-version
279 module_alsa_sink_la_LIBADD = $(AM_LIBADD) $(ASOUNDLIB_LIBS) libalsa-util.la
280 module_alsa_sink_la_CFLAGS = $(AM_CFLAGS) $(ASOUNDLIB_CFLAGS)
282 module_alsa_source_la_SOURCES = module-alsa-source.c
283 module_alsa_source_la_LDFLAGS = -module -avoid-version
284 module_alsa_source_la_LIBADD = $(AM_LIBADD) $(ASOUNDLIB_LIBS) libalsa-util.la
285 module_alsa_source_la_CFLAGS = $(AM_CFLAGS) $(ASOUNDLIB_CFLAGS)
287 module_oss_la_SOURCES = module-oss.c
288 module_oss_la_LDFLAGS = -module -avoid-version
289 module_oss_la_LIBADD = $(AM_LIBADD) libiochannel.la liboss-util.la
291 module_oss_mmap_la_SOURCES = module-oss-mmap.c
292 module_oss_mmap_la_LDFLAGS = -module -avoid-version
293 module_oss_mmap_la_LIBADD = $(AM_LIBADD) liboss-util.la
295 module_cli_la_SOURCES = module-cli.c
296 module_cli_la_LDFLAGS = -module -avoid-version
297 module_cli_la_LIBADD = $(AM_LIBADD) libcli.la libiochannel.la
299 module_sine_la_SOURCES = module-sine.c
300 module_sine_la_LDFLAGS = -module -avoid-version
301 module_sine_la_LIBADD = $(AM_LIBADD)
303 if !X_DISPLAY_MISSING
304 module_x11_bell_la_SOURCES = module-x11-bell.c
305 module_x11_bell_la_CFLAGS = $(AM_CFLAGS) $(X_CFLAGS)
306 module_x11_bell_la_LDFLAGS = -module -avoid-version
307 module_x11_bell_la_LIBADD = $(AM_LIBADD) $(X_PRE_LIBS) -lX11 $(X_LIBS) $(X_EXTRA_LIB)
310 libpolyp_la_SOURCES = polyplib.h \
312 tagstruct.c tagstruct.h \
313 iochannel.c iochannel.h \
314 pstream.c pstream.h \
315 pstream-util.c pstream-util.h \
316 pdispatch.c pdispatch.h \
317 mainloop-api.c mainloop-api.h \
320 memblock.c memblock.h \
321 socket-client.c socket-client.h \
324 dynarray.c dynarray.h \
325 memchunk.c memchunk.h \
326 authkey.c authkey.h \
327 socket-util.c socket-util.h \
330 xmalloc.c xmalloc.h \
331 polyplib-operation.c polyplib-operation.h \
332 polyplib-context.c polyplib-context.h \
333 polyplib-stream.c polyplib-stream.h \
334 polyplib-introspect.c polyplib-introspect.h \
335 polyplib-scache.c polyplib-scache.h \
336 polyplib-subscribe.c polyplib-subscribe.h \
337 polyplib-internal.h \
343 libpolyp_la_CFLAGS = $(AM_CFLAGS)
344 libpolyp_la_LDFLAGS = -version-info 0:0:0
346 libpolyp_mainloop_la_SOURCES = mainloop-api.h mainloop-api.c \
347 mainloop.c mainloop.h \
348 mainloop-signal.c mainloop-signal.h
349 libpolyp_mainloop_la_CFLAGS = $(AM_CFLAGS)
350 libpolyp_mainloop_la_LIBADD = $(AM_LIBADD) libpolyp.la
351 libpolyp_mainloop_la_LDFLAGS = -version-info 0:0:0
353 libpolyp_error_la_SOURCES = polyplib-error.c polyplib-error.h
354 libpolyp_error_la_CFLAGS = $(AM_CFLAGS)
355 libpolyp_error_la_LIBADD = $(AM_LIBADD) libpolyp.la
356 libpolyp_error_la_LDFLAGS = -version-info 0:0:0
358 libpolyp_simple_la_SOURCES = polyplib-simple.c polyplib-simple.h
359 libpolyp_simple_la_CFLAGS = $(AM_CFLAGS)
360 libpolyp_simple_la_LIBADD = $(AM_LIBADD) libpolyp.la libpolyp-mainloop.la
361 libpolyp_simple_la_LDFLAGS = -version-info 0:0:0
363 libpolyp_mainloop_glib_la_SOURCES = glib-mainloop.h glib-mainloop.c
364 libpolyp_mainloop_glib_la_CFLAGS = $(AM_CFLAGS) $(GLIB20_CFLAGS)
365 libpolyp_mainloop_glib_la_LIBADD = $(AM_LIBADD) libpolyp-mainloop.la $(GLIB20_LIBS)
366 libpolyp_mainloop_glib_la_LDFLAGS = -version-info 0:0:0
368 libpolyp_mainloop_glib12_la_SOURCES = glib-mainloop.h glib12-mainloop.c
369 libpolyp_mainloop_glib12_la_CFLAGS = $(AM_CFLAGS) $(GLIB12_CFLAGS)
370 libpolyp_mainloop_glib12_la_LIBADD = $(AM_LIBADD) libpolyp-mainloop.la $(GLIB12_LIBS)
371 libpolyp_mainloop_glib12_la_LDFLAGS = -version-info 0:0:0
373 pacat_SOURCES = pacat.c
374 pacat_LDADD = $(AM_LDADD) libpolyp.la libpolyp-error.la libpolyp-mainloop.la
375 pacat_CFLAGS = $(AM_CFLAGS)
377 pactl_SOURCES = pactl.c
378 pactl_LDADD = $(AM_LDADD) libpolyp.la libpolyp-error.la libpolyp-mainloop.la $(LIBSNDFILE_LIBS)
379 pactl_CFLAGS = $(AM_CFLAGS) $(LIBSDNFILE_CFLAGS)
381 pacat_simple_SOURCES = pacat-simple.c
382 pacat_simple_LDADD = $(AM_LDADD) libpolyp.la libpolyp-simple.la libpolyp-error.la
383 pacat_simple_CFLAGS = $(AM_CFLAGS)
385 parec_simple_SOURCES = parec-simple.c
386 parec_simple_LDADD = $(AM_LDADD) libpolyp.la libpolyp-simple.la libpolyp-error.la
387 parec_simple_CFLAGS = $(AM_CFLAGS)
389 mainloop_test_SOURCES = mainloop-test.c
390 mainloop_test_CFLAGS = $(AM_CFLAGS)
391 mainloop_test_LDADD = $(AM_LDADD) libpolyp-mainloop.la libpolyp.la
393 mainloop_test_glib_SOURCES = $(mainloop_test_SOURCES)
394 mainloop_test_glib_CFLAGS = $(mainloop_test_CFLAGS) $(GLIB20_CFLAGS) -DGLIB_MAIN_LOOP
395 mainloop_test_glib_LDADD = $(mainloop_test_LDADD) $(GLIB20_LIBS) libpolyp-mainloop-glib.la
397 mainloop_test_glib12_SOURCES = $(mainloop_test_SOURCES)
398 mainloop_test_glib12_CFLAGS = $(mainloop_test_CFLAGS) $(GLIB12_CFLAGS) -DGLIB_MAIN_LOOP
399 mainloop_test_glib12_LDADD = $(mainloop_test_LDADD) $(GLIB12_LIBS) libpolyp-mainloop-glib12.la
401 cpulimit_test_SOURCES = cpulimit-test.c cpulimit.c util.c log.c
402 cpulimit_test_CFLAGS = $(AM_CFLAGS)
403 cpulimit_test_LDADD = $(AM_LDADD) libpolyp-mainloop.la
405 cpulimit_test2_SOURCES = cpulimit-test.c cpulimit.c util.c log.c
406 cpulimit_test2_CFLAGS = $(AM_CFLAGS) -DTEST2
407 cpulimit_test2_LDADD = $(AM_LDADD) libpolyp-mainloop.la
410 if BUILD_LIBPOLYPCORE
412 polypinclude_HEADERS+=cli-command.h\
442 lib_LTLIBRARIES+= libpolypcore.la
444 libpolypcore_la_SOURCES = idxset.c idxset.h \
447 mainloop.c mainloop.h \
448 memblock.c memblock.h \
450 sample-util.c sample-util.h \
451 memblockq.c memblockq.h \
454 source-output.c source-output.h \
455 sink-input.c sink-input.h \
459 mainloop-signal.c mainloop-signal.h \
460 mainloop-api.c mainloop-api.h \
462 hashmap.c hashmap.h \
463 namereg.c namereg.h \
465 resampler.c resampler.h \
467 memchunk.c memchunk.h \
468 sconv-s16le.c sconv-s16le.h \
469 sconv-s16be.c sconv-s16be.h \
471 modargs.c modargs.h \
472 cli-command.c cli-command.h \
473 cli-text.c cli-text.h \
474 tokenizer.c tokenizer.h \
475 dynarray.c dynarray.h
484 esdcompat.sh: esdcompat.sh.in Makefile
485 sed -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
486 -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
487 -e 's,@POLYPAUDIO_BINARY\@,$(bindir)/polypaudio,g' < $< > $@