diff --git a/compiler2/makefile.c b/compiler2/makefile.c
index 05dc83d596821a00fabb165279b951174ddc68bc..8dcfc02dd55df8d75e0f993d44fa28e40780e02d 100644
--- a/compiler2/makefile.c
+++ b/compiler2/makefile.c
@@ -3681,7 +3681,7 @@ static void print_makefile(struct makefile_struct *makefile)
     fputs(" -lresolv", fp);
 #endif
 #ifdef ADVANCED_DEBUGGER_UI
-    fputs(" -lcurses -lbsd -ledit", fp);
+    fputs(" -lcurses -ledit", fp);
 #endif
     if (makefile->solspeclibraries) {
       struct string_list* act_elem = makefile->solspeclibraries;
@@ -3699,7 +3699,7 @@ static void print_makefile(struct makefile_struct *makefile)
     fputs(" -lresolv", fp);
 #endif
 #ifdef ADVANCED_DEBUGGER_UI
-    fputs(" -lcurses -lbsd -ledit", fp);
+    fputs(" -lcurses -ledit", fp);
 #endif
     if (makefile->sol8speclibraries) {
       struct string_list* act_elem = makefile->sol8speclibraries;
@@ -3717,7 +3717,7 @@ static void print_makefile(struct makefile_struct *makefile)
     fputs(" -lpthread -lrt", fp);
 #endif
 #ifdef ADVANCED_DEBUGGER_UI
-    fputs(" -lncurses -lbsd -ledit", fp);
+    fputs(" -lncurses -ledit", fp);
 #endif
     if (makefile->linuxspeclibraries) {
       struct string_list* act_elem = makefile->linuxspeclibraries;
@@ -3732,7 +3732,7 @@ static void print_makefile(struct makefile_struct *makefile)
 
     fputs("FREEBSD_LIBS = -lxml2", fp);
 #ifdef ADVANCED_DEBUGGER_UI
-    fputs(" -lncurses -lbsd -ledit", fp);
+    fputs(" -lncurses -ledit", fp);
 #endif
     if (makefile->freebsdspeclibraries) {
       struct string_list* act_elem = makefile->freebsdspeclibraries;
@@ -3747,7 +3747,7 @@ static void print_makefile(struct makefile_struct *makefile)
 
     fputs("WIN32_LIBS = -lxml2", fp);
 #ifdef ADVANCED_DEBUGGER_UI
-    fputs(" -lncurses -lbsd -ledit", fp);
+    fputs(" -lncurses -ledit", fp);
 #endif
     if (makefile->win32speclibraries) {
       struct string_list* act_elem = makefile->win32speclibraries;
diff --git a/core/DebuggerUI.cc b/core/DebuggerUI.cc
index f95160e8f54415da80c7926307d1adf4a2a0fd3b..c2c96dccaa8d763564e97bb29d2912bbb0dfff6c 100644
--- a/core/DebuggerUI.cc
+++ b/core/DebuggerUI.cc
@@ -18,7 +18,7 @@
 #include <ctype.h>
 
 #ifdef ADVANCED_DEBUGGER_UI
-#include <readline.h>
+#include <editline/readline.h>
 // use a different file, than the MCTR CLI, since not all commands are the same
 #define TTCN3_HISTORY_FILENAME ".ttcn3_history_single"
 #endif
diff --git a/core/Makefile b/core/Makefile
index 8cacb359c7050c5d81608754715d4b1516795bdb..0f7f654244017a225b33e0a1291bc0b3d8d27a5b 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -83,12 +83,12 @@ WIN32_LIBS     := -lxml2
 INTERIX_LIBS   := -lxml2
 	
 ifeq ($(ADVANCED_DEBUGGER_UI), yes)
-  SOLARIS_LIBS   += -lcurses -lbsd -ledit
-  SOLARIS8_LIBS  += -lcurses -lbsd -ledit
-  LINUX_LIBS     += -lncurses -lbsd -ledit
-  FREEBSD_LIBS   += -lncurses -lbsd -ledit
+  SOLARIS_LIBS   += -lcurses -ledit
+  SOLARIS8_LIBS  += -lcurses -ledit
+  LINUX_LIBS     += -lncurses -ledit
+  FREEBSD_LIBS   += -lncurses -ledit
   WIN32_LIBS     += -lncurses -ledit
-  INTERIX_LIBS   += -lncurses -lbsd -ledit
+  INTERIX_LIBS   += -lncurses -ledit
 endif
 
 ifeq ($(USAGE_STATS), yes)
@@ -151,10 +151,6 @@ ifeq ($(PLATFORM),INTERIX)
   CPPFLAGS += -I/usr/local/include
 endif
 
-ifeq ($(ADVANCED_DEBUGGER_UI), yes)
-  CPPFLAGS += -I/usr/include/editline -I/usr/include/readline
-endif
-
 
 OBJECTS := $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(SOURCES)))
 	
diff --git a/mctr2/cli/Cli.cc b/mctr2/cli/Cli.cc
index 551fb6c6b91bf96ad5acb824d0d853b87f0f9042..03a514a4e40d515f3a6f9ef5175e9a61c4f67ba8 100644
--- a/mctr2/cli/Cli.cc
+++ b/mctr2/cli/Cli.cc
@@ -42,10 +42,7 @@
 #include "../../common/config_preproc.h"
 #include "../../core/DebugCommands.hh"
 
-#include <readline.h>
-#if RL_READLINE_VERSION == 0x0603
-#include <history.h>
-#endif
+#include <editline/readline.h>
 
 #define PROMPT "MC2> "
 #define CMTC_TEXT "cmtc"
diff --git a/mctr2/cli/Makefile b/mctr2/cli/Makefile
index ae27deb7c2353bf292ba4c7aff26e284f5b5f115..5ef23033f6bb7d91704228b067e2ce8c0af970b8 100644
--- a/mctr2/cli/Makefile
+++ b/mctr2/cli/Makefile
@@ -40,7 +40,7 @@ OBJECTS := $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(SOURCES)))
 
 DEPFILES := $(patsubst %.cc,%.d,$(patsubst %.c,%.d,$(SOURCES)))
 
-CPPFLAGS += -D_REENTRANT -I/usr/include/editline -I/usr/include/readline
+CPPFLAGS += -D_REENTRANT
 
 ifdef OPENSSL_DIR
 ifneq ($(OPENSSL_DIR), default)
diff --git a/mctr2/mctr/Makefile b/mctr2/mctr/Makefile
index 1bf5eccf0ff6c9ef77f2465c4e42c7360694d598..b745946008f222db2c2cc22599b46359bd5a81b3 100644
--- a/mctr2/mctr/Makefile
+++ b/mctr2/mctr/Makefile
@@ -83,12 +83,12 @@ LINUX_LIBS := -lpthread
 FREEBSD_LIBS := -lpthread
 WIN32_LIBS := -lpthread
 
-SOLARIS_CLI_LIBS := -lcurses -lbsd -ledit
-SOLARIS8_CLI_LIBS := -lcurses -lbsd -ledit
-LINUX_CLI_LIBS := -lncurses -lbsd -ledit
-FREEBSD_CLI_LIBS := -lncurses -lbsd -ledit
-WIN32_CLI_LIBS := -lncurses -lbsd -ledit
-INTERIX_CLI_LIBS := -lncurses -lbsd -ledit
+SOLARIS_CLI_LIBS := -lcurses -ledit
+SOLARIS8_CLI_LIBS := -lcurses -ledit
+LINUX_CLI_LIBS := -lncurses -ledit
+FREEBSD_CLI_LIBS := -lncurses -ledit
+WIN32_CLI_LIBS := -lncurses -ledit
+INTERIX_CLI_LIBS := -lncurses -ledit
 
 all run: $(TARGETS)