Browse code

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\""'

Daniel-Constantin Mierla authored on 06/02/2015 18:23:51
Showing 2 changed files
... ...
@@ -1905,8 +1905,12 @@ int main(int argc, char** argv)
1905 1905
 					printf("flags: %s\n", ver_flags );
1906 1906
 					print_ct_constants();
1907 1907
 					printf("id: %s\n", ver_id);
1908
-					printf("compiled on %s with %s\n",
1908
+					if(strlen(ver_compiled_time)>0)
1909
+						printf("compiled on %s with %s\n",
1909 1910
 							ver_compiled_time, ver_compiler );
1911
+					else
1912
+						printf("compiled with %s\n",
1913
+							ver_compiler );
1910 1914
 
1911 1915
 					exit(0);
1912 1916
 					break;
... ...
@@ -29,7 +29,15 @@ const char ver_version[] = VERSION;
29 29
 const char ver_arch[] = ARCH;
30 30
 const char ver_os[] = OS_QUOTED;
31 31
 const char ver_id[] = REPO_HASH " " REPO_STATE;
32
+#ifdef VERSION_NODATE
33
+const char ver_compiled_time[] =  "" ;
34
+#else
35
+#ifdef VERSION_DATE
36
+const char ver_compiled_time[] =  VERSION_DATE ;
37
+#else
32 38
 const char ver_compiled_time[] =  __TIME__ " " __DATE__ ;
39
+#endif
40
+#endif
33 41
 const char ver_compiler[] = COMPILER;
34 42
 
35 43
 const char ver_flags[] = SER_COMPILE_FLAGS;