Browse Source

Merge pull request #64 from ftrvxmtrx/openbsd-build

make it compile and run under OpenBSD
master
Devine Lu Linvega 5 years ago
committed by GitHub
parent
commit
d7a3b169c5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      tool
  2. 5
      tui_main.c

13
tool

@ -163,7 +163,7 @@ version_string_normalized() {
echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; 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" warn "Build script not tested on this platform"
fi fi
@ -320,7 +320,10 @@ build_target() {
else else
# -flto is good on both clang and gcc on Linux # -flto is good on both clang and gcc on Linux
case $cc_id in case $cc_id in
gcc|clang) add cc_flags -flto;; gcc|clang)
if [[ $os != bsd ]]; then
add cc_flags -flto
fi
esac esac
add cc_flags -s add cc_flags -s
fi fi
@ -394,6 +397,12 @@ build_target() {
# needed for using pbpaste instead of xclip # needed for using pbpaste instead of xclip
add cc_flags -DORCA_OS_MAC 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 # librt and high-res posix timers on Linux
add libraries -lrt add libraries -lrt

5
tui_main.c

@ -18,6 +18,11 @@
#include <portmidi.h> #include <portmidi.h>
#endif #endif
#if NCURSES_VERSION_PATCH < 20081122
int _nc_has_mouse(void);
#define has_mouse _nc_has_mouse
#endif
#define TIME_DEBUG 0 #define TIME_DEBUG 0
#if TIME_DEBUG #if TIME_DEBUG
static int spin_track_timeout = 0; static int spin_track_timeout = 0;

Loading…
Cancel
Save