issue #588, part 3

add check for the existence of inb() and outb()
This commit is contained in:
tildearrow 2022-07-14 22:29:04 -05:00
parent 3df5a6e2b6
commit d085f76c7f
2 changed files with 13 additions and 2 deletions

View File

@ -564,8 +564,13 @@ if (NOT WIN32 AND NOT APPLE)
CHECK_INCLUDE_FILE(linux/input.h LINUX_INPUT_FOUND)
CHECK_INCLUDE_FILE(linux/kd.h LINUX_KD_FOUND)
if (SYS_IO_FOUND)
list(APPEND DEPENDENCIES_DEFINES HAVE_SYS_IO)
message(STATUS "PC speaker output: outb()")
try_compile(HAVE_INOUTB ${CMAKE_BINARY_DIR}/check SOURCES ${CMAKE_SOURCE_DIR}/src/check/check_sysIO.c)
if (HAVE_INOUTB)
list(APPEND DEPENDENCIES_DEFINES HAVE_SYS_IO)
message(STATUS "PC speaker output: outb()")
else()
message(STATUS "sys/io.h found but inb()/outb() not present")
endif()
endif()
if (LINUX_INPUT_FOUND)
list(APPEND DEPENDENCIES_DEFINES HAVE_LINUX_INPUT)

6
src/check/check_sysIO.c Normal file
View File

@ -0,0 +1,6 @@
#include <sys/io.h>
int main(int, char**) {
inb(0x61);
outb(0x00,0x61);
}