Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openal-soft: update to 1.24.0 #1796

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -2701,6 +2701,7 @@
"openal"
],
"versions": [
"1.24.0-1",
"1.23.1-3",
"1.23.1-2",
"1.23.1-1",
Expand Down
8 changes: 4 additions & 4 deletions subprojects/openal-soft.wrap
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[wrap-file]
directory = openal-soft-1.23.1
source_url = https://github.com/kcat/openal-soft/archive/refs/tags/1.23.1.tar.gz
source_filename = openal-soft-1.23.1.tar.gz
source_hash = dfddf3a1f61059853c625b7bb03de8433b455f2f79f89548cbcbd5edca3d4a4a
directory = openal-soft-1.24.0
source_url = https://github.com/kcat/openal-soft/archive/refs/tags/1.24.0.tar.gz
source_filename = openal-soft-1.24.0.tar.gz
source_hash = d3753f7aba798574ce2dc934e3c47dc655cd7a4652c038f2a860b0e81ff6d3dc
patch_directory = openal-soft

[provide]
Expand Down
128 changes: 76 additions & 52 deletions subprojects/packagefiles/openal-soft/meson.build
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
project(
'openal-soft',
'cpp',
version: '1.23.1',
version: '1.24.0',
meson_version: '>=0.58',
default_options: ['cpp_std=c++14', 'c_std=c11'],
default_options: ['cpp_std=c++17', 'c_std=c11'],
)

cpp = meson.get_compiler('cpp')
dl_dep = cpp.find_library('dl', required: false)
if meson.version().version_compare('>= 0.62')
dl_dep = dependency('dl', required: false)
else
dl_dep = cpp.find_library('dl', required: false)
endif
thread_dep = dependency('threads')
alsa_dep = dependency('alsa', required: get_option('alsa'))
apple_dep = dependency('appleframeworks', modules: ['AudioToolbox', 'CoreAudio', 'CoreFoundation'], required: host_machine.system() == 'darwin')
jack_dep = dependency('jack', required: get_option('jack'))
mm_dep = cpp.find_library('winmm', required: get_option('winmm'))
oboe_dep = dependency('oboe', required: get_option('oboe'))
opensl_dep = dependency('opensl', required: get_option('opensl'))
oss_dep = dependency('oss', required: get_option('oss'))
pipewire_dep = dependency('libpipewire-0.3', required: get_option('pipewire'))
Expand All @@ -23,6 +28,9 @@ sdl2_dep = dependency('sdl2', required: get_option('sdl2'))
sndio_dep = dependency('sndio', required: get_option('sndio'))
solaris_dep = dependency('audioio', required: get_option('solaris'))

#Disable SIMD on PPC for now. It's fixed in master, broken in releaee
add_project_arguments('-DPFFFT_SIMD_DISABLE', language: 'cpp')

if host_machine.system() == 'windows'
add_project_arguments('-DNOMINMAX', language: 'cpp')
if cpp.get_argument_syntax() == 'msvc'
Expand Down Expand Up @@ -52,15 +60,16 @@ openal_args += '-DAL_API=@0@'.format(api)
openal_args += '-DALC_API=@0@'.format(api)

common_sources = files(
'common/alassert.cpp',
'common/alcomplex.cpp',
'common/alfstream.cpp',
'common/almalloc.cpp',
'common/alsem.cpp',
'common/alstring.cpp',
'common/althrd_setname.cpp',
'common/dynload.cpp',
'common/pffft.cpp',
'common/polyphase_resampler.cpp',
'common/ringbuffer.cpp',
'common/strutils.cpp',
'common/threads.cpp',
)

core_sources = files(
Expand Down Expand Up @@ -89,6 +98,7 @@ core_sources = files(
'core/mastering.cpp',
'core/mixer.cpp',
'core/mixer/mixer_c.cpp',
'core/storage_formats.cpp',
'core/uhjfilter.cpp',
'core/uiddefs.cpp',
'core/voice.cpp',
Expand All @@ -97,6 +107,7 @@ core_sources = files(
openal_sources = files(
'al/auxeffectslot.cpp',
'al/buffer.cpp',
'al/debug.cpp',
'al/effect.cpp',
'al/effects/autowah.cpp',
'al/effects/chorus.cpp',
Expand Down Expand Up @@ -142,6 +153,7 @@ alc_sources = files(
'alc/effects/pshifter.cpp',
'alc/effects/reverb.cpp',
'alc/effects/vmorpher.cpp',
'alc/events.cpp',
'alc/panning.cpp',
)

Expand All @@ -162,62 +174,101 @@ hrtf_h = custom_target(

cdata = configuration_data()
cdata.set('HAVE_WAVE', true)
cdata.set('HAVE_LIBDL', dl_dep.found())
cdata.set('HAVE_ALSA', alsa_dep.found())
cdata.set('HAVE_COREAUDIO', apple_dep.found())
cdata.set('HAVE_JACK', jack_dep.found())
cdata.set('HAVE_OBOE', oboe_dep.found())
cdata.set('HAVE_OPENSL', opensl_dep.found())
cdata.set('HAVE_OSS', oss_dep.found())
cdata.set('HAVE_PIPEWIRE', pipewire_dep.found())
cdata.set('HAVE_PORTAUDIO', portaudio_dep.found())
cdata.set('HAVE_PULSEAUDIO', pulseaudio_dep.found())
cdata.set('HAVE_RTKIT', rtkit_dep.found())
cdata.set('HAVE_SDL2', sdl2_dep.found())
cdata.set('HAVE_SNDIO', sndio_dep.found())
cdata.set('HAVE_SOLARIS', solaris_dep.found())
cdata.set('HAVE_WINMM', mm_dep.found())
cdata.set('HAVE_DSOUND', cpp.has_header('dsound.h'))
cdata.set('HAVE_WASAPI', cpp.has_header('wasapi.h'))

#ignore for now
cdata.set('ALSOFT_EAX', false)
cdata.set('HAVE_OBOE', false)
cdata.set('HAVE_DSOUND', cpp.has_header('dsound.h', dependencies: mm_dep))
cdata.set('HAVE_WASAPI', cpp.has_header('wasapi.h', dependencies: mm_dep))
configure_file(input: 'config_backends.h.in', output: 'config_backends.h', format: 'cmake', configuration: cdata)

foreach b : ['alsa', 'coreaudio', 'jack', 'opensl', 'oss', 'pipewire', 'portaudio', 'pulseaudio', 'sdl2', 'sndio', 'solaris', 'winmm', 'dsound', 'wasapi']
if cdata.get('HAVE_@0@'.format(b.to_upper()))
alc_sources += 'alc/backends/@[email protected]'.format(b)
endif
endforeach

cdata = configuration_data()
cdata.set('HAVE_SSE', cpp.check_header('xmmintrin.h'))
cdata.set('HAVE_SSE2', cpp.check_header('emmintrin.h'))
cdata.set('HAVE_SSE3', cpp.check_header('pmmintrin.h'))
cdata.set('HAVE_SSE4_1', cpp.check_header('smmintrin.h'))
cdata.set('HAVE_SSE_INTRINSICS', cpp.has_header_symbol('xmmintrin.h', '_mm_pause'))
cdata.set('HAVE_NEON', cpp.check_header('arm_neon.h'))

if cdata.get('HAVE_SSE')
openal_args += cpp.get_supported_arguments('-msse', '-mfpmath=sse')
core_sources += 'core/mixer/mixer_sse.cpp'
endif

if cdata.get('HAVE_SSE2')
openal_args += cpp.get_supported_arguments('-msse2')
core_sources += 'core/mixer/mixer_sse2.cpp'
endif

if cdata.get('HAVE_SSE3')
openal_args += cpp.get_supported_arguments('-msse3')
core_sources += 'core/mixer/mixer_sse3.cpp'
endif

if cdata.get('HAVE_SSE4_1')
openal_args += cpp.get_supported_arguments('-msse4.1')
core_sources += 'core/mixer/mixer_sse41.cpp'
endif

if cdata.get('HAVE_NEON')
if cpp.sizeof('void*') == 4
openal_args += cpp.get_supported_arguments('-mfpu=neon')
endif
core_sources += 'core/mixer/mixer_neon.cpp'
endif

configure_file(input: 'config_simd.h.in', output: 'config_simd.h', format: 'cmake', configuration: cdata)

cdata = configuration_data()

#ignore for now
cdata.set('ALSOFT_EAX', false)
cdata.set('ALSOFT_UWP', false)

cdata.set('HAVE_RTKIT', rtkit_dep.found())
if cdata.get('HAVE_RTKIT')
alc_sources += files('core/dbus_wrap.cpp', 'core/rtkit.cpp')
endif

foreach h : ['dlfcn.h', 'guiddef.h', 'initguid.h', 'malloc.h', 'pthread_np.h']
foreach h : ['guiddef.h', 'pthread_np.h']
cdata.set('HAVE_@0@'.format(h.underscorify().to_upper()), cpp.has_header(h))
endforeach

cdata.set('HAVE_DLFCN_H', cpp.has_header('dlfcn.h', dependencies: dl_dep))

#needs to be check_header for LLVM as well as MinGW
cdata.set('HAVE_CPUID_H', cpp.check_header('cpuid.h'))
cdata.set('HAVE_INTRIN_H', cpp.check_header('intrin.h'))
cdata.set('HAVE_SSE', cpp.check_header('xmmintrin.h'))
cdata.set('HAVE_SSE2', cpp.check_header('emmintrin.h'))
cdata.set('HAVE_SSE3', cpp.check_header('pmmintrin.h'))
cdata.set('HAVE_SSE4_1', cpp.check_header('smmintrin.h'))
cdata.set('HAVE_NEON', cpp.check_header('arm_neon.h'))

#need to check for non windows because meson wrongly detects its presence under MinGW
cdata.set('HAVE_POSIX_MEMALIGN', cpp.has_function('posix_memalign') and host_machine.system() != 'windows')
cdata.set('HAVE__ALIGNED_MALLOC', cpp.has_function('_aligned_malloc'))
cdata.set('HAVE_PROC_PIDPATH', cpp.has_function('proc_pidpath'))
cdata.set('HAVE_PTHREAD_SETSCHEDPARAM', cpp.has_function('pthread_setschedparam', dependencies: thread_dep))
cdata.set('HAVE_PTHREAD_SETNAME_NP', cpp.has_function('pthread_setname_np', dependencies: thread_dep))
cdata.set('HAVE_PTHREAD_SET_NAME_NP', cpp.has_function('pthread_set_name_np', dependencies: thread_dep))
cdata.set('HAVE_GETOPT', cpp.has_function('getopt'))

cdata.set('HAVE_CPUID_INTRINSIC', cpp.get_argument_syntax() == 'msvc')
cdata.set('HAVE_GCC_GET_CPUID', cpp.has_function('__get_cpuid', prefix: '#include <cpuid.h>'))
cdata.set('HAVE_SSE_INTRINSICS', cpp.has_header_symbol('xmmintrin.h', '_mm_pause'))

if cpp.has_function_attribute('force_align_arg_pointer')
cdata.set('ALSOFT_FORCE_ALIGN', '__attribute__((force_align_arg_pointer))')
else
cdata.set('ALSOFT_FORCE_ALIGN', '')
endif

cdata.set('ALSOFT_EMBED_HRTF_DATA', true)
cdata.set('ALSOFT_INSTALL_DATADIR', get_option('prefix') / get_option('datadir'))
Expand All @@ -232,34 +283,7 @@ vdata.set('LIB_VERSION_NUM', meson.project_version().replace('.', ','))

configure_file(input: 'version.h.in', output: 'version.h', format: 'cmake', configuration: vdata)

if cdata.get('HAVE_SSE')
openal_args += cpp.get_supported_arguments('-msse', '/arch:SSE', '-mfpmath=sse')
core_sources += 'core/mixer/mixer_sse.cpp'
endif

if cdata.get('HAVE_SSE2')
openal_args += cpp.get_supported_arguments('-msse2', '/arch:SSE2')
core_sources += 'core/mixer/mixer_sse2.cpp'
endif

if cdata.get('HAVE_SSE3')
openal_args += cpp.get_supported_arguments('-msse3', '/arch:SSE3')
core_sources += 'core/mixer/mixer_sse3.cpp'
endif

if cdata.get('HAVE_SSE4_1')
openal_args += cpp.get_supported_arguments('-msse4.1', '/arch:SSE4.1')
core_sources += 'core/mixer/mixer_sse41.cpp'
endif

if cdata.get('HAVE_NEON')
if cpp.sizeof('void*') == 4
openal_args += cpp.get_supported_arguments('-mfpu=neon')
endif
core_sources += 'core/mixer/mixer_neon.cpp'
endif

if cpp.links('#include <atomic>\n#include <bitset>\nint main(){std::atomic<std::bitset<4u>> b;std::atomic_is_lock_free(&b);}')
if cpp.links('#include <atomic>\n#include <bitset>\nint main(){std::atomic<std::bitset<3>> b;std::atomic_is_lock_free(&b);}')
atomic_dep = dependency('', required: false)
else
atomic_dep = cpp.find_library('atomic', required: false)
Expand Down
4 changes: 4 additions & 0 deletions subprojects/packagefiles/openal-soft/meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ option('jack', type: 'feature',
description: 'JACK backend',
)

option('oboe', type: 'feature',
description: 'Oboe backend',
)

option('opensl', type: 'feature',
description: 'OpenSL backend',
)
Expand Down
2 changes: 1 addition & 1 deletion subprojects/packagefiles/openal-soft/utils/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ foreach u, d : utils
u.split('.')[0],
u,
dependencies: d,
link_args: host_machine.system() == 'windows' ? '-municode' : [],
link_args: cpp.get_supported_arguments('-municode'),
)
endforeach