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