From 2789857f32cc68f0928beed5139a8b88e66f6271 Mon Sep 17 00:00:00 2001 From: Patrick Marchand Date: Mon, 16 Apr 2018 20:31:23 -0400 Subject: [PATCH] Adds openbsd support Seems to work on openbsd 6.3-current but needs more testing. Had to hardcode the binary path as openbsd considers getting the executable path at runtime a security flaw. --- src/Makefile | 4 ++++ src/file.cc | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/Makefile b/src/Makefile index 47a5541b..6158962b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -53,6 +53,10 @@ else ifeq ($(os),FreeBSD) LDFLAGS += -L/usr/local/lib else ifeq ($(os),Haiku) LIBS += -lncursesw -lnetwork -lbe +else ifeq ($(os),OpenBSD) + LIBS += -lncursesw + CPPFLAGS += -I/usr/local/include + LDFLAGS += -L/usr/local/lib else ifneq (,$(findstring CYGWIN,$(os))) CPPFLAGS += -D_XOPEN_SOURCE=700 LIBS += -lncursesw -ldbghelp diff --git a/src/file.cc b/src/file.cc index 00d7b627..638ad014 100644 --- a/src/file.cc +++ b/src/file.cc @@ -23,6 +23,9 @@ #if defined(__FreeBSD__) #include #endif +#if defined(__OpenBSD__) +#include +#endif #if defined(__APPLE__) #include @@ -572,6 +575,8 @@ String get_kak_binary_path() kak_assert(res != -1); buffer[res] = '\0'; return buffer; +#elif defined(__OpenBSD__) + return "/usr/local/bin/"; #else # error "finding executable path is not implemented on this platform" #endif