mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:07:46 +00:00
Toolchain: Replace inline nproc with get_number_of_processing_units()
This commit is contained in:
parent
36c892ae14
commit
50413c2326
8 changed files with 17 additions and 55 deletions
|
@ -11,18 +11,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|||
|
||||
exit_if_running_as_root "Do not run BuildMold.sh as root, parts of your Toolchain directory will become root-owned"
|
||||
|
||||
NPROC="nproc"
|
||||
SYSTEM_NAME="$(uname -s)"
|
||||
|
||||
if [ "$SYSTEM_NAME" = "OpenBSD" ]; then
|
||||
NPROC="sysctl -n hw.ncpuonline"
|
||||
elif [ "$SYSTEM_NAME" = "FreeBSD" ]; then
|
||||
NPROC="sysctl -n hw.ncpu"
|
||||
elif [ "$SYSTEM_NAME" = "Darwin" ]; then
|
||||
NPROC="sysctl -n hw.ncpu"
|
||||
fi
|
||||
|
||||
[ -z "$MAKEJOBS" ] && MAKEJOBS=$($NPROC)
|
||||
NPROC=$(get_number_of_processing_units)
|
||||
[ -z "$MAKEJOBS" ] && MAKEJOBS=${NPROC}
|
||||
|
||||
mkdir -p "$DIR"/Tarballs
|
||||
pushd "$DIR"/Tarballs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue