build-sys: meson: Rearrange dependencies under client and daemon options

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/659>
This commit is contained in:
Igor V. Kovalenko 2021-11-04 20:12:03 +03:00 committed by PulseAudio Marge Bot
parent 6dd14ad9f1
commit 80c0a497d3
2 changed files with 273 additions and 252 deletions

View file

@ -585,10 +585,62 @@ if host_machine.cpu_family() == 'arm'
endif endif
# NEON checks are automatically done by the unstable-simd module # NEON checks are automatically done by the unstable-simd module
# Dependencies common to client, daemon and modules
if get_option('ipv6')
cdata.set('HAVE_IPV6', 1)
endif
dbus_dep = dependency('dbus-1', version : '>= 1.4.12', required : get_option('dbus'))
if dbus_dep.found()
cdata.set('HAVE_DBUS', 1)
endif
sndfile_dep = dependency('sndfile', version : '>= 1.0.20')
libsystemd_dep = dependency('libsystemd', required : get_option('systemd'))
if libsystemd_dep.found()
cdata.set('HAVE_SYSTEMD_DAEMON', 1)
cdata.set('HAVE_SYSTEMD_LOGIN', 1)
cdata.set('HAVE_SYSTEMD_JOURNAL', 1)
endif
x11_dep = dependency('x11-xcb', required : get_option('x11'))
# OSS support
if cc.has_header('sys/soundcard.h', required: get_option('oss-output'))
# OSS output via daemon module-detect
cdata.set('HAVE_OSS_OUTPUT', 1)
# OSS wrapper
cdata.set('HAVE_OSS_WRAPPER', 1)
cdata.set('PULSEDSP_LOCATION', pulsedsp_location)
endif
# Client library dependencies
if get_option('client')
asyncns_dep = dependency('libasyncns', version : '>= 0.1', required : get_option('asyncns'))
if asyncns_dep.found()
cdata.set('HAVE_LIBASYNCNS', 1)
endif
glib_dep = dependency('glib-2.0', version : '>= 2.28.0', required: get_option('glib'))
if glib_dep.found()
cdata.set('HAVE_GLIB', 1)
cdata.set('HAVE_GLIB20', 1) # to match the AM_CONDITIONAL for CMake file generation
endif
gtk_dep = dependency('gtk+-3.0', required : get_option('gtk'))
if gtk_dep.found()
cdata.set('HAVE_GTK', 1)
endif
endif
# Daemon and module dependencies
if get_option('daemon') if get_option('daemon')
# FIXME: make sure it's >= 2.2 # FIXME: make sure it's >= 2.2
ltdl_dep = cc.find_library('ltdl', required : true) ltdl_dep = cc.find_library('ltdl', required : true)
endif
# FIXME: can meson support libtool -dlopen/-dlpreopen things? # FIXME: can meson support libtool -dlopen/-dlpreopen things?
# and do we still want to support this at all? # and do we still want to support this at all?
@ -602,10 +654,6 @@ else
database_dep = dependency('', required: false) database_dep = dependency('', required: false)
endif endif
if get_option('ipv6')
cdata.set('HAVE_IPV6', 1)
endif
if get_option('legacy-database-entry-format') if get_option('legacy-database-entry-format')
cdata.set('ENABLE_LEGACY_DATABASE_ENTRY_FORMAT', 1) cdata.set('ENABLE_LEGACY_DATABASE_ENTRY_FORMAT', 1)
endif endif
@ -628,16 +676,6 @@ if alsa_dep.found()
cdata.set('HAVE_ALSA_UCM', 1) cdata.set('HAVE_ALSA_UCM', 1)
endif endif
asyncns_dep = dependency('libasyncns', version : '>= 0.1', required : get_option('asyncns'))
if asyncns_dep.found()
cdata.set('HAVE_LIBASYNCNS', 1)
endif
dbus_dep = dependency('dbus-1', version : '>= 1.4.12', required : get_option('dbus'))
if dbus_dep.found()
cdata.set('HAVE_DBUS', 1)
endif
gio_dep = dependency('gio-2.0', version : '>= 2.26.0') gio_dep = dependency('gio-2.0', version : '>= 2.26.0')
if get_option('gsettings').enabled() if get_option('gsettings').enabled()
assert(gio_dep.found(), 'GSettings support needs glib I/O library (GIO)') assert(gio_dep.found(), 'GSettings support needs glib I/O library (GIO)')
@ -646,16 +684,6 @@ else
cdata.set('HAVE_GSETTINGS', 0) cdata.set('HAVE_GSETTINGS', 0)
endif endif
glib_dep = dependency('glib-2.0', version : '>= 2.28.0', required: get_option('glib'))
if glib_dep.found()
cdata.set('HAVE_GLIB', 1)
endif
gtk_dep = dependency('gtk+-3.0', required : get_option('gtk'))
if gtk_dep.found()
cdata.set('HAVE_GTK', 1)
endif
have_orcc = false have_orcc = false
orcc_args = [] orcc_args = []
orc_dep = dependency('orc-0.4', version : '>= 0.4.11', required : get_option('orc')) orc_dep = dependency('orc-0.4', version : '>= 0.4.11', required : get_option('orc'))
@ -674,19 +702,21 @@ if samplerate_dep.found()
cdata.set('HAVE_LIBSAMPLERATE', 1) cdata.set('HAVE_LIBSAMPLERATE', 1)
endif endif
sndfile_dep = dependency('sndfile', version : '>= 1.0.20') speex_dep = dependency('speexdsp', version : '>= 1.2', required : get_option('speex'))
if speex_dep.found()
cdata.set('HAVE_SPEEX', 1)
endif
soxr_dep = dependency('soxr', version : '>= 0.1.1', required : get_option('soxr')) soxr_dep = dependency('soxr', version : '>= 0.1.1', required : get_option('soxr'))
if soxr_dep.found() if soxr_dep.found()
cdata.set('HAVE_SOXR', 1) cdata.set('HAVE_SOXR', 1)
endif endif
libsystemd_dep = dependency('libsystemd', required : get_option('systemd')) webrtc_dep = dependency('webrtc-audio-processing', version : '>= 0.2', required : get_option('webrtc-aec'))
if libsystemd_dep.found() if webrtc_dep.found()
cdata.set('HAVE_SYSTEMD_DAEMON', 1) cdata.set('HAVE_WEBRTC', 1)
cdata.set('HAVE_SYSTEMD_LOGIN', 1)
cdata.set('HAVE_SYSTEMD_JOURNAL', 1)
endif endif
systemd_dep = dependency('systemd', required : get_option('systemd')) systemd_dep = dependency('systemd', required : get_option('systemd'))
if systemd_dep.found() and systemduserunitdir == '' if systemd_dep.found() and systemduserunitdir == ''
systemduserunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir') systemduserunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir')
@ -702,29 +732,17 @@ if cc.has_header('tcpd.h') and cc.has_function('hosts_access', dependencies : tc
cdata.set('HAVE_LIBWRAP', 1) cdata.set('HAVE_LIBWRAP', 1)
endif endif
x11_dep = dependency('x11-xcb', required : get_option('x11'))
if x11_dep.found() if x11_dep.found()
xcb_dep = dependency('xcb', required : true, version : '>= 1.6') xcb_dep = dependency('xcb', required : true, version : '>= 1.6')
ice_dep = dependency('ice', required : get_option('daemon')) ice_dep = dependency('ice', required : true)
sm_dep = dependency('sm', required : get_option('daemon')) sm_dep = dependency('sm', required : true)
xtst_dep = dependency('xtst', required : get_option('daemon')) xtst_dep = dependency('xtst', required : true)
cdata.set('HAVE_X11', 1) cdata.set('HAVE_X11', 1)
if cc.has_function('XSetIOErrorExitHandler', dependencies: x11_dep) if cc.has_function('XSetIOErrorExitHandler', dependencies: x11_dep)
cdata.set('HAVE_XSETIOERROREXITHANDLER', 1) cdata.set('HAVE_XSETIOERROREXITHANDLER', 1)
endif endif
endif endif
# Module dependencies
if cc.has_header('sys/soundcard.h', required: get_option('oss-output'))
cdata.set('HAVE_OSS_OUTPUT', 1)
cdata.set('HAVE_OSS_WRAPPER', 1)
cdata.set('PULSEDSP_LOCATION', pulsedsp_location)
endif
if get_option('hal-compat')
cdata.set('HAVE_HAL_COMPAT', 1)
endif
avahi_dep = dependency('avahi-client', version : '>= 0.6.0', required : get_option('avahi'), disabler : true) avahi_dep = dependency('avahi-client', version : '>= 0.6.0', required : get_option('avahi'), disabler : true)
if avahi_dep.found() if avahi_dep.found()
cdata.set('HAVE_AVAHI', 1) cdata.set('HAVE_AVAHI', 1)
@ -770,19 +788,13 @@ if openssl_dep.found()
cdata.set('HAVE_OPENSSL', 1) cdata.set('HAVE_OPENSSL', 1)
endif endif
speex_dep = dependency('speexdsp', version : '>= 1.2', required : get_option('speex'))
if speex_dep.found()
cdata.set('HAVE_SPEEX', 1)
endif
udev_dep = dependency('libudev', version : '>= 143', required : get_option('udev')) udev_dep = dependency('libudev', version : '>= 143', required : get_option('udev'))
if udev_dep.found() if udev_dep.found()
cdata.set('HAVE_UDEV', 1) cdata.set('HAVE_UDEV', 1)
endif endif
webrtc_dep = dependency('webrtc-audio-processing', version : '>= 0.2', required : get_option('webrtc-aec')) if get_option('hal-compat')
if webrtc_dep.found() cdata.set('HAVE_HAL_COMPAT', 1)
cdata.set('HAVE_WEBRTC', 1)
endif endif
gst_dep = dependency('gstreamer-1.0', version : '>= 1.14', required : get_option('gstreamer')) gst_dep = dependency('gstreamer-1.0', version : '>= 1.14', required : get_option('gstreamer'))
@ -803,13 +815,11 @@ if bluez5_gst_dep.found() and bluez5_gstapp_dep.found()
cdata.set('HAVE_GSTLDAC', 1) cdata.set('HAVE_GSTLDAC', 1)
cdata.set('HAVE_GSTAPTX', 1) cdata.set('HAVE_GSTAPTX', 1)
endif endif
endif
# These are required for the CMake file generation # These are required for the CMake file generation
cdata.set('PA_LIBDIR', libdir) cdata.set('PA_LIBDIR', libdir)
cdata.set('PA_INCDIR', includedir) cdata.set('PA_INCDIR', includedir)
if glib_dep.found()
cdata.set('HAVE_GLIB20', 1) # to match the AM_CONDITIONAL for CMake file generation
endif
# Test dependencies # Test dependencies
@ -838,10 +848,10 @@ endif
# Now generate config.h from everything above # Now generate config.h from everything above
configure_file(output : 'config.h', configuration : cdata) configure_file(output : 'config.h', configuration : cdata)
# pkg-config files
if get_option('client') if get_option('client')
# pkg-config files
pc_cdata = configuration_data() pc_cdata = configuration_data()
pc_cdata.set('prefix', prefix) pc_cdata.set('prefix', prefix)
@ -874,12 +884,8 @@ foreach file : pc_files
install_dir : pkgconfigdir) install_dir : pkgconfigdir)
endforeach endforeach
endif # client
# CMake files # CMake files
if get_option('client')
m4 = find_program('m4', required: true) m4 = find_program('m4', required: true)
cmakedir = join_paths(libdir, 'cmake', 'PulseAudio') cmakedir = join_paths(libdir, 'cmake', 'PulseAudio')
@ -939,49 +945,66 @@ summary = [
# 'LIBS: @0@'.format(${LIBS}), # 'LIBS: @0@'.format(${LIBS}),
'', '',
'Enable pulseaudio daemon: @0@'.format(get_option('daemon')), 'Enable pulseaudio daemon: @0@'.format(get_option('daemon')),
'Enable pulseaudio client: @0@'.format(get_option('client')),
'', '',
'Enable memfd shared memory: @0@'.format(cdata.has('HAVE_MEMFD')), 'Enable memfd shared memory: @0@'.format(cdata.has('HAVE_MEMFD')),
'Enable X11: @0@'.format(x11_dep.found()), 'Enable X11: @0@'.format(x11_dep.found()),
' Safe X11 I/O errors: @0@'.format(cdata.has('HAVE_XSETIOERROREXITHANDLER')),
'Enable OSS Output: @0@'.format(cdata.has('HAVE_OSS_OUTPUT')),
'Enable OSS Wrapper: @0@'.format(cdata.has('HAVE_OSS_WRAPPER')),
# 'Enable EsounD: @0@'.format(${ENABLE_ESOUND}),
'Enable Alsa: @0@'.format(alsa_dep.found()),
# 'Enable CoreAudio: @0@'.format(${ENABLE_COREAUDIO}),
# 'Enable Solaris: @0@'.format(${ENABLE_SOLARIS}),
# 'Enable WaveOut: @0@'.format(${ENABLE_WAVEOUT}),
'Enable GLib 2: @0@'.format(glib_dep.found()),
'Enable GSettings: @0@'.format(gio_dep.found()),
'Enable Gtk+ 3: @0@'.format(gtk_dep.found()),
'Enable Avahi: @0@'.format(avahi_dep.found()),
'Enable Jack: @0@'.format(jack_dep.found()),
'Enable Async DNS: @0@'.format(asyncns_dep.found()),
'Enable LIRC: @0@'.format(lirc_dep.found()),
'Enable D-Bus: @0@'.format(dbus_dep.found()), 'Enable D-Bus: @0@'.format(dbus_dep.found()),
' Enable BlueZ 5: @0@'.format(cdata.has('HAVE_BLUEZ_5')), 'Enable systemd integration: @0@'.format(libsystemd_dep.found()),
' Enable native headsets: @0@'.format(cdata.has('HAVE_BLUEZ_5_NATIVE_HEADSET')),
' Enable ofono headsets: @0@'.format(cdata.has('HAVE_BLUEZ_5_OFONO_HEADSET')),
' Enable GStreamer based codecs: @0@'.format(have_bluez5_gstreamer),
'Enable udev: @0@'.format(udev_dep.found()),
' Enable HAL->udev compat: @0@'.format(get_option('hal-compat')),
'Enable systemd: @0@'.format(libsystemd_dep.found()),
'Enable elogind: @0@'.format(libelogind_dep.found()),
'Enable TCP Wrappers: @0@'.format(tcpwrap_dep.found()),
'Enable libsamplerate: @0@'.format(samplerate_dep.found()),
'Enable IPv6: @0@'.format(get_option('ipv6')), 'Enable IPv6: @0@'.format(get_option('ipv6')),
'Enable OpenSSL (for Airtunes): @0@'.format(openssl_dep.found()),
'Enable FFTW: @0@'.format(fftw_dep.found()),
'Enable ORC: @0@'.format(have_orcc),
'Enable GStreamer: @0@'.format(have_gstreamer),
'Enable Adrian echo canceller: @0@'.format(get_option('adrian-aec')),
'Enable Speex (resampler, AEC): @0@'.format(speex_dep.found()),
'Enable SoXR (resampler): @0@'.format(soxr_dep.found()),
'Enable WebRTC echo canceller: @0@'.format(webrtc_dep.found()),
'Enable Gcov coverage: @0@'.format(get_option('gcov')), 'Enable Gcov coverage: @0@'.format(get_option('gcov')),
'Enable Valgrind: @0@'.format(cdata.has('HAVE_VALGRIND_MEMCHECK_H')), 'Enable Valgrind: @0@'.format(cdata.has('HAVE_VALGRIND_MEMCHECK_H')),
'Enable man pages: @0@'.format(get_option('man')), 'Enable man pages: @0@'.format(get_option('man')),
'Enable unit tests: @0@'.format(get_option('tests')), 'Enable unit tests: @0@'.format(get_option('tests')),
]
if get_option('client')
summary += [
'', '',
'--- Pulseaudio client features ---',
'',
'Enable GLib 2: @0@'.format(glib_dep.found()),
'Enable Gtk+ 3: @0@'.format(gtk_dep.found()),
'Enable Async DNS: @0@'.format(asyncns_dep.found()),
'Enable OSS Wrapper: @0@'.format(cdata.has('HAVE_OSS_WRAPPER')),
]
endif
if get_option('daemon')
summary += [
'',
'--- Pulseaudio daemon features ---',
'',
'Safe X11 I/O errors: @0@'.format(cdata.has('HAVE_XSETIOERROREXITHANDLER')),
'Enable Avahi: @0@'.format(avahi_dep.found()),
'Enable OSS Output: @0@'.format(cdata.has('HAVE_OSS_OUTPUT')),
# 'Enable EsounD: @0@'.format(${ENABLE_ESOUND}),
'Enable Alsa: @0@'.format(alsa_dep.found()),
'Enable Jack: @0@'.format(jack_dep.found()),
'Enable LIRC: @0@'.format(lirc_dep.found()),
# 'Enable CoreAudio: @0@'.format(${ENABLE_COREAUDIO}),
# 'Enable Solaris: @0@'.format(${ENABLE_SOLARIS}),
# 'Enable WaveOut: @0@'.format(${ENABLE_WAVEOUT}),
'Enable GSettings: @0@'.format(gio_dep.found()),
'Enable BlueZ 5: @0@'.format(cdata.has('HAVE_BLUEZ_5')),
' Enable native headsets: @0@'.format(cdata.has('HAVE_BLUEZ_5_NATIVE_HEADSET')),
' Enable ofono headsets: @0@'.format(cdata.has('HAVE_BLUEZ_5_OFONO_HEADSET')),
' Enable GStreamer based codecs: @0@'.format(have_bluez5_gstreamer),
'Enable GStreamer: @0@'.format(have_gstreamer),
'Enable libsamplerate: @0@'.format(samplerate_dep.found()),
'Enable FFTW: @0@'.format(fftw_dep.found()),
'Enable ORC: @0@'.format(have_orcc),
'Enable Adrian echo canceller: @0@'.format(get_option('adrian-aec')),
'Enable Speex (resampler, AEC): @0@'.format(speex_dep.found()),
'Enable SoXR (resampler): @0@'.format(soxr_dep.found()),
'Enable WebRTC echo canceller: @0@'.format(webrtc_dep.found()),
'',
'Enable udev: @0@'.format(udev_dep.found()),
' Enable HAL->udev compat: @0@'.format(get_option('hal-compat')),
'Enable systemd units: @0@'.format(systemd_dep.found()),
'Enable elogind: @0@'.format(libelogind_dep.found()),
'Enable TCP Wrappers: @0@'.format(tcpwrap_dep.found()),
'Enable OpenSSL (for Airtunes): @0@'.format(openssl_dep.found()),
'Database: @0@'.format(get_option('database')), 'Database: @0@'.format(get_option('database')),
'Legacy Database Entry Support: @0@'.format(get_option('legacy-database-entry-format')), 'Legacy Database Entry Support: @0@'.format(get_option('legacy-database-entry-format')),
'module-stream-restore:', 'module-stream-restore:',
@ -994,6 +1017,7 @@ summary = [
# 'Force preopen: @0@'.format(${FORCE_PREOPEN}), # 'Force preopen: @0@'.format(${FORCE_PREOPEN}),
# 'Preopened modules: @0@'.format(${PREOPEN_MODS}), # 'Preopened modules: @0@'.format(${PREOPEN_MODS}),
] ]
endif
message('\n '.join(summary)) message('\n '.join(summary))
@ -1003,12 +1027,11 @@ if get_option('daemon') and not speex_dep.found() and not webrtc_dep.found() and
error('At least one echo canceller implementation must be available!') error('At least one echo canceller implementation must be available!')
endif endif
if samplerate_dep.found() if get_option('daemon') and samplerate_dep.found()
warning('Support for libsamplerate is DEPRECATED') warning('Support for libsamplerate is DEPRECATED')
endif endif
if host_machine.system() != 'windows' if host_machine.system() != 'windows' and not dbus_dep.found()
if not dbus_dep.found()
message = [ message = [
'You do not have D-Bus support enabled. It is strongly recommended', 'You do not have D-Bus support enabled. It is strongly recommended',
'that you enable D-Bus support if your platform supports it.', 'that you enable D-Bus support if your platform supports it.',
@ -1019,7 +1042,8 @@ if host_machine.system() != 'windows'
] ]
warning('\n' + '\n'.join(message)) warning('\n' + '\n'.join(message))
endif endif
if host_machine.system() == 'linux' and not udev_dep.found() and get_option('daemon')
if get_option('daemon') and host_machine.system() == 'linux' and not udev_dep.found()
message = [ message = [
'You do not have udev support enabled. It is strongly recommended', 'You do not have udev support enabled. It is strongly recommended',
'that you enable udev support if your platform supports it as it is', 'that you enable udev support if your platform supports it as it is',
@ -1028,7 +1052,8 @@ if host_machine.system() != 'windows'
] ]
warning('\n' + '\n'.join(message)) warning('\n' + '\n'.join(message))
endif endif
if not speex_dep.found() and get_option('daemon')
if get_option('daemon') and host_machine.system() != 'windows' and not speex_dep.found()
message = [ message = [
'You do not have speex support enabled. It is strongly recommended', 'You do not have speex support enabled. It is strongly recommended',
'that you enable speex support if your platform supports it as it is', 'that you enable speex support if your platform supports it as it is',
@ -1037,4 +1062,3 @@ if host_machine.system() != 'windows'
] ]
warning('\n' + '\n'.join(message)) warning('\n' + '\n'.join(message))
endif endif
endif

View file

@ -192,9 +192,6 @@ if not get_option('client')
libpulsecommon_dep = cc.find_library('pulsecommon-' + pa_version_major_minor, dirs : privlibdir, required : true) libpulsecommon_dep = cc.find_library('pulsecommon-' + pa_version_major_minor, dirs : privlibdir, required : true)
libpulse_dep = dependency('libpulse', required : true) libpulse_dep = dependency('libpulse', required : true)
libpulse_simple_dep = dependency('libpulse-simple', required : true) libpulse_simple_dep = dependency('libpulse-simple', required : true)
if glib_dep.found()
libpulse_mainloop_glib_dep = dependency('libpulse-mainloop-glib', required : true)
endif
else else
libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor, libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,