X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=scripts%2Flttng-tools%2Fbuild.sh;h=b44dd2c82098f470440890973a9ce5fed8b77288;hb=4d27af8f99434c6dcadf1d22430d4e8a27b8bee2;hp=afa8b8cc6e40e8fa5bbe2c163b0983d51950d249;hpb=09d45745e001bfa7e2d8b7e6a1b960c76a49308b;p=lttng-ci.git diff --git a/scripts/lttng-tools/build.sh b/scripts/lttng-tools/build.sh index afa8b8c..b44dd2c 100755 --- a/scripts/lttng-tools/build.sh +++ b/scripts/lttng-tools/build.sh @@ -2,7 +2,7 @@ # shellcheck disable=SC2103 # # Copyright (C) 2016 Jonathan Rajotte-Julien -# 2016-2019 Michael Jeanson +# Copyright (C) 2016-2020 Michael Jeanson # # 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 @@ -81,11 +81,13 @@ test_type=${test_type:-} 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" @@ -105,6 +107,19 @@ tmpdir="$(mktemp)" 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 @@ -178,7 +193,7 @@ sol10-i386) 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" @@ -189,11 +204,11 @@ sol11-i386) 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" ;; @@ -246,6 +261,14 @@ full) ;; 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" @@ -267,6 +290,8 @@ fi # 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 @@ -279,6 +304,7 @@ static) no-ust) echo "Build without UST support" CONF_OPTS+=("$NO_UST") + DIST_CONF_OPTS+=("$NO_UST") ;; agents) @@ -332,7 +358,7 @@ dist) # 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 @@ -355,7 +381,7 @@ oot-dist) 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)"