Skip to content

Commit

Permalink
MinGW host will now support multi-core processors.
Browse files Browse the repository at this point in the history
As nproc is not implemented by MinGW, the number of processors is obtained
from the NUMBER_OF_PROCESSORS environmental variable.
On the other hand, Cygwin seems to support nproc.
  • Loading branch information
sp193 committed Oct 18, 2018
1 parent b8648ee commit 03e6562
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
5 changes: 3 additions & 2 deletions scripts/001-binutils-2.14.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ cat ../../patches/binutils-$BINUTILS_VERSION-disable-makeinfo-when-texinfo-is-to
cat ../../patches/binutils-gas.patch | patch -p0 || { exit 1; }

## Determine the maximum number of processes that Make can work with.
## MinGW's Make doesn't work properly with multi-core processors.
OSVER=$(uname)
if [ ${OSVER:0:10} == MINGW32_NT ]; then
PROC_NR=2
PROC_NR=$NUMBER_OF_PROCESSORS
elif [ ${OSVER:0:6} == Darwin ]; then
PROC_NR=$(sysctl -n hw.ncpu)
else
PROC_NR=$(nproc)
fi

echo "Building with $PROC_NR jobs"

## For each target...
for TARGET in "ee" "iop" "dvp"; do
## Create and enter the build directory.
Expand Down
5 changes: 3 additions & 2 deletions scripts/002-gcc-3.2.3-stage1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ else
fi

## Determine the maximum number of processes that Make can work with.
## MinGW's Make doesn't work properly with multi-core processors.
if [ ${OSVER:0:10} == MINGW32_NT ]; then
PROC_NR=2
PROC_NR=$NUMBER_OF_PROCESSORS
elif [ ${OSVER:0:6} == Darwin ]; then
PROC_NR=$(sysctl -n hw.ncpu)
else
PROC_NR=$(nproc)
fi

echo "Building with $PROC_NR jobs"

## For each target...
for TARGET in "ee" "iop"; do
## Create and enter the build directory.
Expand Down
3 changes: 1 addition & 2 deletions scripts/003-newlib-1.10.0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ if [ -e ../../patches/newlib-$NEWLIB_VERSION-PS2.patch ]; then
fi

## Determine the maximum number of processes that Make can work with.
## MinGW's Make doesn't work properly with multi-core processors.
OSVER=$(uname)
if [ ${OSVER:0:10} == MINGW32_NT ]; then
PROC_NR=2
PROC_NR=$NUMBER_OF_PROCESSORS
elif [ ${OSVER:0:6} == Darwin ]; then
PROC_NR=$(sysctl -n hw.ncpu)
else
Expand Down
6 changes: 4 additions & 2 deletions scripts/004-gcc-3.2.3-stage2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@ else
TARG_XTRA_OPTS="--enable-cxx-flags=-G0"
fi

## OS Windows doesn't properly work with multi-core processors
## Determine the maximum number of processes that Make can work with.
if [ ${OSVER:0:10} == MINGW32_NT ]; then
PROC_NR=2
PROC_NR=$NUMBER_OF_PROCESSORS
elif [ ${OSVER:0:6} == Darwin ]; then
PROC_NR=$(sysctl -n hw.ncpu)
else
PROC_NR=$(nproc)
fi

echo "Building with $PROC_NR jobs"

TARGET="ee"
## Create and enter the build directory.
mkdir build-$TARGET-stage2 && cd build-$TARGET-stage2 || { exit 1; }
Expand Down
3 changes: 1 addition & 2 deletions scripts/005-ps2sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ else
fi

## Determine the maximum number of processes that Make can work with.
## MinGW's Make doesn't work properly with multi-core processors.
OSVER=$(uname)
if [ ${OSVER:0:10} == MINGW32_NT ]; then
PROC_NR=2
PROC_NR=$NUMBER_OF_PROCESSORS
elif [ ${OSVER:0:6} == Darwin ]; then
PROC_NR=$(sysctl -n hw.ncpu)
else
Expand Down

0 comments on commit 03e6562

Please sign in to comment.