mirror of https://github.com/vitalif/phantomjs
Build system: do not assume 4 parallel jobs on Linux.
Try to grab the number of CPU cores from /proc/cpuinfo and use it as the number of parallel make jobs (limit to 8 as a safety measure). http://code.google.com/p/phantomjs/issues/detail?id=4541.6
parent
5a46423d28
commit
edc93dc8d0
20
build.sh
20
build.sh
|
@ -1,9 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
COMPILE_JOBS=4
|
||||
|
||||
QT_CFG=''
|
||||
|
||||
COMPILE_JOBS=1
|
||||
|
||||
if [[ $OSTYPE = darwin* ]]; then
|
||||
# We only support modern Mac machines, they are at least using
|
||||
# hyperthreaded dual-core CPU.
|
||||
COMPILE_JOBS=4
|
||||
else
|
||||
CPU_CORES=`grep -c ^processor /proc/cpuinfo`
|
||||
if [[ "$CPU_CORES" -gt 1 ]]; then
|
||||
COMPILE_JOBS=$CPU_CORES
|
||||
if [[ "$COMPILE_JOBS" -gt 8 ]]; then
|
||||
# Safety net.
|
||||
COMPILE_JOBS=8
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
until [ -z "$1" ]; do
|
||||
case $1 in
|
||||
"--qt-config")
|
||||
|
|
Loading…
Reference in New Issue