MINOR: global: export the build features string list
authorWilly Tarreau <w@1wt.eu>
Thu, 6 May 2021 14:30:32 +0000 (16:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 6 May 2021 15:02:36 +0000 (17:02 +0200)
Till now it was only presented in the version output but could not be
consulted outside of haproxy.c, let's export it as a variable, and set
it to an empty string if not defined.

include/haproxy/global.h
src/haproxy.c

index 4231ba8..bb32711 100644 (file)
@@ -27,6 +27,7 @@
 #include <haproxy/mworker-t.h>
 #include <haproxy/vars-t.h>
 
+extern const char *build_features;
 extern struct global global;
 extern int  pid;                /* current process id */
 extern int  relative_pid;       /* process id starting at 1 */
index f149fc5..79b3cc1 100644 (file)
@@ -148,6 +148,12 @@ DECLARE_INIT_STAGES;
  */
 empty_t __read_mostly_align HA_SECTION("read_mostly") ALIGNED(64);
 
+#ifdef BUILD_FEATURES
+const char *build_features = BUILD_FEATURES;
+#else
+const char *build_features = "";
+#endif
+
 /* list of config files */
 static struct list cfg_cfgfiles = LIST_HEAD_INIT(cfg_cfgfiles);
 int  pid;                      /* current process id */