jjb: Set libdir to 'lib64' on Redhat / SuSE based distros
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 14 Mar 2023 15:34:12 +0000 (11:34 -0400)
committerMichael Jeanson <mjeanson@efficios.com>
Fri, 17 Mar 2023 18:51:26 +0000 (14:51 -0400)
Change-Id: Ifc72144de9335defdc138fdef5d90f6cb6d1199d
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
scripts/babeltrace/build.sh
scripts/liburcu/build.sh
scripts/lttng-tools/build.sh
scripts/lttng-ust/build.sh

index 1d03f72ab7b1811d26ad2fff7ace4d6e54f626cb..f6bc52d516e79e9c79360f46d458be5159b094ed 100755 (executable)
@@ -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
index bdec86a39437e83d861114a9c880346f5d5f6d12..390a7e9cd74ebbaa52b8266e9490a7d2fd9cfa97 100755 (executable)
@@ -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
index 80d207a02c07a3e9a7cc2a1b51d035e0463fe01d..577b835bc55261bd7284434491399fb92f66255d 100755 (executable)
@@ -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
index 0e7b5c774f14820b1f9962eae05adc652eb809de..f69d01880bc42860daef99ae45e8ddd14c4d9e5f 100755 (executable)
@@ -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
This page took 0.026685 seconds and 4 git commands to generate.