Module: kamailio Branch: master Commit: 0e6e05f8bec1fb451375d71a6b929a6908c5689d URL: https://github.com/kamailio/kamailio/commit/0e6e05f8bec1fb451375d71a6b929a69...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2020-03-18T17:39:49+01:00
kamcmd: use pkg-config to get compile flags for lib readline
---
Modified: utils/kamcmd/Makefile
---
Diff: https://github.com/kamailio/kamailio/commit/0e6e05f8bec1fb451375d71a6b929a69... Patch: https://github.com/kamailio/kamailio/commit/0e6e05f8bec1fb451375d71a6b929a69...
---
diff --git a/utils/kamcmd/Makefile b/utils/kamcmd/Makefile index aae4f1394c..c8a7e6807e 100644 --- a/utils/kamcmd/Makefile +++ b/utils/kamcmd/Makefile @@ -18,6 +18,17 @@ readline_localpath=$(LOCALBASE)/include/readline/readline.h readline_locations= /usr/include/readline/readline.h \ $(readline_localpath)
+ifeq ($(CROSS_COMPILE),) + BUILDER = $(shell which pkg-config) +ifneq ($(BUILDER),) + PKGREADLINE = $(shell $(BUILDER) --exists readline > /dev/null 2>&1 ; echo $$? ) +ifneq ($(PKGREADLINE),0) + BUILDER = +endif +endif +endif + + use_readline ?= ifneq (,$(MAKECMDGOALS)) ifeq (,$(filter-out $(nodep_targets),$(MAKECMDGOALS))) @@ -66,6 +77,12 @@ ifneq (,$(findstring cygwin, $(OS))) LIBS:= -lresolv endif
+# detect libreadline +ifneq ($(BUILDER),) + DEFS += $(shell $(BUILDER) --cflags readline) + LIBS += $(shell $(BUILDER) --libs readline) + use_readline := 1 +else ifeq ($(use_readline),) readline_path := $(shell \ for r in $(readline_locations) ""; do \ @@ -93,14 +110,20 @@ endif LIBS+=-lreadline -lncurses endif
-endif +endif # ifeq ($(use_readline),1) + +endif # ifneq ($(BUILDER),)
include $(COREPATH)/Makefile.utils
ifeq (,$(quiet)) ifeq ($(use_readline),1) +ifneq ($(BUILDER),) +$(info readline detected via pkg-config) +else $(info readline detected ($(readline_path)) ) +endif $(info command completion enabled) else $(info "no readline include files detected, disabling readline support")
Dear Daniel I applied the latest Makefile that you have shared. Still i am getting following error. ---------------------------------- install -m 755 ss7ops.so /usr/local/lib64/kamailio/modules LD (/home/subhra/SDK3.1.2/tools-3.1.2_build_50/bin/mips64-octeon-linux-gnu-gcc) [U kamcmd] kamcmd /home/subhra/SDK3.1.2/tools-3.1.2_build_50/bin/../lib/gcc/mips64-octeon-linux-gnu/4.7.0/../../../../mips64-octeon-linux-gnu/bin/ld: cannot find -lreadline /home/subhra/SDK3.1.2/tools-3.1.2_build_50/bin/../lib/gcc/mips64-octeon-linux-gnu/4.7.0/../../../../mips64-octeon-linux-gnu/bin/ld: cannot find -lncurses collect2: error: ld returned 1 exit status ../../src//Makefile.rules:191: recipe for target 'kamcmd' failed make[3]: *** [kamcmd] Error 1 ERROR: make --no-print-directory -C ../../../utils/kamcmd install-if-newer failed ../../Makefile.modules:138: recipe for target 'install-utils' failed make[2]: *** [install-utils] Error 1 Makefile:511: recipe for target 'install-modules' failed make[1]: *** [install-modules] Error 1 make[1]: Leaving directory '/home/subhra/Downloads/kamailio-5.3.3/src' Makefile:43: recipe for target 'install' failed make: *** [install] Error 2 -------------------------------------------------
Hello,
it seems that libreadline-dev is not installing any pkg-config file, so its path is not detected.
Can you locate where readline.h and libreadline*.so* files are installed on your system? We can add the paths to the makefile of the kamcmd.
Cheers, Daniel
On 19.03.20 04:15, subhra giri wrote:
Dear Daniel I applied the latest Makefile that you have shared. Still i am getting following error.
install -m 755 ss7ops.so /usr/local/lib64/kamailio/modules LD (/home/subhra/SDK3.1.2/tools-3.1.2_build_50/bin/mips64-octeon-linux-gnu-gcc) [U kamcmd] kamcmd /home/subhra/SDK3.1.2/tools-3.1.2_build_50/bin/../lib/gcc/mips64-octeon-linux-gnu/4.7.0/../../../../mips64-octeon-linux-gnu/bin/ld: cannot find -lreadline /home/subhra/SDK3.1.2/tools-3.1.2_build_50/bin/../lib/gcc/mips64-octeon-linux-gnu/4.7.0/../../../../mips64-octeon-linux-gnu/bin/ld: cannot find -lncurses collect2: error: ld returned 1 exit status ../../src//Makefile.rules:191: recipe for target 'kamcmd' failed make[3]: *** [kamcmd] Error 1 ERROR: make --no-print-directory -C ../../../utils/kamcmd install-if-newer failed ../../Makefile.modules:138: recipe for target 'install-utils' failed make[2]: *** [install-utils] Error 1 Makefile:511: recipe for target 'install-modules' failed make[1]: *** [install-modules] Error 1 make[1]: Leaving directory '/home/subhra/Downloads/kamailio-5.3.3/src' Makefile:43: recipe for target 'install' failed make: *** [install] Error 2 -------------------------------------------------
Hi Daniel readline.h is located at /usr/include/readline/readline.h
And libreadline*.so* are present at
/lib/x86_64-linux-gnu/libreadline.so.7 /lib/x86_64-linux-gnu/libreadline.so.7.0 /usr/lib/x86_64-linux-gnu/libreadline.so
Thanks and Regards Subhra Prakash Giri
On Thu, Mar 19, 2020 at 7:43 PM Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
it seems that libreadline-dev is not installing any pkg-config file, so its path is not detected.
Can you locate where readline.h and libreadline*.so* files are installed on your system? We can add the paths to the makefile of the kamcmd.
Cheers, Daniel On 19.03.20 04:15, subhra giri wrote:
Dear Daniel I applied the latest Makefile that you have shared. Still i am getting following error.
install -m 755 ss7ops.so /usr/local/lib64/kamailio/modules LD (/home/subhra/SDK3.1.2/tools-3.1.2_build_50/bin/mips64-octeon-linux-gnu-gcc) [U kamcmd] kamcmd /home/subhra/SDK3.1.2/tools-3.1.2_build_50/bin/../lib/gcc/mips64-octeon-linux-gnu/4.7.0/../../../../mips64-octeon-linux-gnu/bin/ld: cannot find -lreadline /home/subhra/SDK3.1.2/tools-3.1.2_build_50/bin/../lib/gcc/mips64-octeon-linux-gnu/4.7.0/../../../../mips64-octeon-linux-gnu/bin/ld: cannot find -lncurses collect2: error: ld returned 1 exit status ../../src//Makefile.rules:191: recipe for target 'kamcmd' failed make[3]: *** [kamcmd] Error 1 ERROR: make --no-print-directory -C ../../../utils/kamcmd install-if-newer failed ../../Makefile.modules:138: recipe for target 'install-utils' failed make[2]: *** [install-utils] Error 1 Makefile:511: recipe for target 'install-modules' failed make[1]: *** [install-modules] Error 1 make[1]: Leaving directory '/home/subhra/Downloads/kamailio-5.3.3/src' Makefile:43: recipe for target 'install' failed make: *** [install] Error 2
-- Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
That’s the wrong path because is the host’s path. You need to install readline for the target and provide that path to the Makefile.
-ovidiu
On Thu, Mar 19, 2020 at 11:05 subhra giri subhraprakash79@gmail.com wrote:
Hi Daniel readline.h is located at /usr/include/readline/readline.h
And libreadline*.so* are present at
/lib/x86_64-linux-gnu/libreadline.so.7 /lib/x86_64-linux-gnu/libreadline.so.7.0 /usr/lib/x86_64-linux-gnu/libreadline.so
Thanks and Regards Subhra Prakash Giri
On Thu, Mar 19, 2020 at 7:43 PM Daniel-Constantin Mierla < miconda@gmail.com> wrote:
Hello,
it seems that libreadline-dev is not installing any pkg-config file, so its path is not detected.
Can you locate where readline.h and libreadline*.so* files are installed on your system? We can add the paths to the makefile of the kamcmd.
Cheers, Daniel On 19.03.20 04:15, subhra giri wrote:
Dear Daniel I applied the latest Makefile that you have shared. Still i am getting following error.
install -m 755 ss7ops.so /usr/local/lib64/kamailio/modules LD (/home/subhra/SDK3.1.2/tools-3.1.2_build_50/bin/mips64-octeon-linux-gnu-gcc) [U kamcmd] kamcmd /home/subhra/SDK3.1.2/tools-3.1.2_build_50/bin/../lib/gcc/mips64-octeon-linux-gnu/4.7.0/../../../../mips64-octeon-linux-gnu/bin/ld: cannot find -lreadline /home/subhra/SDK3.1.2/tools-3.1.2_build_50/bin/../lib/gcc/mips64-octeon-linux-gnu/4.7.0/../../../../mips64-octeon-linux-gnu/bin/ld: cannot find -lncurses collect2: error: ld returned 1 exit status ../../src//Makefile.rules:191: recipe for target 'kamcmd' failed make[3]: *** [kamcmd] Error 1 ERROR: make --no-print-directory -C ../../../utils/kamcmd install-if-newer failed ../../Makefile.modules:138: recipe for target 'install-utils' failed make[2]: *** [install-utils] Error 1 Makefile:511: recipe for target 'install-modules' failed make[1]: *** [install-modules] Error 1 make[1]: Leaving directory '/home/subhra/Downloads/kamailio-5.3.3/src' Makefile:43: recipe for target 'install' failed make: *** [install] Error 2
-- Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Hi readline.h is located at /home/subhra/SDK3.1.2/linux/embedded_rootfs/build/readline-5.1/readline.h And libreadline*.so* are present at
/home/subhra/SDK3.1.2/linux/embedded_rootfs/build/readline-5.1/shlib/libreadline.so.5.1 /home/subhra/SDK3.1.2/linux/embedded_rootfs/build/readline-5.1/shlib/readline.so
Please let me know what i should add in Makefile Thanks and Regards Subhra Prakash Giri
On Thu, Mar 19, 2020 at 9:05 PM Ovidiu Sas osas@voipembedded.com wrote:
That’s the wrong path because is the host’s path. You need to install readline for the target and provide that path to the Makefile.
-ovidiu
On Thu, Mar 19, 2020 at 11:05 subhra giri subhraprakash79@gmail.com wrote:
Hi Daniel readline.h is located at /usr/include/readline/readline.h
And libreadline*.so* are present at
/lib/x86_64-linux-gnu/libreadline.so.7 /lib/x86_64-linux-gnu/libreadline.so.7.0 /usr/lib/x86_64-linux-gnu/libreadline.so
Thanks and Regards Subhra Prakash Giri
On Thu, Mar 19, 2020 at 7:43 PM Daniel-Constantin Mierla < miconda@gmail.com> wrote:
Hello,
it seems that libreadline-dev is not installing any pkg-config file, so its path is not detected.
Can you locate where readline.h and libreadline*.so* files are installed on your system? We can add the paths to the makefile of the kamcmd.
Cheers, Daniel On 19.03.20 04:15, subhra giri wrote:
Dear Daniel I applied the latest Makefile that you have shared. Still i am getting following error.
install -m 755 ss7ops.so /usr/local/lib64/kamailio/modules LD (/home/subhra/SDK3.1.2/tools-3.1.2_build_50/bin/mips64-octeon-linux-gnu-gcc) [U kamcmd] kamcmd /home/subhra/SDK3.1.2/tools-3.1.2_build_50/bin/../lib/gcc/mips64-octeon-linux-gnu/4.7.0/../../../../mips64-octeon-linux-gnu/bin/ld: cannot find -lreadline /home/subhra/SDK3.1.2/tools-3.1.2_build_50/bin/../lib/gcc/mips64-octeon-linux-gnu/4.7.0/../../../../mips64-octeon-linux-gnu/bin/ld: cannot find -lncurses collect2: error: ld returned 1 exit status ../../src//Makefile.rules:191: recipe for target 'kamcmd' failed make[3]: *** [kamcmd] Error 1 ERROR: make --no-print-directory -C ../../../utils/kamcmd install-if-newer failed ../../Makefile.modules:138: recipe for target 'install-utils' failed make[2]: *** [install-utils] Error 1 Makefile:511: recipe for target 'install-modules' failed make[1]: *** [install-modules] Error 1 make[1]: Leaving directory '/home/subhra/Downloads/kamailio-5.3.3/src' Makefile:43: recipe for target 'install' failed make: *** [install] Error 2
-- Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
-- VoIP Embedded, Inc. http://www.voipembedded.com _______________________________________________ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Hi
The updated Makefile is not able to compile readline. Please help me to cross compile for MIPS.
Thanks and Regards
On Wed, Mar 18, 2020 at 10:12 PM Daniel-Constantin Mierla miconda@gmail.com wrote:
Module: kamailio Branch: master Commit: 0e6e05f8bec1fb451375d71a6b929a6908c5689d URL: https://github.com/kamailio/kamailio/commit/0e6e05f8bec1fb451375d71a6b929a69...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2020-03-18T17:39:49+01:00
kamcmd: use pkg-config to get compile flags for lib readline
Modified: utils/kamcmd/Makefile
Diff: https://github.com/kamailio/kamailio/commit/0e6e05f8bec1fb451375d71a6b929a69... Patch: https://github.com/kamailio/kamailio/commit/0e6e05f8bec1fb451375d71a6b929a69...
diff --git a/utils/kamcmd/Makefile b/utils/kamcmd/Makefile index aae4f1394c..c8a7e6807e 100644 --- a/utils/kamcmd/Makefile +++ b/utils/kamcmd/Makefile @@ -18,6 +18,17 @@ readline_localpath=$(LOCALBASE)/include/readline/readline.h readline_locations= /usr/include/readline/readline.h \ $(readline_localpath)
+ifeq ($(CROSS_COMPILE),)
BUILDER = $(shell which pkg-config)
+ifneq ($(BUILDER),)
PKGREADLINE = $(shell $(BUILDER) --exists readline > /dev/null
2>&1 ; echo $$? ) +ifneq ($(PKGREADLINE),0)
BUILDER =
+endif +endif +endif
use_readline ?= ifneq (,$(MAKECMDGOALS)) ifeq (,$(filter-out $(nodep_targets),$(MAKECMDGOALS))) @@ -66,6 +77,12 @@ ifneq (,$(findstring cygwin, $(OS))) LIBS:= -lresolv endif
+# detect libreadline +ifneq ($(BUILDER),)
DEFS += $(shell $(BUILDER) --cflags readline)
LIBS += $(shell $(BUILDER) --libs readline)
use_readline := 1
+else ifeq ($(use_readline),) readline_path := $(shell \ for r in $(readline_locations) ""; do \ @@ -93,14 +110,20 @@ endif LIBS+=-lreadline -lncurses endif
-endif +endif # ifeq ($(use_readline),1)
+endif # ifneq ($(BUILDER),)
include $(COREPATH)/Makefile.utils
ifeq (,$(quiet)) ifeq ($(use_readline),1) +ifneq ($(BUILDER),) +$(info readline detected via pkg-config) +else $(info readline detected ($(readline_path)) ) +endif $(info command completion enabled) else $(info "no readline include files detected, disabling readline support")
Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev