Add default-monitor-time-sec
[platform/upstream/pulseaudio.git] / src / pulsecore / meson.build
1 libpulsecore_sources = [
2   'asyncmsgq.c',
3   'asyncq.c',
4   'auth-cookie.c',
5   'card.c',
6   'cli-command.c',
7   'cli-text.c',
8   'client.c',
9   'core-scache.c',
10   'core-subscribe.c',
11   'core.c',
12   'cpu.c',
13   'cpu-arm.c',
14   'cpu-orc.c',
15   'cpu-x86.c',
16   'device-port.c',
17   'database.c',
18   'ffmpeg/resample2.c',
19   'filter/biquad.c',
20   'filter/crossover.c',
21   'filter/lfe-filter.c',
22   'hook-list.c',
23   'ltdl-helper.c',
24   'message-handler.c',
25   'mix.c',
26   'modargs.c',
27   'modinfo.c',
28   'module.c',
29   'msgobject.c',
30   'namereg.c',
31   'object.c',
32   'play-memblockq.c',
33   'play-memchunk.c',
34   'remap.c',
35   'resampler.c',
36   'resampler/ffmpeg.c',
37   'resampler/peaks.c',
38   'resampler/trivial.c',
39   'rtpoll.c',
40   'sconv-s16be.c',
41   'sconv-s16le.c',
42   'sconv.c',
43   'shared.c',
44   'sink.c',
45   'sink-input.c',
46   'sioman.c',
47   'sound-file-stream.c',
48   'sound-file.c',
49   'source.c',
50   'source-output.c',
51   'start-child.c',
52   'stream-util.c',
53   'svolume_arm.c',
54   'svolume_c.c',
55   'svolume_mmx.c',
56   'svolume_sse.c',
57   'thread-mq.c',
58 ]
59
60 libpulsecore_headers = [
61   'asyncmsgq.h',
62   'asyncq.h',
63   'auth-cookie.h',
64   'atomic.h',
65   'card.h',
66   'cli-command.h',
67   'cli-text.h',
68   'client.h',
69   'creds.h',
70   'core.h',
71   'core-error.h',
72   'core-rtclock.h',
73   'core-scache.h',
74   'core-subscribe.h',
75   'core-util.h',
76   'cpu.h',
77   'cpu-arm.h',
78   'cpu-orc.h',
79   'cpu-x86.h',
80   'database.h',
81   'dbus-shared.h',
82   'dbus-util.h',
83   'device-port.h',
84   'dynarray.h',
85   'fdsem.h',
86   'ffmpeg/avcodec.h',
87   'ffmpeg/dsputil.h',
88   'filter/biquad.h',
89   'filter/crossover.h',
90   'filter/lfe-filter.h',
91   'hashmap.h',
92   'hook-list.h',
93   'i18n.h',
94   'idxset.h',
95   'iochannel.h',
96   'ipacl.h',
97   'llist.h',
98   'log.h',
99   'ltdl-helper.h',
100   'macro.h',
101   'message-handler.h',
102   'mem.h',
103   'memblock.h',
104   'memblockq.h',
105   'memchunk.h',
106   'mix.h',
107   'modargs.h',
108   'modinfo.h',
109   'module.h',
110   'msgobject.h',
111   'mutex.h',
112   'namereg.h',
113   'native-common.h',
114   'object.h',
115   'once.h',
116   'packet.h',
117   'parseaddr.h',
118   'pdispatch.h',
119   'play-memblockq.h',
120   'play-memchunk.h',
121   'poll.h',
122   'proplist-util.h',
123   'protocol-dbus.h',
124   'protocol-native.h',
125   'pstream.h',
126   'pstream-util.h',
127   'queue.h',
128   'refcnt.h',
129   'remap.h',
130   'resampler.h',
131   'rtpoll.h',
132   'sample-util.h',
133   'sconv.h',
134   'sconv-s16be.h',
135   'sconv-s16le.h',
136   'shared.h',
137   'sink-input.h',
138   'sink.h',
139   'sioman.h',
140   'socket.h',
141   'sound-file-stream.h',
142   'sound-file.h',
143   'source-output.h',
144   'source.h',
145   'srbchannel.h',
146   'start-child.h',
147   'strbuf.h',
148   'stream-util.h',
149   'strlist.h',
150   'time-smoother.h',
151   'tagstruct.h',
152   'thread-mq.h',
153   'thread.h',
154   'typedefs.h',
155 ]
156
157 if get_option('database') == 'tdb'
158   libpulsecore_sources += 'database-tdb.c'
159   database_c_args = '-DHAVE_TDB'
160 elif get_option('database') == 'gdbm'
161   libpulsecore_sources += 'database-gdbm.c'
162   database_c_args = '-DHAVE_GDBM'
163 else
164   libpulsecore_sources += 'database-simple.c'
165   database_c_args = '-DHAVE_SIMPLEDB'
166 endif
167
168 if dbus_dep.found()
169   libpulsecore_sources += [
170     'dbus-shared.c',
171     'protocol-dbus.c',
172   ]
173   libpulsecore_headers += [
174     'dbus-shared.h',
175     'protocol-dbus.h',
176   ]
177 endif
178
179 if enable_security
180   libpulsecore_sources += ['cynara.c']
181   libpulsecore_headers += ['cynara.h']
182 endif
183
184 if samplerate_dep.found()
185   libpulsecore_sources += ['resampler/libsamplerate.c']
186 endif
187
188 if soxr_dep.found()
189   libpulsecore_sources += ['resampler/soxr.c']
190 endif
191
192 if speex_dep.found()
193   libpulsecore_sources += ['resampler/speex.c']
194 endif
195
196 if x11_dep.found()
197   libpulsecore_sources += ['x11wrap.c']
198   libpulsecore_headers += ['x11wrap.h']
199 endif
200
201 orc_sources = []
202 orc_headers = []
203 if have_orcc
204   orcsrc = 'svolume'
205   orc_h = custom_target(orcsrc + '-orc-gen.h',
206     input : orcsrc + '.orc',
207     output : orcsrc + '-orc-gen.h',
208     command : orcc_args + ['--header', '-o', '@OUTPUT@', '@INPUT@']
209   )
210   orc_c = custom_target(orcsrc + '-orc-gen.c',
211     input : orcsrc + '.orc',
212     output : orcsrc + '-orc-gen.c',
213     command : orcc_args + ['--implementation', '-o', '@OUTPUT@', '@INPUT@']
214   )
215   orc_sources = [orc_c, 'svolume_orc.c']
216   orc_headers = [orc_h]
217 endif
218
219 # FIXME: walk through dependencies and add files
220
221 # FIXME: SIMD support (ORC)
222 simd = import('unstable-simd')
223 simd_variants = [
224   { 'mmx' : ['remap_mmx.c', 'svolume_mmx.c'] },
225   { 'sse' : ['remap_sse.c', 'sconv_sse.c', 'svolume_sse.c'] },
226   { 'neon' : ['remap_neon.c', 'sconv_neon.c', 'mix_neon.c'] },
227 ]
228
229 libpulsecore_simd_lib = []
230
231 foreach simd_kwargs : simd_variants
232
233   if host_machine.cpu_family() == 'arm' and 'neon' in simd_kwargs
234     if not cc.compiles('''
235         #include <arm_neon.h>
236         int main() {
237             return sizeof(uint8x8_t) + sizeof(int32x4_t) + sizeof(float32x4_t);
238         }
239         ''', name : 'neon code')
240       continue
241     endif
242   endif
243
244   libpulsecore_simd = simd.check('libpulsecore_simd',
245     kwargs : simd_kwargs,
246     c_args : [pa_c_args],
247     include_directories : [configinc, topinc],
248     implicit_include_directories : false,
249     compiler : cc)
250
251   libpulsecore_simd_lib += libpulsecore_simd[0]
252   cdata.merge_from(libpulsecore_simd[1])
253 endforeach
254
255 if host_machine.system() == 'windows'
256   libpulsecore_sources += ['mutex-win32.c',
257     'poll-win32.c',
258     'semaphore-win32.c',
259     'thread-win32.c',
260   ]
261 endif
262
263 libpulsecore = shared_library('pulsecore-' + pa_version_major_minor,
264   libpulsecore_sources, libpulsecore_headers,
265   orc_sources, orc_headers,
266   include_directories : [configinc, topinc],
267   c_args : [pa_c_args, server_c_args],
268   link_args : [nodelete_link_args],
269   install : true,
270   install_rpath : privlibdir,
271   install_dir : privlibdir,
272   link_with : libpulsecore_simd_lib,
273   dependencies : [libm_dep, libpulsecommon_dep, ltdl_dep, shm_dep, sndfile_dep, database_dep, dbus_dep, libatomic_ops_dep, orc_dep, samplerate_dep, soxr_dep, speex_dep, x11_dep, libintl_dep, platform_dep, platform_socket_dep, cynara_client_dep, cynara_creds_socket_dep, cynara_session_dep],
274   implicit_include_directories : false)
275
276 libpulsecore_dep = declare_dependency(link_with: libpulsecore)
277
278 install_data(
279   libpulsecore_headers,
280   install_dir : join_paths(includedir, 'pulsecore')
281 )
282
283 # Internal libraries for modules
284 # TODO: understand 'c_args' and 'dependencies' better, maybe we can remove some
285
286 libavahi_wrap = shared_library('avahi-wrap',
287   'avahi-wrap.c',
288   'avahi-wrap.h',
289   c_args : [pa_c_args, server_c_args, database_c_args],
290   link_args : [nodelete_link_args],
291   include_directories : [configinc, topinc],
292   dependencies : [libpulse_dep, libpulsecommon_dep, libpulsecore_dep, avahi_dep],
293   implicit_include_directories : false, # pulsecore/poll.h <vs> /usr/include/poll.h
294   install : true,
295   install_rpath : privlibdir,
296   install_dir : modlibexecdir,
297 )
298
299 libcli = shared_library('cli',
300   'cli.c',
301   'cli.h',
302   c_args : [pa_c_args, server_c_args, database_c_args],
303   link_args : [nodelete_link_args],
304   include_directories : [configinc, topinc],
305   dependencies : [libpulse_dep, libpulsecommon_dep, libpulsecore_dep],
306   install : true,
307   install_rpath : privlibdir,
308   install_dir : modlibexecdir,
309 )
310
311 libcli_dep = declare_dependency(link_with: libcli)
312
313 # FIXME: meson doesn't support multiple RPATH arguments currently
314 rpath_dirs = join_paths(privlibdir) + ':' + join_paths(modlibexecdir)
315
316 libprotocol_cli = shared_library('protocol-cli',
317   'protocol-cli.c',
318   'protocol-cli.h',
319   c_args : [pa_c_args, server_c_args, database_c_args],
320   link_args : [nodelete_link_args],
321   include_directories : [configinc, topinc],
322   dependencies : [libpulse_dep, libpulsecommon_dep, libpulsecore_dep, libcli_dep],
323   install : true,
324   install_rpath : rpath_dirs,
325   install_dir : modlibexecdir,
326 )
327
328 libprotocol_http = shared_library('protocol-http',
329   ['protocol-http.c', 'mime-type.c'],
330   ['protocol-http.h', 'mime-type.h'],
331   c_args : [pa_c_args, server_c_args, database_c_args],
332   link_args : [nodelete_link_args],
333   include_directories : [configinc, topinc],
334   dependencies : [libpulse_dep, libpulsecommon_dep, libpulsecore_dep],
335   install : true,
336   install_rpath : privlibdir,
337   install_dir : modlibexecdir,
338 )
339
340 libprotocol_native = shared_library('protocol-native',
341   'protocol-native.c',
342   ['protocol-native.h', 'native-common.h'],
343   c_args : [pa_c_args, server_c_args, database_c_args],
344   link_args : [nodelete_link_args],
345   include_directories : [configinc, topinc],
346   dependencies : [libpulse_dep, libpulsecommon_dep, libpulsecore_dep, dbus_dep],
347   install : true,
348   install_rpath : privlibdir,
349   install_dir : modlibexecdir,
350 )
351
352 libprotocol_simple = shared_library('protocol-simple',
353   'protocol-simple.c',
354   'protocol-simple.h',
355   c_args : [pa_c_args, server_c_args, database_c_args],
356   link_args : [nodelete_link_args],
357   include_directories : [configinc, topinc],
358   dependencies : [libpulse_dep, libpulsecommon_dep, libpulsecore_dep],
359   install : true,
360   install_rpath : privlibdir,
361   install_dir : modlibexecdir,
362 )