diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-11-29 09:01:14 +0100 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-11-29 23:11:12 +0100 |
commit | fa620ffc956953b39bb683abb2679bbbfc364915 (patch) | |
tree | 53814a8fb30e3a3984fafe98a198358e5b336809 /wscript | |
parent | 18345400c022ad644ff5dafe1383110c47e7d533 (diff) | |
download | mpv-fa620ffc956953b39bb683abb2679bbbfc364915.tar.bz2 mpv-fa620ffc956953b39bb683abb2679bbbfc364915.tar.xz |
build: reimplement the OSS checks using a more declarative approach
The OSS checks were a big mess and quite buggy. This reimplementes them using
a declarative approach and clearly distinguishing between the various OSS
implementations. The code should now almost be auto-documenting.
We currently support the following implementations of OSS:
* platform-specific (with `sys/soundcard.h`)
* SunAudio (default on NetBSD and useable on OpenBSD even if we have sndio
support there).
* 4Front (default on FreeBSD)
Since now each OSS check also checks for the appropriate soundcard header,
remove the old soundcard check.
Many thanks to @bugmen0t for in depth info about all the BSDs.
Check #380 and #359 for more info on this commit.
Diffstat (limited to 'wscript')
-rw-r--r-- | wscript | 40 |
1 files changed, 35 insertions, 5 deletions
@@ -117,10 +117,6 @@ iconv support use --disable-iconv.", 'deps_any': [ 'os-win32', 'os-cygwin'], 'func': check_true }, { - 'name': 'soundcard', - 'desc': 'soundcard.h', - 'func': check_headers('soundcard.h', 'sys/soundcard.h') - }, { 'name': 'videoio', 'desc': 'videoio.h', 'func': check_headers('sys/videoio.h') @@ -387,9 +383,35 @@ audio_output_features = [ 'deps_neg': [ 'sdl2' ], 'func': check_pkg_config('sdl') }, { + 'name': 'oss-audio-native', + 'desc': 'OSS (platform-specific OSS implementation)', + 'func': check_cc(header_name='sys/soundcard.h', + defines=['PATH_DEV_DSP="/dev/dsp"', + 'PATH_DEV_MIXER="/dev/mixer"'], + fragment=load_fragment('oss_audio.c')), + 'groups' : [ 'oss-audio' ] + }, { + 'name': 'oss-audio-sunaudio', + 'desc': 'OSS (emulation on top of SunAudio)', + 'func': check_cc(header_name='soundcard.h', + lib='ossaudio', + defines=['PATH_DEV_DSP="/dev/sound"', + 'PATH_DEV_MIXER="/dev/mixer"'], + fragment=load_fragment('oss_audio_sunaudio.c')), + 'deps_neg': [ 'oss-audio-native' ], + 'groups' : [ 'oss-audio' ] + }, { + 'name': 'oss-audio-4front', + 'desc': 'OSS (implementation from opensound.com)', + 'func': check_oss_4front, + 'deps_neg': [ 'oss-audio-native', 'oss-audio-sunaudio' ], + 'groups' : [ 'oss-audio' ] + }, { 'name': '--oss-audio', 'desc': 'OSS audio output', - 'func': check_oss + 'func': check_true, + 'deps_any': [ 'oss-audio-native', 'oss-audio-sunaudio', + 'oss-audio-4front' ] }, { 'name': '--audio-select', 'desc': 'audio select()', @@ -772,6 +794,14 @@ def configure(ctx): ctx.parse_dependencies(scripting_features) + ctx.define('HAVE_SYS_SOUNDCARD_H', + '(HAVE_OSS_AUDIO_NATIVE || HAVE_OSS_AUDIO_4FRONT)', + quote=False) + + ctx.define('HAVE_SOUNDCARD_H', + 'HAVE_OSS_AUDIO_SUNAUDIO', + quote=False) + ctx.load('generators.headers') if not ctx.dependency_satisfied('build-date'): |