From 440e84edfc68af7416abd67b084c552a6ba4f09d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigrid=20Hafl=C3=ADnud=C3=B3ttir?= Date: Mon, 2 Mar 2020 10:25:25 +0100 Subject: [PATCH] make it compile and run under OpenBSD --- tool | 13 +++++++++++-- tui_main.c | 5 +++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tool b/tool index 565b654..48f43d5 100755 --- a/tool +++ b/tool @@ -163,7 +163,7 @@ version_string_normalized() { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; } -if [[ ($os == bsd) || ($os == unknown) ]]; then +if [[ ($os == unknown) ]]; then warn "Build script not tested on this platform" fi @@ -320,7 +320,10 @@ build_target() { else # -flto is good on both clang and gcc on Linux case $cc_id in - gcc|clang) add cc_flags -flto;; + gcc|clang) + if [[ $os != bsd ]]; then + add cc_flags -flto + fi esac add cc_flags -s fi @@ -394,6 +397,12 @@ build_target() { # needed for using pbpaste instead of xclip add cc_flags -DORCA_OS_MAC ;; + bsd) + if [[ $portmidi_enabled = 1 ]]; then + add libraries "-L/usr/local/lib" + add cc_flags "-I/usr/local/include" + fi + ;; *) # librt and high-res posix timers on Linux add libraries -lrt diff --git a/tui_main.c b/tui_main.c index f9f99ee..539115c 100644 --- a/tui_main.c +++ b/tui_main.c @@ -18,6 +18,11 @@ #include #endif +#if NCURSES_VERSION_PATCH < 20081122 +int _nc_has_mouse(void); +#define has_mouse _nc_has_mouse +#endif + #define TIME_DEBUG 0 #if TIME_DEBUG static int spin_track_timeout = 0;