jjb: Set libdir to 'lib64' on Redhat / SuSE based distros
[lttng-ci.git] / scripts / liburcu / build.sh
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
This page took 0.023329 seconds and 4 git commands to generate.