Skip to content

Commit 277d6bf

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

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}"
110+
if [ "${MULTICALL}" = y ]; then
111+
for b in $(./coreutils --list)
112+
do cp -vf "${UU_BUILD_DIR}"/coreutils "${UU_BUILD_DIR}/${b}"
113+
done
114+
else
115+
cp "${UU_BUILD_DIR}"/test "${UU_BUILD_DIR}"/test/'['
116+
for b in {b2,md5}sum sha{1,224,256,384,512}sum
117+
do cp -vf "${UU_BUILD_DIR}"/hashsum "${UU_BUILD_DIR}/${b}"
118+
done
119+
fi
109120
# min test for SELinux
110121
[ "${SELINUX_ENABLED}" = 1 ] && touch g && "${UU_MAKE_PROFILE}"/stat -c%C g && rm g
111-
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)