return 0
fi
local IFS=.
+ # Ignore the shellcheck warning, we want splitting to happen based on IFS.
+ # shellcheck disable=SC2206
local i ver1=($1) ver2=($2)
# fill empty fields in ver1 with zeros
for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)); do
cc=${cc:-}
test_type=${test_type:-}
+SRCDIR="$WORKSPACE/src/lttng-tools"
+TAPDIR="$WORKSPACE/tap"
+PREFIX="/build"
+LIBDIR="lib"
+
+# RHEL and SLES both use lib64 but don't bother shipping a default autoconf
+# site config that matches this.
+if [[ ( -f /etc/redhat-release || -f /etc/SuSE-release || -f /etc/yocto-release ) ]]; then
+ # Detect the userspace bitness in a distro agnostic way
+ if file -L /bin/bash | grep '64-bit' >/dev/null 2>&1; then
+ LIBDIR_ARCH="${LIBDIR}64"
+ else
+ LIBDIR_ARCH="$LIBDIR"
+ fi
+fi
+
DEPS_INC="$WORKSPACE/deps/build/include"
-DEPS_LIB="$WORKSPACE/deps/build/lib"
+DEPS_LIB="$WORKSPACE/deps/build/$LIBDIR_ARCH"
DEPS_PKGCONFIG="$DEPS_LIB/pkgconfig"
DEPS_BIN="$WORKSPACE/deps/build/bin"
DEPS_JAVA="$WORKSPACE/deps/build/share/java"
export CPPFLAGS="-I$DEPS_INC"
export LDFLAGS="-L$DEPS_LIB"
-SRCDIR="$WORKSPACE/src/lttng-tools"
-TAPDIR="$WORKSPACE/tap"
-PREFIX="/build"
-
# Create tmp directory
TMPDIR="$WORKSPACE/tmp"
if command -v $PYTHON2 >/dev/null 2>&1; then
P2_VERSION=$($PYTHON2 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))')
- DEPS_PYTHON2="$WORKSPACE/deps/build/lib/python$P2_VERSION/site-packages"
+ DEPS_PYTHON2="$WORKSPACE/deps/build/$LIBDIR/python$P2_VERSION/site-packages"
+ if [ "$LIBDIR" != "$LIBDIR_ARCH" ]; then
+ DEPS_PYTHON2="$DEPS_PYTHON2:$WORKSPACE/deps/build/$LIBDIR_ARCH/python$P2_VERSION/site-packages"
+ fi
fi
P3_VERSION=$($PYTHON3 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))')
- DEPS_PYTHON3="$WORKSPACE/deps/build/lib/python$P3_VERSION/site-packages"
+ DEPS_PYTHON3="$WORKSPACE/deps/build/$LIBDIR/python$P3_VERSION/site-packages"
+ if [ "$LIBDIR" != "$LIBDIR_ARCH" ]; then
+ DEPS_PYTHON3="$DEPS_PYTHON3:$WORKSPACE/deps/build/$LIBDIR_ARCH/python$P3_VERSION/site-packages"
+ fi
# Most build configs require access to the babeltrace 2 python bindings.
# This also makes the lttngust python agent available for `agents` builds.
esac
# The missing-field-initializers warning code is very dumb in GCC 4.8 on
-# SLES12, disable it even if it's available.
-if [[ $platform = sles12sp5* ]]; then
+# SLES12 / EL7, disable it even if it's available.
+if [[ $platform = sles12sp5* ]] || [[ $platform = el7* ]]; then
CFLAGS="$CFLAGS -Wno-missing-field-initializers"
CXXFLAGS="$CXXFLAGS -Wno-missing-field-initializers"
fi
fi
# Most build configs require the python bindings
-CONF_OPTS=("--prefix=$PREFIX" "--enable-python-bindings")
+CONF_OPTS=("--prefix=$PREFIX" "--libdir=$PREFIX/$LIBDIR_ARCH" "--enable-python-bindings")
DIST_CONF_OPTS=()
*)
echo "Standard configuration"
+
+ # Something is broken in docbook-xml on yocto
+ if [[ "$platform" = yocto* ]]; then
+ CONF_OPTS+=("--disable-man-pages")
+ fi
;;
esac
find "$WORKSPACE/$PREFIX/bin" -type f -perm -0500 -exec chrpath --delete {} \;
# Some configs don't build liblttng-ctl
-if [ -d "$WORKSPACE/$PREFIX/lib" ]; then
+if [ -d "$WORKSPACE/$PREFIX/$LIBDIR_ARCH" ]; then
# Cleanup rpath in shared libraries
- find "$WORKSPACE/$PREFIX/lib" -name "*.so" -exec chrpath --delete {} \;
+ find "$WORKSPACE/$PREFIX/$LIBDIR_ARCH" -name "*.so" -exec chrpath --delete {} \;
# Remove libtool .la files
- find "$WORKSPACE/$PREFIX/lib" -name "*.la" -exec rm -f {} \;
+ find "$WORKSPACE/$PREFIX/$LIBDIR_ARCH" -name "*.la" -exec rm -f {} \;
fi
# Exit with failure if any of the tests failed