From 4b8c03afe687df52f4617e559f62be0943b7ce93 Mon Sep 17 00:00:00 2001 From: sinetek Date: Tue, 3 Nov 2015 01:14:34 +0700 Subject: [PATCH] Adding support for DragonFlyBSD. --- src/Makefile | 4 ++++ src/file.cc | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/Makefile b/src/Makefile index f3b32238..ef30d3ad 100644 --- a/src/Makefile +++ b/src/Makefile @@ -30,6 +30,10 @@ ifeq ($(os),Darwin) LIBS += -lncurses -lboost_regex-mt else ifeq ($(os),Haiku) LIBS += -lncursesw -lboost_regex -lnetwork -lbe +else ifeq ($(os),DragonFly) + LIBS += -lncursesw -lboost_regex + CPPFLAGS += -I/usr/local/include + LDFLAGS += -L/usr/local/lib else ifneq (,$(findstring CYGWIN,$(os))) LIBS += -lncursesw -lboost_regex -ldbghelp else diff --git a/src/file.cc b/src/file.cc index ef150a19..3c51c002 100644 --- a/src/file.cc +++ b/src/file.cc @@ -505,6 +505,11 @@ String get_kak_binary_path() kak_assert(status == B_OK); BPath path(&info.ref); return path.Path(); +#elif defined(__DragonFly__) + ssize_t res = readlink("/proc/curproc/file", buffer, 2048); + kak_assert(res != -1); + buffer[res] = '\0'; + return buffer; #else # error "finding executable path is not implemented on this platform" #endif