From 77503fc528bf4d36ff4da4d41596f8513fe7f5b5 Mon Sep 17 00:00:00 2001 From: Olivier Dion Date: Fri, 3 Feb 2023 15:29:53 -0500 Subject: [PATCH] Build feature: Add pre-inst-env script MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Jérémie Galarneau --- .gitignore | 1 + configure.ac | 1 + pre-inst-env.in | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 pre-inst-env.in diff --git a/.gitignore b/.gitignore index 827e00e01..24c2f03c7 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ stamp-h1 libtool tags /config/ +pre-inst-env .autotools .cproject diff --git a/configure.ac b/configure.ac index 187590476..11d931759 100644 --- a/configure.ac +++ b/configure.ac @@ -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 index 000000000..acc6e8a83 --- /dev/null +++ b/pre-inst-env.in @@ -0,0 +1,27 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (c) 2023 Olivier Dion + +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 "$@" -- 2.34.1