Rework how WORLD_FLAGS and KERNEL_FLAGS are set, to remove an

unnecessary expr(1) call.

Inspired by:	hrs (a few months ago)
MFC after:	1 week
X-MFC-With:	r262499, r262505
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Glen Barber 2014-02-26 01:06:41 +00:00
parent 5bcd30f3b1
commit 2e314957a9

View File

@ -64,11 +64,9 @@ SRC_CONF="/dev/null"
# The number of make(1) jobs, defaults to the number of CPUs available for # The number of make(1) jobs, defaults to the number of CPUs available for
# buildworld, and half of number of CPUs available for buildkernel. # buildworld, and half of number of CPUs available for buildkernel.
NCPU=$(sysctl -n hw.ncpu) WORLD_FLAGS="-j$(sysctl -n hw.ncpu)"
if [ ${NCPU} -gt 1 ]; then KERNEL_FLAGS="-j$(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2))"
WORLD_FLAGS="-j${NCPU}"
KERNEL_FLAGS="-j$(expr ${NCPU} / 2)"
fi
MAKE_FLAGS="-s" MAKE_FLAGS="-s"
# The name of the kernel to build, defaults to GENERIC. # The name of the kernel to build, defaults to GENERIC.