[sr-dev] git:master:dad79f34: kamcmd: add /usr/local to C defs and libs if readline is detected in the path

Daniel-Constantin Mierla miconda at gmail.com
Mon Jan 9 18:19:46 CET 2017


Module: kamailio
Branch: master
Commit: dad79f34077eb818604293fe90b6565fa6a4f365
URL: https://github.com/kamailio/kamailio/commit/dad79f34077eb818604293fe90b6565fa6a4f365

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-01-09T18:18:18+01:00

kamcmd: add /usr/local to C defs and libs if readline is detected in the path

- reported by GH#920

---

Modified: utils/kamcmd/Makefile

---

Diff:  https://github.com/kamailio/kamailio/commit/dad79f34077eb818604293fe90b6565fa6a4f365.diff
Patch: https://github.com/kamailio/kamailio/commit/dad79f34077eb818604293fe90b6565fa6a4f365.patch

---

diff --git a/utils/kamcmd/Makefile b/utils/kamcmd/Makefile
index 1af68e2..aae4f13 100644
--- a/utils/kamcmd/Makefile
+++ b/utils/kamcmd/Makefile
@@ -14,8 +14,9 @@ else
 	NAME?=kamcmd
 endif
 
+readline_localpath=$(LOCALBASE)/include/readline/readline.h
 readline_locations= /usr/include/readline/readline.h \
-					$(LOCALBASE)/include/readline/readline.h
+					$(readline_localpath)
 
 use_readline ?=
 ifneq (,$(MAKECMDGOALS))
@@ -58,7 +59,7 @@ endif
 ifeq ($(OS), darwin)
 readline_locations= /opt/local/include/readline/readline.h \
 					/usr/include/readline/readline.h \
-					$(LOCALBASE)/include/readline/readline.h
+					$(readline_localpath)
 	LIBS:= -lresolv
 endif
 ifneq (,$(findstring cygwin, $(OS)))
@@ -77,13 +78,21 @@ endif
 endif
 
 ifeq ($(use_readline),1)
+
 ifneq (,$(findstring opt, $(readline_path)))
 	DEFS+=-DUSE_READLINE -I /opt/local/include
-	LIBS+=-L /opt/local/lib -lreadline -lncurses
+	LIBS+=-L/opt/local/lib -lreadline -lncurses
 else
+
+ifeq ($(readline_path),$(readline_localpath))
+	DEFS+=-I$(LOCALBASE)/include
+	LIBS+=-L$(LOCALBASE)/lib
+endif
+
 	DEFS+=-DUSE_READLINE
 	LIBS+=-lreadline -lncurses
 endif
+
 endif
 
 




More information about the sr-dev mailing list