Merge branch 'add-illumos' of http://github.com/luka-devnull/kakoune into master

This commit is contained in:
Maxime Coste 2020-09-30 19:38:52 +10:00
commit 6a9b34e5c8
3 changed files with 12 additions and 0 deletions

View File

@ -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")

View File

@ -3,6 +3,10 @@
#include "flags.hh"
#include "ranges.hh"
#if defined(__sun__)
#include <cstring>
#endif
#include <unistd.h>
namespace Kakoune

View File

@ -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