# shellcheck disable=SC2103
#
# Copyright (C) 2016 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
-# 2016-2019 Michael Jeanson <mjeanson@efficios.com>
+# Copyright (C) 2016-2020 Michael Jeanson <mjeanson@efficios.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
DEPS_INC="$WORKSPACE/deps/build/include"
DEPS_LIB="$WORKSPACE/deps/build/lib"
+DEPS_PKGCONFIG="$DEPS_LIB/pkgconfig"
DEPS_BIN="$WORKSPACE/deps/build/bin"
DEPS_JAVA="$WORKSPACE/deps/build/share/java"
export PATH="$DEPS_BIN:$PATH"
export LD_LIBRARY_PATH="$DEPS_LIB:${LD_LIBRARY_PATH:-}"
+export PKG_CONFIG_PATH="$DEPS_PKGCONFIG"
export CPPFLAGS="-I$DEPS_INC"
export LDFLAGS="-L$DEPS_LIB"
ln -sf "$TMPDIR" "$tmpdir"
export TMPDIR="$tmpdir"
+# Create a symlink to "babeltrace" when the "babeltrace2" executable is found.
+# This is a temporary workaround until lttng-tools either allows the override of
+# the trace reader in its test suite or that we move to only supporting
+# babeltrace2
+if [ -x "$DEPS_BIN/babeltrace2" ]; then
+ ln -s "$DEPS_BIN/babeltrace2" "$DEPS_BIN/babeltrace"
+fi
+
+# When using babeltrace2 make sure that it finds its plugins and
+# plugin-providers.
+export BABELTRACE_PLUGIN_PATH="$DEPS_LIB/babeltrace2/plugins/"
+export LIBBABELTRACE2_PLUGIN_PROVIDER_DIR="$DEPS_LIB/babeltrace2/plugin-providers/"
+
export CFLAGS="-g -O2"
# Set compiler variables
export PATH="/opt/csw/bin:/usr/ccs/bin:$PATH"
export CPPFLAGS="-I/opt/csw/include -D_XOPEN_SOURCE=500 $CPPFLAGS"
export LDFLAGS="-L/opt/csw/lib -R/opt/csw/lib $LDFLAGS"
- export PKG_CONFIG_PATH="/opt/csw/lib/pkgconfig"
+ export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/csw/lib/pkgconfig"
export PYTHON="python3"
export PYTHON_CONFIG="python3-config"
export MAKE=gmake
export TAR=gtar
export NPROC=nproc
- export PATH="$PATH:/usr/perl5/bin"
- export CPPFLAGS="-I/opt/csw/include -D_XOPEN_SOURCE=500 $CPPFLAGS"
- export LDFLAGS="-L/opt/csw/lib -R/opt/csw/lib $LDFLAGS"
+ export PATH="/opt/csw/bin:$PATH:/usr/perl5/bin"
+ export CPPFLAGS="-D_XOPEN_SOURCE=500 $CPPFLAGS"
export PYTHON="python3"
export PYTHON_CONFIG="python3-config"
+ export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/lib/pkgconfig"
RUN_TESTS="no"
;;
;;
esac
+# If we have modules, build them
+if [ -d "$WORKSPACE/src/lttng-modules" ]; then
+ cd "$WORKSPACE/src/lttng-modules"
+ $MAKE -j"$($NPROC)" V=1
+ $MAKE modules_install V=1
+ depmod
+fi
+
# Enter the source directory
cd "$SRCDIR"
# Most build configs require the python bindings
CONF_OPTS=("--prefix=$PREFIX" "--enable-python-bindings")
+DIST_CONF_OPTS=()
+
# Set configure options and environment variables for each build
# configuration.
case "$conf" in
no-ust)
echo "Build without UST support"
CONF_OPTS+=("$NO_UST")
+ DIST_CONF_OPTS+=("$NO_UST")
;;
agents)
# Run configure and generate the tar file
# in the source directory
- ./configure
+ ./configure "${DIST_CONF_OPTS[@]}"
$MAKE dist
# Create and enter a temporary build directory
cd "$builddir"
# Run configure out of tree and generate the tar file
- "$SRCDIR/configure"
+ "$SRCDIR/configure" "${DIST_CONF_OPTS[@]}"
$MAKE dist
dist_srcdir="$(mktemp -d)"