• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1if host_machine.system() != 'windows'
2  subdir('rtp')
3endif
4
5# module name, sources, [headers, extra flags, extra deps, extra libs]
6all_modules = [
7  [ 'module-allow-passthrough', 'module-allow-passthrough.c' ],
8  [ 'module-always-sink', 'module-always-sink.c' ],
9  [ 'module-always-source', 'module-always-source.c' ],
10  [ 'module-augment-properties', 'module-augment-properties.c' ],
11  [ 'module-card-restore', 'module-card-restore.c' ],
12  [ 'module-cli', 'module-cli.c', [], [], [], libcli ],
13  [ 'module-cli-protocol-tcp', 'module-protocol-stub.c', [], ['-DUSE_PROTOCOL_CLI', '-DUSE_TCP_SOCKETS'], [], libprotocol_cli ],
14  [ 'module-cli-protocol-unix', 'module-protocol-stub.c', [], ['-DUSE_PROTOCOL_CLI', '-DUSE_UNIX_SOCKETS'], [], libprotocol_cli ],
15  [ 'module-combine', 'module-combine.c' ],
16  [ 'module-combine-sink', 'module-combine-sink.c', [], [], [libatomic_ops_dep] ],
17  [ 'module-default-device-restore', 'module-default-device-restore.c', [], [], [], libprotocol_native ],
18  [ 'module-detect', 'module-detect.c' ],
19  [ 'module-device-manager', 'module-device-manager.c', [], [], [], libprotocol_native ],
20  [ 'module-device-restore', 'module-device-restore.c', [], [], [dbus_dep], libprotocol_native ],
21#  [ 'module-esound-compat-spawnfd', 'module-esound-compat-spawnfd.c' ],
22#  [ 'module-esound-compat-spawnpid', 'module-esound-compat-spawnpid.c' ],
23#  [ 'module-esound-protocol-tcp', 'module-protocol-stub.c' ],
24#  [ 'module-esound-protocol-unix', 'module-protocol-stub.c' ],
25#  [ 'module-esound-sink', 'module-esound-sink.c' ],
26  [ 'module-filter-apply', 'module-filter-apply.c' ],
27  [ 'module-filter-heuristics', 'module-filter-heuristics.c' ],
28  [ 'module-http-protocol-tcp', 'module-protocol-stub.c', [], ['-DUSE_PROTOCOL_HTTP', '-DUSE_TCP_SOCKETS'], [], libprotocol_http ],
29  [ 'module-http-protocol-unix', 'module-protocol-stub.c', [], ['-DUSE_PROTOCOL_HTTP', '-DUSE_UNIX_SOCKETS'], [], libprotocol_http ],
30  [ 'module-intended-roles', 'module-intended-roles.c' ],
31  [ 'module-ladspa-sink', 'module-ladspa-sink.c', 'ladspa.h', ['-DLADSPA_PATH=' + join_paths(libdir, 'ladspa') + ':/usr/local/lib/ladspa:/usr/lib/ladspa:/usr/local/lib64/ladspa:/usr/lib64/ladspa'], [dbus_dep, libm_dep, ltdl_dep] ],
32  [ 'module-loopback', 'module-loopback.c' ],
33  [ 'module-match', 'module-match.c' ],
34  [ 'module-native-protocol-fd', 'module-native-protocol-fd.c', [], [], [], libprotocol_native ],
35  [ 'module-native-protocol-tcp', 'module-protocol-stub.c', [], ['-DUSE_PROTOCOL_NATIVE', '-DUSE_TCP_SOCKETS'], [], libprotocol_native ],
36  [ 'module-native-protocol-unix', 'module-protocol-stub.c', [], ['-DUSE_PROTOCOL_NATIVE', '-DUSE_UNIX_SOCKETS'], [], libprotocol_native ],
37  [ 'module-null-sink', 'module-null-sink.c' ],
38  [ 'module-null-source', 'module-null-source.c' ],
39  [ 'module-position-event-sounds', 'module-position-event-sounds.c' ],
40  [ 'module-remap-sink', 'module-remap-sink.c' ],
41  [ 'module-remap-source', 'module-remap-source.c' ],
42  [ 'module-rescue-streams', 'module-rescue-streams.c' ],
43  [ 'module-role-cork', ['module-role-cork.c', 'stream-interaction.c'], 'stream-interaction.h' ],
44  [ 'module-role-ducking', ['module-role-ducking.c', 'stream-interaction.c'], 'stream-interaction.h' ],
45  [ 'module-simple-protocol-tcp', 'module-protocol-stub.c', [], ['-DUSE_PROTOCOL_SIMPLE', '-DUSE_TCP_SOCKETS'], [], libprotocol_simple ],
46  [ 'module-simple-protocol-unix', 'module-protocol-stub.c', [], ['-DUSE_PROTOCOL_SIMPLE', '-DUSE_UNIX_SOCKETS'], [], libprotocol_simple ],
47  [ 'module-sine', 'module-sine.c' ],
48  [ 'module-sine-source', 'module-sine-source.c' ],
49#  [ 'module-solaris', 'module-solaris.c' ],
50  [ 'module-stream-restore', 'module-stream-restore.c', [], [], [dbus_dep], libprotocol_native ],
51  [ 'module-suspend-on-idle', 'module-suspend-on-idle.c' ],
52  [ 'module-switch-on-connect', 'module-switch-on-connect.c' ],
53  [ 'module-switch-on-port-available', 'module-switch-on-port-available.c' ],
54  [ 'module-tunnel-sink', ['module-tunnel.c', 'restart-module.c'], [], ['-DTUNNEL_SINK=1'], [x11_dep] ],
55  [ 'module-tunnel-sink-new', ['module-tunnel-sink-new.c', 'restart-module.c'] ],
56  [ 'module-tunnel-source', ['module-tunnel.c', 'restart-module.c'], [], [], [x11_dep] ],
57  [ 'module-tunnel-source-new', ['module-tunnel-source-new.c', 'restart-module.c'] ],
58  [ 'module-virtual-sink', 'module-virtual-sink.c' ],
59  [ 'module-virtual-source', 'module-virtual-source.c' ],
60  [ 'module-volume-restore', 'module-volume-restore.c' ],
61]
62
63if host_machine.system() == 'windows'
64  winmm_dep = meson.get_compiler('c').find_library('winmm')
65  ksuser_dep = meson.get_compiler('c').find_library('ksuser')
66  all_modules += [
67    [ 'module-waveout', 'module-waveout.c', [], [], [winmm_dep, ksuser_dep] ],
68  ]
69endif
70
71if host_machine.system() != 'windows'
72  all_modules += [
73    [ 'module-rtp-recv', 'rtp/module-rtp-recv.c', [], [], [libatomic_ops_dep], librtp ],
74    [ 'module-rtp-send', 'rtp/module-rtp-send.c' , [], [], [], librtp ],
75  ]
76endif
77
78if host_machine.system() == 'darwin'
79  bonjour_dep = dependency('appleframeworks', modules : ['CoreFoundation'])
80  coreaudio_dep = dependency('appleframeworks', modules : ['CoreAudio'])
81  all_modules += [
82    [ 'module-bonjour-publish', 'macosx/module-bonjour-publish.c', [], [], [bonjour_dep] ],
83    [ 'module-coreaudio-detect', 'macosx/module-coreaudio-detect.c', [], [], [coreaudio_dep] ],
84    [ 'module-coreaudio-device', 'macosx/module-coreaudio-device.c', [], [], [coreaudio_dep] ],
85  ]
86endif
87
88# Modules enabled by headers
89
90if cc.has_header('linux/input.h')
91  all_modules += [
92    [ 'module-mmkbd-evdev', 'module-mmkbd-evdev.c' ],
93  ]
94endif
95
96if cdata.has('HAVE_OSS_OUTPUT')
97  subdir('oss')
98  all_modules += [
99    [ 'module-oss', 'oss/module-oss.c', [], [], [], liboss_util ],
100  ]
101endif
102
103if cc.has_function('mkfifo')
104  all_modules += [
105    [ 'module-pipe-sink', 'module-pipe-sink.c' ],
106    [ 'module-pipe-source', 'module-pipe-source.c' ]
107  ]
108endif
109
110# Modules enabled by dependencies
111
112if alsa_dep.found()
113  subdir('alsa')
114  all_modules += [
115    [ 'module-alsa-card', 'alsa/module-alsa-card.c', [], [], [alsa_dep, libm_dep], libalsa_util ],
116    [ 'module-alsa-sink', 'alsa/module-alsa-sink.c', [], [], [alsa_dep, libm_dep], libalsa_util ],
117    [ 'module-alsa-source', 'alsa/module-alsa-source.c', [], [], [alsa_dep, libm_dep], libalsa_util ],
118  ]
119endif
120
121if avahi_dep.found()
122  all_modules += [
123    [ 'module-zeroconf-discover', 'module-zeroconf-discover.c', [], [], [avahi_dep], libavahi_wrap ],
124    [ 'module-zeroconf-publish', 'module-zeroconf-publish.c', [], [], [avahi_dep, dbus_dep], [libavahi_wrap, libprotocol_native] ],
125  ]
126endif
127
128if cdata.has('HAVE_BLUEZ_5')
129  subdir('bluetooth')
130  all_modules += [
131    [ 'module-bluetooth-discover', 'bluetooth/module-bluetooth-discover.c' ],
132    [ 'module-bluetooth-policy', 'bluetooth/module-bluetooth-policy.c', [], [], [dbus_dep] ],
133    [ 'module-bluez5-device', 'bluetooth/module-bluez5-device.c', [], [], [], libbluez5_util ],
134    [ 'module-bluez5-discover', 'bluetooth/module-bluez5-discover.c', [], [], [dbus_dep], libbluez5_util ],
135  ]
136endif
137
138if dbus_dep.found()
139  all_modules += [
140    [ 'module-dbus-protocol',
141      [ 'dbus/iface-card.c', 'dbus/iface-card.h',
142	'dbus/iface-card-profile.c', 'dbus/iface-card-profile.h',
143	'dbus/iface-client.c', 'dbus/iface-client.h',
144	'dbus/iface-core.c', 'dbus/iface-core.h',
145	'dbus/iface-device.c', 'dbus/iface-device.h',
146	'dbus/iface-device-port.c', 'dbus/iface-device-port.h',
147	'dbus/iface-memstats.c', 'dbus/iface-memstats.h',
148	'dbus/iface-module.c', 'dbus/iface-module.h',
149	'dbus/iface-sample.c', 'dbus/iface-sample.h',
150	'dbus/iface-stream.c', 'dbus/iface-stream.h',
151	'dbus/module-dbus-protocol.c',
152      ],
153      [], [], [dbus_dep] ],
154    [ 'module-rygel-media-server', 'module-rygel-media-server.c', [], [], [dbus_dep], libprotocol_http ],
155  ]
156
157  if not get_option('consolekit').disabled()
158    all_modules += [
159      [ 'module-console-kit', 'module-console-kit.c', [], [], [dbus_dep] ],
160    ]
161  endif
162endif
163
164if fftw_dep.found()
165  all_modules += [
166    [ 'module-virtual-surround-sink', 'module-virtual-surround-sink.c', [], [], [fftw_dep, libm_dep] ],
167  ]
168endif
169
170if dbus_dep.found() and fftw_dep.found()
171  all_modules += [
172    [ 'module-equalizer-sink', 'module-equalizer-sink.c', [], [], [dbus_dep, fftw_dep, libm_dep] ],
173  ]
174endif
175
176if get_option('gsettings').enabled() and glib_dep.found() and gio_dep.found()
177  subdir('gsettings')
178  all_modules += [
179    [ 'module-gsettings',
180      [ 'gsettings/module-gsettings.c', 'stdin-util.c', 'stdin-util.h' ],
181      [], ['-DPA_GSETTINGS_HELPER="' + join_paths(pulselibexecdir, 'gsettings-helper') + '"'] ]
182  ]
183endif
184
185if jack_dep.found()
186  all_modules += [
187    [ 'module-jack-sink', 'jack/module-jack-sink.c', [], [], [jack_dep] ],
188    [ 'module-jack-source', 'jack/module-jack-source.c', [], [], [jack_dep] ],
189  ]
190  if dbus_dep.found()
191    all_modules += [
192      [ 'module-jackdbus-detect', 'jack/module-jackdbus-detect.c', [], [], [dbus_dep] ],
193    ]
194  endif
195endif
196
197if lirc_dep.found()
198  all_modules += [
199    [ 'module-lirc', 'module-lirc.c', [], [], [lirc_dep] ],
200  ]
201endif
202
203if openssl_dep.found()
204  if host_machine.system() != 'windows'
205    subdir('raop')
206    all_modules += [
207      [ 'module-raop-sink', 'raop/module-raop-sink.c', [], [], [], libraop ],
208    ]
209  endif
210
211  if avahi_dep.found()
212    all_modules += [
213      [ 'module-raop-discover', 'raop/module-raop-discover.c', [], [], [avahi_dep], libavahi_wrap ],
214    ]
215  endif
216endif
217
218if libsystemd_dep.found() or libelogind_dep.found()
219  all_modules += [
220    [ 'module-systemd-login', 'module-systemd-login.c', [], [], [libsystemd_dep, libelogind_dep] ],
221  ]
222endif
223
224if udev_dep.found()
225  all_modules += [ [ 'module-udev-detect', 'module-udev-detect.c', [], [], [udev_dep] ] ]
226  if get_option('hal-compat')
227    all_modules += [ [ 'module-hal-detect', 'module-hal-detect-compat.c' ] ]
228  endif
229endif
230
231if host_machine.system() == 'freebsd'
232  all_modules += [ [ 'module-devd-detect', 'module-devd-detect.c', [], [], [] ] ]
233endif
234
235if x11_dep.found()
236  all_modules += [
237    [ 'module-x11-bell', 'x11/module-x11-bell.c', [], [], [x11_dep] ],
238    [ 'module-x11-cork-request', 'x11/module-x11-cork-request.c', [], [], [x11_dep, xtst_dep] ],
239    [ 'module-x11-publish', 'x11/module-x11-publish.c', [], [], [x11_dep], libprotocol_native ],
240    [ 'module-x11-xsmp', 'x11/module-x11-xsmp.c', [], [], [x11_dep, ice_dep, sm_dep] ],
241  ]
242endif
243
244# Module echo-cancel is quite modular itself and requires a section of its own
245
246module_echo_cancel_sources = [
247  'echo-cancel/echo-cancel.h',
248  'echo-cancel/module-echo-cancel.c',
249  'echo-cancel/null.c',
250]
251module_echo_cancel_orc_sources = []
252module_echo_cancel_flags = []
253module_echo_cancel_deps = [libatomic_ops_dep]
254module_echo_cancel_libs = []
255
256if get_option('adrian-aec')
257  module_echo_cancel_sources += [
258    'echo-cancel/adrian.c', 'echo-cancel/adrian.h',
259    'echo-cancel/adrian-aec.c', 'echo-cancel/adrian-aec.h',
260  ]
261  module_echo_cancel_flags += ['-DHAVE_ADRIAN_EC=1']
262  module_echo_cancel_deps += [libm_dep]
263
264  if have_orcc
265    orcsrc = 'adrian-aec'
266    orc_h = custom_target(orcsrc + '-orc-gen.h',
267      input : join_paths('echo-cancel', orcsrc + '.orc'),
268      output : orcsrc + '-orc-gen.h',
269      command : orcc_args + ['--header', '-o', '@OUTPUT@', '@INPUT@']
270    )
271    orc_c = custom_target(orcsrc + '-orc-gen.c',
272      input : join_paths('echo-cancel', orcsrc + '.orc'),
273      output : orcsrc + '-orc-gen.c',
274      command : orcc_args + ['--implementation', '-o', '@OUTPUT@', '@INPUT@']
275    )
276    module_echo_cancel_orc_sources += [orc_c, orc_h]
277    module_echo_cancel_deps += [orc_dep]
278  endif
279
280endif
281
282if speex_dep.found()
283  module_echo_cancel_sources += ['echo-cancel/speex.c']
284  module_echo_cancel_deps += [speex_dep]
285endif
286
287if webrtc_dep.found()
288  subdir('echo-cancel')
289  module_echo_cancel_libs += [libwebrtc_util]
290endif
291
292all_modules += [
293  [ 'module-echo-cancel',
294    module_echo_cancel_sources + module_echo_cancel_orc_sources,
295    [],
296    module_echo_cancel_flags,
297    module_echo_cancel_deps,
298    module_echo_cancel_libs,
299  ]
300]
301
302# Generate a shared module object for each modules
303
304# FIXME: Not all modules actually have a dep in modlibexecdir
305# FIXME: meson doesn't support multiple RPATH arguments currently
306rpath_dirs = join_paths(privlibdir) + ':' + join_paths(modlibexecdir)
307
308if host_machine.system() != 'windows' and host_machine.system() != 'darwin'
309  no_undefined_args = ['-Wl,--no-undefined']
310else
311  no_undefined_args = []
312endif
313
314foreach m : all_modules
315  name = m[0]
316  sources = m[1]
317  headers = m.get(2, [])
318  extra_flags = m.get(3, [])
319  extra_deps = m.get(4, [])
320  extra_libs = m.get(5, [])
321
322  mod = shared_module(name,
323    sources,
324    headers,
325    include_directories : [configinc, topinc, include_directories('.')],
326    c_args : [pa_c_args, server_c_args, '-DPA_MODULE_NAME=' + name.underscorify()] + extra_flags,
327    install : true,
328    install_rpath : rpath_dirs,
329    install_dir : modlibexecdir,
330    dependencies : [thread_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep, libintl_dep, platform_dep, platform_socket_dep] + extra_deps,
331    link_args : [nodelete_link_args, no_undefined_args],
332    link_with : extra_libs,
333    name_prefix : '',
334    implicit_include_directories : false)
335endforeach
336