mirror of
https://git.planet-casio.com/Lephenixnoir/sh-elf-gcc.git
synced 2024-12-29 13:03:39 +01:00
build: obtain number of cores in an OpenBSD-compliant way
This commit is contained in:
parent
b241b246ea
commit
49de34fe9e
1 changed files with 8 additions and 1 deletions
9
build.sh
9
build.sh
|
@ -6,6 +6,13 @@
|
||||||
source util.sh
|
source util.sh
|
||||||
cd build
|
cd build
|
||||||
|
|
||||||
|
# Number of processor cores
|
||||||
|
if [[ $(uname) == "OpenBSD" ]]; then
|
||||||
|
cores=$(sysctl -n hw.ncpu)
|
||||||
|
else
|
||||||
|
cores=$(nproc)
|
||||||
|
fi
|
||||||
|
|
||||||
echo "$TAG Compiling gcc (usually 10-20 minutes)..."
|
echo "$TAG Compiling gcc (usually 10-20 minutes)..."
|
||||||
run_quietly giteapc-build.log \
|
run_quietly giteapc-build.log \
|
||||||
make -j$(nproc) all-gcc all-target-libgcc
|
make -j"$cores" all-gcc all-target-libgcc
|
||||||
|
|
Loading…
Reference in a new issue