[sr-dev] git:master:e03d1279: core: compile options to skip compile date or set a particular value

Daniel-Constantin Mierla miconda at gmail.com
Fri Feb 6 19:26:34 CET 2015


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-02-06T19:26:24+01:00

core: compile options to skip compile date or set a particular value

- default is current behaviour, date and time included in version string
- compile with no date and time:
  make CC_EXTRA_OPTS="-DVERSION_NODATE"
- compile with a specific date and time:
  make CC_EXTRA_OPTS='"-DVERSION_DATE=\"19:30:40 Feb  8 2015\""'

---

Modified: main.c
Modified: ver.c

---

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

---

diff --git a/main.c b/main.c
index ba19d58..8e6e9c8 100644
--- a/main.c
+++ b/main.c
@@ -1905,8 +1905,12 @@ int main(int argc, char** argv)
 					printf("flags: %s\n", ver_flags );
 					print_ct_constants();
 					printf("id: %s\n", ver_id);
-					printf("compiled on %s with %s\n",
+					if(strlen(ver_compiled_time)>0)
+						printf("compiled on %s with %s\n",
 							ver_compiled_time, ver_compiler );
+					else
+						printf("compiled with %s\n",
+							ver_compiler );
 
 					exit(0);
 					break;
diff --git a/ver.c b/ver.c
index 9e4ce78..3136e73 100644
--- a/ver.c
+++ b/ver.c
@@ -29,7 +29,15 @@ const char ver_version[] = VERSION;
 const char ver_arch[] = ARCH;
 const char ver_os[] = OS_QUOTED;
 const char ver_id[] = REPO_HASH " " REPO_STATE;
+#ifdef VERSION_NODATE
+const char ver_compiled_time[] =  "" ;
+#else
+#ifdef VERSION_DATE
+const char ver_compiled_time[] =  VERSION_DATE ;
+#else
 const char ver_compiled_time[] =  __TIME__ " " __DATE__ ;
+#endif
+#endif
 const char ver_compiler[] = COMPILER;
 
 const char ver_flags[] = SER_COMPILE_FLAGS;




More information about the sr-dev mailing list