$NetBSD: patch-toolkit_moz.configure,v 1.2 2023/09/10 14:42:29 nia Exp $ * Add Sun audio support and enable for NetBSD and SunOS by default. * Enable ALSA for NetBSD too. * Support --enable-forkserver on NetBSD. --- toolkit/moz.configure.orig 2023-08-22 15:44:52.000000000 +0000 +++ toolkit/moz.configure @@ -198,6 +198,10 @@ def audio_backends_default(target): return ("sndio",) elif target.os == "OSX": return ("audiounit",) + elif target.os == "NetBSD": + return ("sunaudio",) + elif target.os == "SunOS": + return ("sunaudio",) elif target.os == "WINNT": return ("wasapi",) else: @@ -216,6 +220,7 @@ option( "oss", "pulseaudio", "sndio", + "sunaudio", "wasapi", ), default=audio_backends_default, @@ -236,6 +241,7 @@ def imply_alsa(values, target): any("alsa" in value for value in values) and target.kernel != "Linux" and target.os != "FreeBSD" + and target.os != "NetBSD" ): die("Cannot enable ALSA on %s", target.os) return any("alsa" in value for value in values) or None @@ -290,6 +296,13 @@ def imply_sndio(values, target): die("Cannot enable sndio on %s", target.os) return any("sndio" in value for value in values) or None +@depends("--enable-audio-backends", target) +def imply_sunaudio(values, target): + if any("sunaudio" in value for value in values) and ( + target.os != "NetBSD" and target.os != "SunOS" + ): + die("Cannot enable sunaudio on %s", target.os) + return any("sunaudio" in value for value in values) or None @depends("--enable-audio-backends", target) def imply_wasapi(values, target): @@ -314,6 +327,8 @@ imply_option("--enable-pulseaudio", impl imply_option("--enable-sndio", imply_sndio, reason="--enable-audio-backends") +set_config("MOZ_SUNAUDIO", imply_sunaudio, when="--enable-audio-backends") + set_config("MOZ_WASAPI", imply_wasapi, when="--enable-audio-backends") # ALSA cubeb backend @@ -2630,6 +2645,7 @@ def forkserver_default(target, build_pro (target.os == "GNU" and target.kernel == "Linux") or target.os == "FreeBSD" or target.os == "OpenBSD" + or target.os == "NetBSD" )