build-sys: Fix macOS build

* Enable macOS specific modules (module-bonjour-publish,
  module-coreaudio-detect and module-coreaudio-device)
* Correctly set `PA_SOEXT` (.so, .dylib and .dll)
* Build `poll-posix.c` and `semaphore-osx.c`
* Drop linker flag `-Wl,-z,nodelete` on Darwin
* Drop linker flag `-Wl,--no-undefined` on Darwin
* Prefer to `clock_gettime` over compat impl for old Darwin
* Disable SCM credential on Darwin

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/746>
This commit is contained in:
Shunsuke Shimizu 2022-08-29 04:13:55 +09:00 committed by PulseAudio Marge Bot
parent e4517da353
commit 47a6918739
6 changed files with 53 additions and 26 deletions

View file

@ -150,7 +150,13 @@ cdata.set_quoted('PA_MACHINE_ID', join_paths(sysconfdir, 'machine-id'))
cdata.set_quoted('PA_MACHINE_ID_FALLBACK', join_paths(localstatedir, 'lib', 'dbus', 'machine-id'))
cdata.set_quoted('PA_SRCDIR', join_paths(meson.current_source_dir(), 'src'))
cdata.set_quoted('PA_BUILDDIR', meson.current_build_dir())
cdata.set_quoted('PA_SOEXT', '.so')
if host_machine.system() == 'windows'
cdata.set_quoted('PA_SOEXT', '.dll')
elif host_machine.system() == 'darwin'
cdata.set_quoted('PA_SOEXT', '.dylib')
else
cdata.set_quoted('PA_SOEXT', '.so')
endif
cdata.set_quoted('PA_DEFAULT_CONFIG_DIR', pulsesysconfdir)
cdata.set('PA_DEFAULT_CONFIG_DIR_UNQUOTED', pulsesysconfdir)
cdata.set_quoted('PA_BINARY', join_paths(bindir, 'pulseaudio'))
@ -426,7 +432,7 @@ cdata.set('MESON_BUILD', 1)
# so we request the nodelete flag to be enabled.
# On other systems, we don't really know how to do that, but it's welcome if somebody can tell.
# Windows doesn't support this flag.
if host_machine.system() != 'windows'
if host_machine.system() != 'windows' and host_machine.system() != 'darwin'
nodelete_link_args = ['-Wl,-z,nodelete']
else
nodelete_link_args = []