diff --git a/Makefile.am b/Makefile.am index 51bf21f900..e477788a63 100644 --- a/Makefile.am +++ b/Makefile.am @@ -178,6 +178,8 @@ endif version.c: FORCE | $(dir_target) echo "$(build_date)" | awk 'BEGIN {} {print "const char *janus_build_git_time = \""$$0"\";"} END {} ' >> version.c + echo "$(JANUS_VERSION)" | awk 'BEGIN {} {print "int janus_version = "$$0";"} END {} ' >> version.c + echo "$(JANUS_VERSION_STRING)" | awk 'BEGIN {} {print "const char *janus_version_string = \""$$0"\";"} END {} ' >> version.c $(dir_present): `which git` rev-parse HEAD | awk 'BEGIN {print "#include \"version.h\""} {print "const char *janus_build_git_sha = \"" $$0"\";"} END {}' > version.c @@ -452,6 +454,7 @@ janus_pp_rec_SOURCES = \ postprocessing/pp-webm.h \ postprocessing/janus-pp-rec.c \ log.c \ + version.c \ $(NULL) janus_pp_rec_CFLAGS = \ diff --git a/configure.ac b/configure.ac index 559a960a60..c78b8882e1 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,11 @@ AC_PROG_CC LT_PREREQ([2.2]) LT_INIT +JANUS_VERSION=30 +AC_SUBST(JANUS_VERSION) +JANUS_VERSION_STRING="0.3.0" +AC_SUBST(JANUS_VERSION_STRING) + case "$host_os" in darwin*) CFLAGS="$CFLAGS -I/usr/local/opt/openssl/include -I/usr/local/include" diff --git a/janus.c b/janus.c index f42af7b67e..c8dfd2173f 100644 --- a/janus.c +++ b/janus.c @@ -41,8 +41,6 @@ #define JANUS_NAME "Janus WebRTC Gateway" #define JANUS_AUTHOR "Meetecho s.r.l." -#define JANUS_VERSION 30 -#define JANUS_VERSION_STRING "0.3.0" #define JANUS_SERVER_NAME "MyJanusInstance" #ifdef __MACH__ @@ -192,8 +190,8 @@ static json_t *janus_info(const char *transaction) { if(transaction != NULL) json_object_set_new(info, "transaction", json_string(transaction)); json_object_set_new(info, "name", json_string(JANUS_NAME)); - json_object_set_new(info, "version", json_integer(JANUS_VERSION)); - json_object_set_new(info, "version_string", json_string(JANUS_VERSION_STRING)); + json_object_set_new(info, "version", json_integer(janus_version)); + json_object_set_new(info, "version_string", json_string(janus_version_string)); json_object_set_new(info, "author", json_string(JANUS_AUTHOR)); json_object_set_new(info, "commit-hash", json_string(janus_build_git_sha)); json_object_set_new(info, "compile-time", json_string(janus_build_git_time)); @@ -3176,7 +3174,7 @@ gint main(int argc, char *argv[]) exit(1); JANUS_PRINT("---------------------------------------------------\n"); - JANUS_PRINT(" Starting Meetecho Janus (WebRTC Gateway) v%s\n", JANUS_VERSION_STRING); + JANUS_PRINT(" Starting Meetecho Janus (WebRTC Gateway) v%s\n", janus_version_string); JANUS_PRINT("---------------------------------------------------\n\n"); /* Handle SIGINT (CTRL-C), SIGTERM (from service managers) */ diff --git a/postprocessing/janus-pp-rec.c b/postprocessing/janus-pp-rec.c index 91ab40a4b0..51e2f44c50 100644 --- a/postprocessing/janus-pp-rec.c +++ b/postprocessing/janus-pp-rec.c @@ -64,6 +64,7 @@ #include #include "../debug.h" +#include "../version.h" #include "pp-rtp.h" #include "pp-webm.h" #include "pp-h264.h" @@ -98,6 +99,10 @@ int main(int argc, char *argv[]) janus_log_init(FALSE, TRUE, NULL); atexit(janus_log_destroy); + JANUS_LOG(LOG_INFO, "Janus version: %d (%s)\n", janus_version, janus_version_string); + JANUS_LOG(LOG_INFO, "Janus commit: %s\n", janus_build_git_sha); + JANUS_LOG(LOG_INFO, "Compiled on: %s\n\n", janus_build_git_time); + /* Check the JANUS_PPREC_DEBUG environment variable for the debugging level */ if(g_getenv("JANUS_PPREC_DEBUG") != NULL) { int val = atoi(g_getenv("JANUS_PPREC_DEBUG")); diff --git a/version.h b/version.h index 6050cfdd3a..703d9fb5e0 100644 --- a/version.h +++ b/version.h @@ -13,6 +13,8 @@ #ifndef _JANUS_VERSION_H #define _JANUS_VERSION_H +extern int janus_version; +extern const char *janus_version_string; extern const char *janus_build_git_time; extern const char *janus_build_git_sha;