Browse Source

kamcmd: removed snv id from version output

- on darwin, use gnu readline from /opt/local if available
- version set to 1.5
Daniel-Constantin Mierla 8 years ago
parent
commit
3c09e0ed17
2 changed files with 14 additions and 17 deletions
  1. 10 2
      utils/kamcmd/Makefile
  2. 4 15
      utils/kamcmd/kamcmd.c

+ 10 - 2
utils/kamcmd/Makefile

@@ -6,7 +6,7 @@ include $(COREPATH)/Makefile.defs
 include $(COREPATH)/Makefile.targets
 include $(COREPATH)/Makefile.targets
 
 
 auto_gen=
 auto_gen=
-RELEASE=0.2
+RELEASE=1.5
 UTIL_SRC_NAME=kamcmd
 UTIL_SRC_NAME=kamcmd
 ifeq ($(FLAVOUR),ser)
 ifeq ($(FLAVOUR),ser)
 	NAME?=sercmd
 	NAME?=sercmd
@@ -56,6 +56,9 @@ ifeq ($(OS), netbsd)
 	LIBS:=
 	LIBS:=
 endif
 endif
 ifeq ($(OS), darwin)
 ifeq ($(OS), darwin)
+readline_locations= /opt/local/include/readline/readline.h \
+					/usr/include/readline/readline.h \
+					$(LOCALBASE)/include/readline/readline.h
 	LIBS:= -lresolv
 	LIBS:= -lresolv
 endif
 endif
 ifneq (,$(findstring cygwin, $(OS)))
 ifneq (,$(findstring cygwin, $(OS)))
@@ -74,9 +77,14 @@ endif
 endif
 endif
 
 
 ifeq ($(use_readline),1)
 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
 	DEFS+=-DUSE_READLINE
 	LIBS+=-lreadline -lncurses
 	LIBS+=-lreadline -lncurses
 endif
 endif
+endif
 
 
 
 
 include $(COREPATH)/Makefile.utils
 include $(COREPATH)/Makefile.utils
@@ -92,7 +100,7 @@ $(info "to force readline support try 'make use_readline=1'")
 endif
 endif
 endif # ifeq (,$(quiet))
 endif # ifeq (,$(quiet))
 
 
-$(NAME).o: 
+$(NAME).o:
 
 
 .PHONY: msg
 .PHONY: msg
 msg:
 msg:

+ 4 - 15
utils/kamcmd/kamcmd.c

@@ -1,6 +1,4 @@
 /*
 /*
- * $Id$
- *
  * Copyright (C) 2006 iptelorg GmbH
  * Copyright (C) 2006 iptelorg GmbH
  *
  *
  * This file is part of kamailio, a free SIP server.
  * This file is part of kamailio, a free SIP server.
@@ -20,19 +18,13 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  * 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
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
  */
 /*
 /*
  * send commands using binrpc
  * 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
 #ifndef NAME
-#define NAME    "sercmd"
+#define NAME    "kamcmd"
 #endif
 #endif
 #ifndef VERSION
 #ifndef VERSION
-#define VERSION "0.2"
+#define VERSION "1.5"
 #endif
 #endif
 
 
 #define IOVEC_CNT 20
 #define IOVEC_CNT 20
@@ -85,7 +77,6 @@
 #define UNIX_PATH_MAX 104
 #define UNIX_PATH_MAX 104
 #endif
 #endif
 
 
-static char id[]="$Id$";
 static char version[]= NAME " " VERSION;
 static char version[]= NAME " " VERSION;
 #ifdef VERSION_NODATE
 #ifdef VERSION_NODATE
 static char compiled[] = "";
 static char compiled[] = "";
@@ -1793,7 +1784,6 @@ error:
 static int sercmd_ver(int s, struct binrpc_cmd* cmd)
 static int sercmd_ver(int s, struct binrpc_cmd* cmd)
 {
 {
 	printf("%s\n", version);
 	printf("%s\n", version);
-	printf("%s\n", id);
 	printf("%s compiled on %s \n", __FILE__, compiled);
 	printf("%s compiled on %s \n", __FILE__, compiled);
 #ifdef USE_READLINE
 #ifdef USE_READLINE
 	printf("interactive mode command completion support\n");
 	printf("interactive mode command completion support\n");
@@ -2198,7 +2188,6 @@ int main(int argc, char** argv)
 		switch(c){
 		switch(c){
 			case 'V':
 			case 'V':
 				printf("version: %s\n", version);
 				printf("version: %s\n", version);
-				printf("%s\n", id);
 				printf("%s compiled on %s \n", __FILE__,
 				printf("%s compiled on %s \n", __FILE__,
 						compiled);
 						compiled);
 				exit(0);
 				exit(0);