BUILD: add a new file "version.c" to carry version updates

While testing fixes, it's sometimes confusing to rebuild only one C file
(e.g. a mux) and not to have the correct commit ID reported in "haproxy -v"
nor on the stats page.

This patch adds a new "version.c" file which is always rebuilt. It's
very small and contains only 3 variables derived from the various
version strings. These variables are used instead of the macros at the
few places showing the version. This way the output version of the
running code is always correct for the parts that were rebuilt.
diff --git a/src/haproxy.c b/src/haproxy.c
index 0b99a13..d47dff3 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -370,7 +370,7 @@
 
 static void display_version()
 {
-	printf("HA-Proxy version " HAPROXY_VERSION " " HAPROXY_DATE" - https://haproxy.org/\n");
+	printf("HA-Proxy version %s %s - https://haproxy.org/\n", haproxy_version, haproxy_date);
 }
 
 static void display_build_opts()
diff --git a/src/stats.c b/src/stats.c
index bb6fa47..5e54dd5 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -2386,7 +2386,7 @@
 	              "<td align=\"left\" valign=\"top\" nowrap width=\"1%%\">"
 	              "<b>Display option:</b><ul style=\"margin-top: 0.25em;\">"
 	              "",
-	              (uri->flags & ST_HIDEVER) ? "" : (STATS_VERSION_STRING),
+	              (uri->flags & ST_HIDEVER) ? "" : (stats_version_string),
 	              pid, (uri->flags & ST_SHNODE) ? " on " : "",
 		      (uri->flags & ST_SHNODE) ? (uri->node ? uri->node : global.node) : "",
 	              (uri->flags & ST_SHDESC) ? ": " : "",
@@ -3558,8 +3558,8 @@
 	memset(info, 0, sizeof(*info) * len);
 
 	info[INF_NAME]                           = mkf_str(FO_PRODUCT|FN_OUTPUT|FS_SERVICE, PRODUCT_NAME);
-	info[INF_VERSION]                        = mkf_str(FO_PRODUCT|FN_OUTPUT|FS_SERVICE, HAPROXY_VERSION);
-	info[INF_RELEASE_DATE]                   = mkf_str(FO_PRODUCT|FN_OUTPUT|FS_SERVICE, HAPROXY_DATE);
+	info[INF_VERSION]                        = mkf_str(FO_PRODUCT|FN_OUTPUT|FS_SERVICE, haproxy_version);
+	info[INF_RELEASE_DATE]                   = mkf_str(FO_PRODUCT|FN_OUTPUT|FS_SERVICE, haproxy_date);
 
 	info[INF_NBTHREAD]                       = mkf_u32(FO_CONFIG|FS_SERVICE, global.nbthread);
 	info[INF_NBPROC]                         = mkf_u32(FO_CONFIG|FS_SERVICE, global.nbproc);
diff --git a/src/version.c b/src/version.c
new file mode 100644
index 0000000..f50f24b
--- /dev/null
+++ b/src/version.c
@@ -0,0 +1,11 @@
+/*
+ * Version reporting : all user-visible version information should come from
+ * this file so that rebuilding only this one is enough to report the latest
+ * code version.
+ */
+
+#include <common/version.h>
+
+const char *haproxy_version      = HAPROXY_VERSION;
+const char *haproxy_date         = HAPROXY_DATE;
+const char *stats_version_string = STATS_VERSION_STRING;