build: detect VT_GETMODE on OpenBSD

This commit is contained in:
Brad Smith 2024-07-28 23:14:45 -04:00 committed by Dudemanguy
parent 051e2a8b7a
commit a36f8ad162
2 changed files with 6 additions and 2 deletions

View File

@ -539,6 +539,8 @@ features += {'vt.h': cc.has_header_symbol('sys/vt.h', 'VT_GETMODE')}
features += {'consio.h': not features['vt.h'] and cc.has_header_symbol('sys/consio.h', 'VT_GETMODE')} features += {'consio.h': not features['vt.h'] and cc.has_header_symbol('sys/consio.h', 'VT_GETMODE')}
features += {'wsdisplay-usl-io.h': cc.has_header_symbol('dev/wscons/wsdisplay_usl_io.h', 'VT_GETMODE', prefix: '#include <sys/types.h>')}
# macOS's pthread_setname_np is a special snowflake and differs from literally every other platform. # macOS's pthread_setname_np is a special snowflake and differs from literally every other platform.
features += {'mac-thread-name': darwin} features += {'mac-thread-name': darwin}
@ -926,7 +928,7 @@ if features['direct3d']
endif endif
drm = dependency('libdrm', version: '>= 2.4.105', required: get_option('drm')) drm = dependency('libdrm', version: '>= 2.4.105', required: get_option('drm'))
features += {'drm': drm.found() and (features['vt.h'] or features['consio.h'])} features += {'drm': drm.found() and (features['vt.h'] or features['consio.h'] or features['wsdisplay-usl-io.h'])}
if features['drm'] if features['drm']
dependencies += drm dependencies += drm
sources += files('video/drmprime.c', sources += files('video/drmprime.c',

View File

@ -31,8 +31,10 @@
#if HAVE_CONSIO_H #if HAVE_CONSIO_H
#include <sys/consio.h> #include <sys/consio.h>
#else #elif HAVE_VT_H
#include <sys/vt.h> #include <sys/vt.h>
#elif HAVE_WSDISPLAY_USL_IO_H
#include <dev/wscons/wsdisplay_usl_io.h>
#endif #endif
#include "drm_atomic.h" #include "drm_atomic.h"