Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/
Date: Wed, 29 Jun 2022 16:28:16
Message-Id: 1656520084.21de97a13101b3195ee0acf8d9652d2471fe7d23.sam@gentoo
1 commit: 21de97a13101b3195ee0acf8d9652d2471fe7d23
2 Author: Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
3 AuthorDate: Sat Jun 4 04:20:13 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 29 16:28:04 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=21de97a1
7
8 scripts/bootstrap-prefix.sh: enable ncpu detection for OpenBSD
9
10 Signed-off-by: Anna Vyalkova <cyber+gentoo <AT> sysrq.in>
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 scripts/bootstrap-prefix.sh | 18 ++++++++++++------
14 1 file changed, 12 insertions(+), 6 deletions(-)
15
16 diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
17 index 906ce86bc7..c7de6d7ec7 100755
18 --- a/scripts/bootstrap-prefix.sh
19 +++ b/scripts/bootstrap-prefix.sh
20 @@ -2632,12 +2632,18 @@ EOF
21 echo
22 local ncpu=
23 case "${CHOST}" in
24 - *-cygwin*) ncpu=$(cmd /D /Q /C 'echo %NUMBER_OF_PROCESSORS%' | tr -d "\\r") ;;
25 - *-darwin*) ncpu=$(/usr/sbin/sysctl -n hw.ncpu) ;;
26 - *-freebsd*) ncpu=$(/sbin/sysctl -n hw.ncpu) ;;
27 - *-solaris*) ncpu=$(/usr/sbin/psrinfo | wc -l) ;;
28 - *-linux-gnu*) ncpu=$(cat /proc/cpuinfo | grep processor | wc -l) ;;
29 - *) ncpu=1 ;;
30 + *-cygwin*)
31 + ncpu=$(cmd /D /Q /C 'echo %NUMBER_OF_PROCESSORS%' | tr -d "\\r") ;;
32 + *-darwin*)
33 + ncpu=$(/usr/sbin/sysctl -n hw.ncpu) ;;
34 + *-freebsd* | *-openbsd*)
35 + ncpu=$(/sbin/sysctl -n hw.ncpu) ;;
36 + *-solaris*)
37 + ncpu=$(/usr/sbin/psrinfo | wc -l) ;;
38 + *-linux-gnu*)
39 + ncpu=$(cat /proc/cpuinfo | grep processor | wc -l) ;;
40 + *)
41 + ncpu=1 ;;
42 esac
43 # get rid of excess spaces (at least Solaris wc does)
44 ncpu=$((ncpu + 0))