Skip to content

Commit 588cefa

Browse files
committed
build-gnu: install libstdbuf.so for GNU tests
1 parent 4556d29 commit 588cefa

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

util/build-gnu.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ else
100100
done
101101
fi
102102
[ -e "${UU_BUILD_DIR}/ginstall" ] || ln -vf "${UU_BUILD_DIR}/install" "${UU_BUILD_DIR}/ginstall" # The GNU tests use ginstall
103+
104+
# Install libstdbuf.so for stdbuf (required when feat_external_libstdbuf is enabled)
105+
LIBSTDBUF_DIR="${LIBSTDBUF_DIR:-/usr/local/libexec/coreutils}"
106+
if [ -w "${LIBSTDBUF_DIR}" ] || [ -w "$(dirname "${LIBSTDBUF_DIR}")" ]; then
107+
mkdir -p "${LIBSTDBUF_DIR}"
108+
cp -f "${UU_BUILD_DIR}/deps/libstdbuf.so" "${LIBSTDBUF_DIR}/"
109+
elif command -v sudo >/dev/null 2>&1; then
110+
sudo mkdir -p "${LIBSTDBUF_DIR}"
111+
sudo cp -f "${UU_BUILD_DIR}/deps/libstdbuf.so" "${LIBSTDBUF_DIR}/"
112+
fi
103113
##
104114

105115
cd "${path_GNU}" && echo "[ pwd:'${PWD}' ]"

0 commit comments

Comments
 (0)