Module: kamailio
Branch: master
Commit: 3c09e0ed178fba801adf1b3721a10b565f316c0e
URL:
https://github.com/kamailio/kamailio/commit/3c09e0ed178fba801adf1b3721a10b5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-01-06T14:40:33+01:00
kamcmd: removed snv id from version output
- on darwin, use gnu readline from /opt/local if available
- version set to 1.5
---
Modified: utils/kamcmd/Makefile
Modified: utils/kamcmd/kamcmd.c
---
Diff:
https://github.com/kamailio/kamailio/commit/3c09e0ed178fba801adf1b3721a10b5…
Patch:
https://github.com/kamailio/kamailio/commit/3c09e0ed178fba801adf1b3721a10b5…
---
diff --git a/utils/kamcmd/Makefile b/utils/kamcmd/Makefile
index 4dc4674..1af68e2 100644
--- a/utils/kamcmd/Makefile
+++ b/utils/kamcmd/Makefile
@@ -6,7 +6,7 @@ include $(COREPATH)/Makefile.defs
include $(COREPATH)/Makefile.targets
auto_gen=
-RELEASE=0.2
+RELEASE=1.5
UTIL_SRC_NAME=kamcmd
ifeq ($(FLAVOUR),ser)
NAME?=sercmd
@@ -56,6 +56,9 @@ ifeq ($(OS), netbsd)
LIBS:=
endif
ifeq ($(OS), darwin)
+readline_locations= /opt/local/include/readline/readline.h \
+ /usr/include/readline/readline.h \
+ $(LOCALBASE)/include/readline/readline.h
LIBS:= -lresolv
endif
ifneq (,$(findstring cygwin, $(OS)))
@@ -74,9 +77,14 @@ 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
+else
DEFS+=-DUSE_READLINE
LIBS+=-lreadline -lncurses
endif
+endif
include $(COREPATH)/Makefile.utils
@@ -92,7 +100,7 @@ $(info "to force readline support try 'make
use_readline=1'")
endif
endif # ifeq (,$(quiet))
-$(NAME).o:
+$(NAME).o:
.PHONY: msg
msg:
diff --git a/utils/kamcmd/kamcmd.c b/utils/kamcmd/kamcmd.c
index a504b26..f18af8b 100644
--- a/utils/kamcmd/kamcmd.c
+++ b/utils/kamcmd/kamcmd.c
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Copyright (C) 2006 iptelorg GmbH
*
* This file is part of kamailio, a free SIP server.
@@ -20,19 +18,13 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* send commands using binrpc
*
- * History:
- * --------
- * 2006-02-14 created by andrei
- * 2009-06-29 command line completion for cfg groups and vars (andrei)
- * 2009-06-30 command line completion for mi cmds (andrei)
- * 2010-08-08 command line completion for counters/statistic (andrei)
*/
@@ -68,10 +60,10 @@
#ifndef NAME
-#define NAME "sercmd"
+#define NAME "kamcmd"
#endif
#ifndef VERSION
-#define VERSION "0.2"
+#define VERSION "1.5"
#endif
#define IOVEC_CNT 20
@@ -85,7 +77,6 @@
#define UNIX_PATH_MAX 104
#endif
-static char id[]="$Id$";
static char version[]= NAME " " VERSION;
#ifdef VERSION_NODATE
static char compiled[] = "";
@@ -1793,7 +1784,6 @@ static int sercmd_help(int s, struct binrpc_cmd* cmd)
static int sercmd_ver(int s, struct binrpc_cmd* cmd)
{
printf("%s\n", version);
- printf("%s\n", id);
printf("%s compiled on %s \n", __FILE__, compiled);
#ifdef USE_READLINE
printf("interactive mode command completion support\n");
@@ -2198,7 +2188,6 @@ int main(int argc, char** argv)
switch(c){
case 'V':
printf("version: %s\n", version);
- printf("%s\n", id);
printf("%s compiled on %s \n", __FILE__,
compiled);
exit(0);