Skip to content

Commit 0ee84f9

Browse files
oech3oech3
authored andcommitted
build-gnu.sh: Use multicall to reduce build time (no selinux)
1 parent 58ebeaf commit 0ee84f9

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

util/build-gnu.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,22 @@ else
104104
fi
105105
cd -
106106

107+
[ "${SELINUX_ENABLED}" != 1 ] && export MULTICALL=y # Reduce time to build
107108
# Pass the feature flags to make, which will pass them to cargo
108109
"${MAKE}" PROFILE="${UU_MAKE_PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}"
109110
# min test for SELinux
110111
[ "${SELINUX_ENABLED}" = 1 ] && touch g && "${UU_MAKE_PROFILE}"/stat -c%C g && rm g
111-
112+
if [ "${MULTICALL}" = y ]; then
113+
for b in $(./coreutils --list)
114+
do cp -vf "${UU_BUILD_DIR}"/coreutils "${UU_BUILD_DIR}/${b}"
115+
done
116+
else
117+
cp "${UU_BUILD_DIR}"/test "${UU_BUILD_DIR}"/test/"["
118+
for b in {b2,md5}sum sha{1,224,256,384,512}sum
119+
do cp -vf "${UU_BUILD_DIR}"/hashsum "${UU_BUILD_DIR}/${b}"
120+
done
121+
fi
112122
cp "${UU_BUILD_DIR}/install" "${UU_BUILD_DIR}/ginstall" # The GNU tests rename this script before running, to avoid confusion with the make target
113-
# Create *sum binaries
114-
for sum in b2sum b3sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum; do
115-
sum_path="${UU_BUILD_DIR}/${sum}"
116-
test -f "${sum_path}" || (cd ${UU_BUILD_DIR} && ln -s "hashsum" "${sum}")
117-
done
118-
test -f "${UU_BUILD_DIR}/[" || (cd ${UU_BUILD_DIR} && ln -s "test" "[")
119123

120124
##
121125

0 commit comments

Comments
 (0)