summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorluka null <luka.devnull@vivaldi.net>2020-09-18 05:22:25 -0500
committerluka null <luka.devnull@vivaldi.net>2020-09-18 05:22:25 -0500
commit1296922d66c22886efa57aecaa7247e2edfd68f9 (patch)
tree6c8c17b689f094173db77e7628a39bf07a3b60e2 /src
parentcfbff4e132c8d0aed8bcaf677b25f5ab3a9c3221 (diff)
Add illumos/Solaris support
Diffstat (limited to 'src')
-rw-r--r--src/Makefile3
-rw-r--r--src/event_manager.cc4
-rw-r--r--src/file.cc5
3 files changed, 12 insertions, 0 deletions
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 <cstring>
+#endif
+
#include <unistd.h>
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