From 1296922d66c22886efa57aecaa7247e2edfd68f9 Mon Sep 17 00:00:00 2001 From: luka null Date: Fri, 18 Sep 2020 05:22:25 -0500 Subject: [PATCH] Add illumos/Solaris support --- src/Makefile | 3 +++ src/event_manager.cc | 4 ++++ src/file.cc | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/src/Makefile b/src/Makefile index 1d1bc0e0..3c791120 100644 --- a/src/Makefile +++ b/src/Makefile @@ -80,6 +80,9 @@ else ifeq ($(os),OpenBSD) else ifneq (,$(findstring CYGWIN,$(os))) CPPFLAGS += -D_XOPEN_SOURCE=700 LIBS += -lncursesw -ldbghelp +else ifeq ($(os),SunOS) + LIBS += -lncursesw + LDFLAGS += -lsocket -rdynamic else ifeq ($(PKG_CONFIG),) $(error "pkg-config not found in PATH") diff --git a/src/event_manager.cc b/src/event_manager.cc index 37fac95a..c4cf5e76 100644 --- a/src/event_manager.cc +++ b/src/event_manager.cc @@ -3,6 +3,10 @@ #include "flags.hh" #include "ranges.hh" +#if defined(__sun__) +#include +#endif + #include namespace Kakoune diff --git a/src/file.cc b/src/file.cc index 88c502d1..ce6f8405 100644 --- a/src/file.cc +++ b/src/file.cc @@ -654,6 +654,11 @@ String get_kak_binary_path() return buffer; #elif defined(__OpenBSD__) return KAK_BIN_PATH; +#elif defined(__sun__) + ssize_t res = readlink("/proc/self/path/a.out", buffer, 2048); + kak_assert(res != -1); + buffer[res] = '\0'; + return buffer; #else # error "finding executable path is not implemented on this platform" #endif