From ea641cc0ae9e29df402c8068b7470c947506d325 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Wed, 25 Aug 2021 15:34:40 +0600 Subject: [PATCH] Look for OpenAL in the proper way --- src/CMakeLists.txt | 4 ++-- src/unix/unix.c | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9d35e510c..a13564310 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -50,9 +50,9 @@ target_link_libraries(86Box cpu chipset mch dev mem fdd game cdrom zip mo hdd find_package(Freetype REQUIRED) include_directories(${FREETYPE_INCLUDE_DIRS}) -find_package(OpenAL CONFIG REQUIRED) +find_package(OpenAL REQUIRED) include_directories(${OPENAL_INCLUDE_DIR}) -target_link_libraries(86Box OpenAL::OpenAL) +target_link_libraries(86Box ${OPENAL_LIBRARY}) find_package(SDL2 CONFIG REQUIRED) include_directories(${SDL2_INCLUDE_DIRS}) diff --git a/src/unix/unix.c b/src/unix/unix.c index db0f03524..d7ead6bde 100644 --- a/src/unix/unix.c +++ b/src/unix/unix.c @@ -2,6 +2,7 @@ #define _FILE_OFFSET_BITS 64 #define _LARGEFILE64_SOURCE 1 #endif +#define _POSIX_C_SOURCE 200809L #include #include #include @@ -579,8 +580,23 @@ void monitor_thread(void* param) { if (isatty(fileno(stdin)) && isatty(fileno(stdout))) { + char* line = NULL; + size_t n; printf("86Box monitor console.\n"); - + while (!exit_event) + { + printf("(86Box) "); + getline(&line, &n, stdin); + if (line) + { + line[n - 1] = '\0'; + if (strncasecmp(line, "exit", 4) == 0) + { + exit_event = 1; + } + free(line); + } + } } } @@ -616,6 +632,7 @@ int main(int argc, char** argv) /* Initialize the rendering window, or fullscreen. */ do_start(); + thread_create(monitor_thread, NULL); while (!is_quit) { static int onesec_tic = 0;