<div dir="ltr"><div dir="ltr">Hi</div><div dir="ltr">I am getting below errors while cross compiling</div><div dir="ltr"><span style="color:rgb(80,0,80)">/home/subhra/SDK3.1.2/tools-3.</span><span style="color:rgb(80,0,80)">1.2_build_50/bin/../lib/gcc/</span><span style="color:rgb(80,0,80)">mips64-octeon-linux-gnu/4.7.0/</span><span style="color:rgb(80,0,80)">../../../../mips64-octeon-</span><span style="color:rgb(80,0,80)">linux-gnu/bin/ld: cannot find -lreadline</span><br style="color:rgb(80,0,80)"><span style="color:rgb(80,0,80)">/home/subhra/SDK3.1.2/tools-3.</span><span style="color:rgb(80,0,80)">1.2_build_50/bin/../lib/gcc/</span><span style="color:rgb(80,0,80)">mips64-octeon-linux-gnu/4.7.0/</span><span style="color:rgb(80,0,80)">../../../../mips64-octeon-</span><span style="color:rgb(80,0,80)">linux-gnu/bin/ld: cannot find -lncurses</span> </div><div dir="ltr"> <br><div>The fixes from this URL: <a href="https://github.com/kamailio/kamailio/commit/c1cc4a07d11c829f89ea62206689fba92eb91ea2" rel="noreferrer" target="_blank">https://github.com/kamailio/kamailio/commit/c1cc4a07d11c829f89ea62206689fba92eb91ea2</a>  is not working.</div><div>Please help me how to compile it for mips</div><div>Thanks and regards</div><div>Subhra</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 19, 2020 at 11:54 PM Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Module: kamailio<br>
Branch: 5.3<br>
Commit: c1cc4a07d11c829f89ea62206689fba92eb91ea2<br>
URL: <a href="https://github.com/kamailio/kamailio/commit/c1cc4a07d11c829f89ea62206689fba92eb91ea2" rel="noreferrer" target="_blank">https://github.com/kamailio/kamailio/commit/c1cc4a07d11c829f89ea62206689fba92eb91ea2</a><br>
<br>
Author: Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>><br>
Committer: Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>><br>
Date: 2020-03-19T19:19:58+01:00<br>
<br>
kamcmd: use pkg-config to get compile flags for lib readline<br>
<br>
(cherry picked from commit 0e6e05f8bec1fb451375d71a6b929a6908c5689d)<br>
<br>
---<br>
<br>
Modified: utils/kamcmd/Makefile<br>
<br>
---<br>
<br>
Diff:  <a href="https://github.com/kamailio/kamailio/commit/c1cc4a07d11c829f89ea62206689fba92eb91ea2.diff" rel="noreferrer" target="_blank">https://github.com/kamailio/kamailio/commit/c1cc4a07d11c829f89ea62206689fba92eb91ea2.diff</a><br>
Patch: <a href="https://github.com/kamailio/kamailio/commit/c1cc4a07d11c829f89ea62206689fba92eb91ea2.patch" rel="noreferrer" target="_blank">https://github.com/kamailio/kamailio/commit/c1cc4a07d11c829f89ea62206689fba92eb91ea2.patch</a><br>
<br>
---<br>
<br>
diff --git a/utils/kamcmd/Makefile b/utils/kamcmd/Makefile<br>
index aae4f1394c..c8a7e6807e 100644<br>
--- a/utils/kamcmd/Makefile<br>
+++ b/utils/kamcmd/Makefile<br>
@@ -18,6 +18,17 @@ readline_localpath=$(LOCALBASE)/include/readline/readline.h<br>
 readline_locations= /usr/include/readline/readline.h \<br>
                                        $(readline_localpath)<br>
<br>
+ifeq ($(CROSS_COMPILE),)<br>
+       BUILDER = $(shell which pkg-config)<br>
+ifneq ($(BUILDER),)<br>
+       PKGREADLINE = $(shell $(BUILDER) --exists readline > /dev/null 2>&1 ; echo $$? )<br>
+ifneq ($(PKGREADLINE),0)<br>
+       BUILDER =<br>
+endif<br>
+endif<br>
+endif<br>
+<br>
+<br>
 use_readline ?=<br>
 ifneq (,$(MAKECMDGOALS))<br>
 ifeq (,$(filter-out $(nodep_targets),$(MAKECMDGOALS)))<br>
@@ -66,6 +77,12 @@ ifneq (,$(findstring cygwin, $(OS)))<br>
        LIBS:= -lresolv<br>
 endif<br>
<br>
+# detect libreadline<br>
+ifneq ($(BUILDER),)<br>
+       DEFS += $(shell $(BUILDER) --cflags readline)<br>
+       LIBS += $(shell $(BUILDER) --libs readline)<br>
+       use_readline := 1<br>
+else<br>
 ifeq ($(use_readline),)<br>
 readline_path := $(shell  \<br>
                                                for r in $(readline_locations) ""; do \<br>
@@ -93,14 +110,20 @@ endif<br>
        LIBS+=-lreadline -lncurses<br>
 endif<br>
<br>
-endif<br>
+endif  # ifeq ($(use_readline),1)<br>
+<br>
+endif  # ifneq ($(BUILDER),)<br>
<br>
<br>
 include $(COREPATH)/Makefile.utils<br>
<br>
 ifeq (,$(quiet))<br>
 ifeq ($(use_readline),1)<br>
+ifneq ($(BUILDER),)<br>
+$(info readline detected via pkg-config)<br>
+else<br>
 $(info readline detected ($(readline_path)) )<br>
+endif<br>
 $(info command completion enabled)<br>
 else<br>
 $(info "no readline include files detected, disabling readline support")<br>
<br>
<br>
_______________________________________________<br>
Kamailio (SER) - Development Mailing List<br>
<a href="mailto:sr-dev@lists.kamailio.org" target="_blank">sr-dev@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
</blockquote></div></div>