From a76c9148107b36e1fe4d0de277822b83c1de2157 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Fri, 10 Nov 2017 16:13:46 +0100 Subject: [PATCH] TT#24224 Print the correct project version on -? Change-Id: I2f9945e332238769990cfb4b486bdd24b33843e5 --- Makefile | 4 ++++ config.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index db0684c..e7dbc96 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,11 @@ BIN=mediator +VERSION := $(shell sed -n -e '1s/^.*(\(.*\)).*$$/\1/p' debian/changelog) + CC := gcc +CPPFLAGS := -DMEDIATOR_VERSION="\"$(VERSION)\"" + GLIB_CFLAGS := $(shell pkg-config glib-2.0 --cflags) MARIADB_CFLAGS := $(shell mariadb_config --cflags) CFLAGS := $(GLIB_CFLAGS) $(MARIADB_CFLAGS) -g -Wall -O2 diff --git a/config.c b/config.c index 48af1a4..8e6138a 100644 --- a/config.c +++ b/config.c @@ -38,7 +38,7 @@ int strict_leg_tokens = 0; static void config_help(const char *self, int rc) { - printf("mediator 1.2.0 - Creates call detail records from OpenSER accounting.\n" \ + printf("mediator %s - Creates call detail records from OpenSER accounting.\n" \ "Usage: %s [-?] [-d] [-D pidpath]\n" \ " -D\tThe path of the PID file (default = '%s').\n" \ " -d\tEnables daemonization of the process (default = disabled).\n" \ @@ -68,7 +68,8 @@ static void config_help(const char *self, int rc) " -m\tMaintenance mode (do nothing, just sleep).\n" \ " -s\tStrict acc fields (move to trash otherwise).\n" \ " -?\tDisplays this message.\n", - self, MEDIATOR_DEFAULT_PIDPATH, MEDIATOR_DEFAULT_INTERVAL, + MEDIATOR_VERSION, self, + MEDIATOR_DEFAULT_PIDPATH, MEDIATOR_DEFAULT_INTERVAL, MEDIATOR_DEFAULT_ACCHOST, MEDIATOR_DEFAULT_ACCPORT, MEDIATOR_DEFAULT_ACCUSER, MEDIATOR_DEFAULT_ACCPASS, MEDIATOR_DEFAULT_ACCDB,