+int ust_consumerd64_fd = -1;
+int ust_consumerd32_fd = -1;
+
+static const char *consumerd64_prog = "lttng-consumerd";
+static const char *consumerd32_prog = "lttng-consumerd";
+
+static const char *consumerd64_bindir =
+ __stringify(CONFIG_64BIT_BINDIR);
+static const char *consumerd32_bindir =
+ __stringify(CONFIG_32BIT_BINDIR);
+
+static
+void setup_consumerd_path(void)
+{
+ const char *bindir;
+
+ /*
+ * Allow INSTALL_BIN_PATH to be used as a target path for the
+ * native architecture size consumer if CONFIG_NBIT_BINDIR as
+ * not been defined.
+ */
+#if (CAA_BITS_PER_LONG == 64)
+ if (!consumerd64_bindir[0]) {
+ consumerd64_bindir = INSTALL_BIN_PATH;
+ }
+#elif (CAA_BITS_PER_LONG == 32)
+ if (!consumerd32_bindir[0]) {
+ consumerd32_bindir = INSTALL_BIN_PATH;
+ }
+#else
+#error "Unknown bitness"
+#endif
+
+ /*
+ * runtime env. var. overrides the build default.
+ */
+ bindir = getenv("LTTNG_TOOLS_64BIT_BINDIR");
+ if (bindir) {
+ consumerd64_bindir = bindir;
+ }
+ bindir = getenv("LTTNG_TOOLS_32BIT_BINDIR");
+ if (bindir) {
+ consumerd32_bindir = bindir;
+ }
+}
+