From: Michael Jeanson Date: Tue, 14 Mar 2023 15:34:12 +0000 (-0400) Subject: jjb: Set libdir to 'lib64' on Redhat / SuSE based distros X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4afa623f73af7733f14a52d4278b6e866d2cf352;p=lttng-ci.git jjb: Set libdir to 'lib64' on Redhat / SuSE based distros Change-Id: Ifc72144de9335defdc138fdef5d90f6cb6d1199d Signed-off-by: Michael Jeanson --- diff --git a/scripts/babeltrace/build.sh b/scripts/babeltrace/build.sh index 1d03f72..f6bc52d 100755 --- a/scripts/babeltrace/build.sh +++ b/scripts/babeltrace/build.sh @@ -105,6 +105,15 @@ BABELTRACE_RUN_TESTS="${BABELTRACE_RUN_TESTS:=yes}" SRCDIR="$WORKSPACE/src/babeltrace" TMPDIR="$WORKSPACE/tmp" 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 ) && ( "$(uname -m)" == "x86_64" ) ]]; then + LIBDIR_ARCH="${LIBDIR}64" +else + LIBDIR_ARCH="$LIBDIR" +fi # Create tmp directory rm -rf "$TMPDIR" @@ -199,7 +208,7 @@ export BABELTRACE_MINIMAL_LOG_LEVEL=TRACE # Set configure options and environment variables for each build # configuration. -CONF_OPTS=("--prefix=$PREFIX") +CONF_OPTS=("--prefix=$PREFIX" "--libdir=$PREFIX/$LIBDIR_ARCH") # -Werror is enabled by default in stable-2.0 but won't be in 2.1 # Explicitly disable it for consistency. @@ -370,10 +379,10 @@ $MAKE clean # Cleanup rpath in executables and shared libraries find "$WORKSPACE/$PREFIX/bin" -type f -perm -0500 -exec chrpath --delete {} \; -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 {} \; # Exit with failure if any of the tests failed exit $failed_tests diff --git a/scripts/liburcu/build.sh b/scripts/liburcu/build.sh index bdec86a..390a7e9 100755 --- a/scripts/liburcu/build.sh +++ b/scripts/liburcu/build.sh @@ -25,6 +25,8 @@ vercomp () { 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 @@ -95,6 +97,15 @@ USERSPACE_RCU_RUN_TESTS="${USERSPACE_RCU_RUN_TESTS:=yes}" SRCDIR="$WORKSPACE/src/liburcu" TMPDIR="$WORKSPACE/tmp" 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 ) && ( "$(uname -m)" == "x86_64" ) ]]; then + LIBDIR_ARCH="${LIBDIR}64" +else + LIBDIR_ARCH="$LIBDIR" +fi # Create tmp directory rm -rf "$TMPDIR" @@ -181,7 +192,7 @@ PACKAGE_VERSION=${PACKAGE_VERSION//\-pre*/} # Set configure options and environment variables for each build # configuration. -CONF_OPTS=("--prefix=$PREFIX") +CONF_OPTS=("--prefix=$PREFIX" "--libdir=$PREFIX/$LIBDIR_ARCH") case "$conf" in static) echo "Static lib only configuration" @@ -318,10 +329,10 @@ $MAKE clean # Cleanup rpath in executables and shared libraries #find "$WORKSPACE/$PREFIX/bin" -type f -perm -0500 -exec chrpath --delete {} \; -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 {} \; # Exit with failure if any of the tests failed exit $failed_tests diff --git a/scripts/lttng-tools/build.sh b/scripts/lttng-tools/build.sh index 80d207a..577b835 100755 --- a/scripts/lttng-tools/build.sh +++ b/scripts/lttng-tools/build.sh @@ -26,6 +26,8 @@ vercomp () { 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 @@ -109,8 +111,21 @@ build=${build:-} 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 ) && ( "$(uname -m)" == "x86_64" ) ]]; then + LIBDIR_ARCH="${LIBDIR}64" +else + LIBDIR_ARCH="$LIBDIR" +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" @@ -121,10 +136,6 @@ export PKG_CONFIG_PATH="$DEPS_PKGCONFIG" 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" @@ -250,11 +261,17 @@ cygwin|cygwin64|msys32|msys64) 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. @@ -309,7 +326,7 @@ else 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=() @@ -507,11 +524,11 @@ $MAKE clean 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 diff --git a/scripts/lttng-ust/build.sh b/scripts/lttng-ust/build.sh index 0e7b5c7..f69d018 100755 --- a/scripts/lttng-ust/build.sh +++ b/scripts/lttng-ust/build.sh @@ -25,6 +25,8 @@ vercomp () { 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 @@ -92,8 +94,21 @@ cc=${cc:-} # Controls if the tests are run LTTNG_UST_RUN_TESTS="${LTTNG_UST_RUN_TESTS:=yes}" +SRCDIR="$WORKSPACE/src/lttng-ust" +TMPDIR="$WORKSPACE/tmp" +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 ) && ( "$(uname -m)" == "x86_64" ) ]]; then + LIBDIR_ARCH="${LIBDIR}64" +else + LIBDIR_ARCH="$LIBDIR" +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" @@ -103,10 +118,6 @@ export PKG_CONFIG_PATH="$DEPS_PKGCONFIG" export CPPFLAGS="-I$DEPS_INC" export LDFLAGS="-L$DEPS_LIB" -SRCDIR="$WORKSPACE/src/lttng-ust" -TMPDIR="$WORKSPACE/tmp" -PREFIX="/build" - # Create tmp directory rm -rf "$TMPDIR" mkdir -p "$TMPDIR" @@ -193,7 +204,7 @@ fi # Set configure options and environment variables for each build # configuration. -CONF_OPTS=("--prefix=$PREFIX") +CONF_OPTS=("--prefix=$PREFIX" "--libdir=$PREFIX/$LIBDIR_ARCH") case "$conf" in static) echo "Static lib only configuration" @@ -326,10 +337,10 @@ $MAKE clean # Cleanup rpath in executables and shared libraries #find "$WORKSPACE/$PREFIX/bin" -type f -perm -0500 -exec chrpath --delete {} \; -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 {} \; # Exit with failure if any of the tests failed exit $failed_tests