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.
This commit is contained in:
Patrick Marchand 2018-04-16 20:31:23 -04:00 committed by dahlbaek
parent 7591924f85
commit 2789857f32
2 changed files with 9 additions and 0 deletions

View File

@ -53,6 +53,10 @@ else ifeq ($(os),FreeBSD)
LDFLAGS += -L/usr/local/lib LDFLAGS += -L/usr/local/lib
else ifeq ($(os),Haiku) else ifeq ($(os),Haiku)
LIBS += -lncursesw -lnetwork -lbe 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))) else ifneq (,$(findstring CYGWIN,$(os)))
CPPFLAGS += -D_XOPEN_SOURCE=700 CPPFLAGS += -D_XOPEN_SOURCE=700
LIBS += -lncursesw -ldbghelp LIBS += -lncursesw -ldbghelp

View File

@ -23,6 +23,9 @@
#if defined(__FreeBSD__) #if defined(__FreeBSD__)
#include <sys/sysctl.h> #include <sys/sysctl.h>
#endif #endif
#if defined(__OpenBSD__)
#include <sys/sysctl.h>
#endif
#if defined(__APPLE__) #if defined(__APPLE__)
#include <mach-o/dyld.h> #include <mach-o/dyld.h>
@ -572,6 +575,8 @@ String get_kak_binary_path()
kak_assert(res != -1); kak_assert(res != -1);
buffer[res] = '\0'; buffer[res] = '\0';
return buffer; return buffer;
#elif defined(__OpenBSD__)
return "/usr/local/bin/";
#else #else
# error "finding executable path is not implemented on this platform" # error "finding executable path is not implemented on this platform"
#endif #endif