Build feature: Add pre-inst-env script
authorOlivier Dion <odion@efficios.com>
Fri, 3 Feb 2023 20:29:53 +0000 (15:29 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 15 Feb 2023 22:03:16 +0000 (17:03 -0500)
This script setup environment variables for running compiled binaries
from the project without having to install them.

Usage example:

  $ ./pre-inst-env lttng create

Change-Id: Ie7839f32cfdc32103db035e2189b6f8a4c5cabe4
Signed-off-by: Olivier Dion <odion@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
.gitignore
configure.ac
pre-inst-env.in [new file with mode: 0644]

index 827e00e0158552fcdd6394bc30b479cf4a33575f..24c2f03c73800d8d99d35ce4e9c17cb567c5cf36 100644 (file)
@@ -31,6 +31,7 @@ stamp-h1
 libtool
 tags
 /config/
+pre-inst-env
 
 .autotools
 .cproject
index 18759047679e1050c6f4e3e918537f4d675fe56e..11d931759506db928a0fdcb82bb627844947af58 100644 (file)
@@ -1292,6 +1292,7 @@ AC_CONFIG_FILES([tests/regression/ust/python-logging/test_python_logging],[chmod
 # Inject LTTNG_TOOLS_BUILD_WITH_LIBPFM variable in test script.
 AC_CONFIG_FILES([tests/perf/test_perf_raw],[chmod +x tests/perf/test_perf_raw])
 AC_CONFIG_FILES([tests/regression/ust/ust-dl/test_ust-dl],[chmod +x tests/regression/ust/ust-dl/test_ust-dl])
+AC_CONFIG_FILES([pre-inst-env],[chmod +x pre-inst-env])
 
 AC_OUTPUT
 
diff --git a/pre-inst-env.in b/pre-inst-env.in
new file mode 100644 (file)
index 0000000..acc6e8a
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Copyright (c) 2023 Olivier Dion <odion@efficios.com>
+
+srcdir=$(realpath "@abs_top_srcdir@")
+builddir=$(realpath "@abs_top_builddir@")
+bin="$builddir/src/bin"
+
+# lttng-sessiond setup.
+LTTNG_SESSION_CONFIG_XSD_PATH="$srcdir/src/common"
+export LTTNG_SESSION_CONFIG_XSD_PATH
+
+LTTNG_CONSUMERD32_BIN="$bin/lttng-consumerd/lttng-consumerd"
+LTTNG_CONSUMERD64_BIN="$bin/lttng-consumerd/lttng-consumerd"
+export LTTNG_CONSUMERD32_BIN
+export LTTNG_CONSUMERD64_BIN
+
+# lttng-create setup.
+LTTNG_SESSIOND_PATH="$bin/lttng-sessiond/lttng-sessiond"
+export LTTNG_SESSIOND_PATH
+
+# Easy access to binaries.
+PATH="$bin/lttng:$bin/lttng-consumerd:$bin/lttng-crash:$bin/lttng-relayd:$bin/lttng-sessiond:$PATH"
+export PATH
+
+exec "$@"
This page took 0.02845 seconds and 4 git commands to generate.