$NetBSD: patch-wscript,v 1.5 2020/03/16 21:20:03 wiz Exp $

Enable support for DRM on NetBSD.

NetBSD audio support.

--- wscript.orig	2020-01-26 20:31:54.000000000 +0000
+++ wscript
@@ -291,6 +291,11 @@ iconv support use --disable-iconv.",
         'func': check_statement(['sys/vt.h', 'sys/ioctl.h'],
                                 'int m; ioctl(0, VT_GETMODE, &m)'),
     }, {
+        'name': 'wsdisplay_usl_io.h',
+        'desc': 'wsdisplay_usl_io.h',
+        'func': check_statement(['sys/types.h', 'dev/wscons/wsdisplay_usl_io.h', 'sys/ioctl.h'],
+                                'int m; ioctl(0, VT_GETMODE, &m)'),
+    }, {
         'name': 'gbm.h',
         'desc': 'gbm.h',
         'func': check_cc(header_name=['stdio.h', 'gbm.h']),
@@ -521,6 +526,11 @@ audio_output_features = [
         'func': check_cc(header_name='sys/soundcard.h'),
         'deps': 'posix && gpl',
     }, {
+        'name': '--netbsd-audio',
+        'desc': 'NetBSD audio output',
+        'func': check_statement(['sys/audioio.h', 'sys/ioctl.h'],
+                                'struct audio_device d; ioctl(0, AUDIO_GETDEV, &d)'),
+    }, {
         'name': '--rsound',
         'desc': 'RSound audio output',
         'func': check_statement('rsound.h', 'rsd_init(NULL)', lib='rsound')
@@ -587,7 +597,7 @@ video_output_features = [
     }, {
         'name': '--drm',
         'desc': 'DRM',
-        'deps': 'vt.h',
+        'deps': 'vt.h || wsdisplay_usl_io.h',
         'func': check_pkg_config('libdrm', '>= 2.4.74'),
     }, {
         'name': '--drmprime',
