+# 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
+case "$cc" in
+gcc)
+ export CC=gcc
+ export CXX=g++
+ ;;
+gcc-4.8)
+ export CC=gcc-4.8
+ export CXX=g++-4.8
+ ;;
+gcc-5)
+ export CC=gcc-5
+ export CXX=g++-5
+ ;;
+gcc-6)
+ export CC=gcc-6
+ export CXX=g++-6
+ ;;
+gcc-7)
+ export CC=gcc-7
+ export CXX=g++-7
+ ;;
+gcc-8)
+ export CC=gcc-8
+ export CXX=g++-8
+ ;;
+clang)
+ export CC=clang
+ export CXX=clang++
+ ;;
+clang-3.9)
+ export CC=clang-3.9
+ export CXX=clang++-3.9
+ ;;
+clang-4.0)
+ export CC=clang-4.0
+ export CXX=clang++-4.0
+ ;;
+clang-5.0)
+ export CC=clang-5.0
+ export CXX=clang++-5.0
+ ;;
+clang-6.0)
+ export CC=clang-6.0
+ export CXX=clang++-6.0
+ ;;
+clang-7)
+ export CC=clang-7
+ export CXX=clang++-7
+ ;;
+*)
+ if [ "x$cc" != "x" ]; then
+ export CC="$cc"
+ fi
+ ;;
+esac
+
+if [ "x${CC:-}" != "x" ]; then
+ echo "Selected compiler:"
+ "$CC" -v
+fi
+
+# Set platform variables
+case "$arch" in
+sol10-i386)
+ export MAKE=gmake
+ export TAR=gtar
+ export NPROC=gnproc
+ 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 PYTHON="python3"
+ export PYTHON_CONFIG="python3-config"
+
+ RUN_TESTS="no"
+ ;;
+
+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 PYTHON="python3"
+ export PYTHON_CONFIG="python3-config"
+
+ RUN_TESTS="no"
+ ;;
+
+macosx)
+ export MAKE=make
+ export TAR=tar
+ export NPROC="getconf _NPROCESSORS_ONLN"
+ export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
+ export CPPFLAGS="-I/opt/local/include $CPPFLAGS"
+ export LDFLAGS="-L/opt/local/lib $LDFLAGS"
+ export PYTHON="python3"
+ export PYTHON_CONFIG="python3-config"
+
+ RUN_TESTS="no"
+ ;;
+
+cygwin|cygwin64|msys32|msys64)
+ export MAKE=make
+ export TAR=tar
+ export NPROC=nproc
+
+ RUN_TESTS="no"
+ ;;
+
+*)
+ export MAKE=make
+ export TAR=tar
+ export NPROC=nproc
+
+ RUN_TESTS="yes"
+
+ PYTHON2=python2
+ PYTHON3=python3
+
+ P2_VERSION=$($PYTHON2 -c "import sys;print(sys.version[:3])")
+ P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])")
+
+ DEPS_PYTHON2="$WORKSPACE/deps/build/lib/python$P2_VERSION/site-packages"
+ DEPS_PYTHON3="$WORKSPACE/deps/build/lib/python$P3_VERSION/site-packages"
+ ;;
+esac
+
+case "$test_type" in
+full)
+ RUN_TESTS_LONG_REGRESSION="yes"
+ ;;
+*)
+ RUN_TESTS_LONG_REGRESSION="no"
+ ;;
+esac
+
+# Enter the source directory
+cd "$SRCDIR"
+
+# Run bootstrap in the source directory prior to configure