Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/
Date: Sun, 05 May 2019 08:16:02
Message-Id: 1557044145.66f46063dd050dce3335db6b9200dcaf64826ff2.grobian@gentoo
1 commit: 66f46063dd050dce3335db6b9200dcaf64826ff2
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 2 11:18:25 2019 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Sun May 5 08:15:45 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=66f46063
7
8 scripts/bootstrap-prefix: add initial FreeBSD support
9
10 This is mostly non-functional, since FreeBSD/Prefix profiles are
11 missing.
12
13 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
14
15 scripts/bootstrap-prefix.sh | 18 +++++++++++++++++-
16 1 file changed, 17 insertions(+), 1 deletion(-)
17
18 diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
19 index 4149f661f1..3c4f7dbde7 100755
20 --- a/scripts/bootstrap-prefix.sh
21 +++ b/scripts/bootstrap-prefix.sh
22 @@ -181,6 +181,9 @@ configure_toolchain() {
23 *-darwin*)
24 # handled below
25 ;;
26 + *-freebsd*)
27 + # comes with clang, handled below
28 + ;;
29 *)
30 # The host may not have a functioning c++ toolchain, so use a
31 # stage1 compiler that can build with C only.
32 @@ -318,6 +321,11 @@ configure_toolchain() {
33 sys-devel/llvm
34 sys-devel/clang"
35 ;;
36 + *-freebsd*)
37 + CC=clang
38 + CXX=clang++
39 + # TODO: target clang toolchain someday?
40 + ;;
41 *-solaris*)
42 local ccvers="$( (unset CHOST; gcc --version 2>/dev/null) )"
43 case "${ccvers}" in
44 @@ -2290,7 +2298,7 @@ EOF
45 esac
46
47 # TODO: should we better use cc here? or check both?
48 - if ! type -P gcc > /dev/null ; then
49 + if ! type -P gcc > /dev/null && ! type -P clang > /dev/null ; then
50 case "${CHOST}" in
51 *-darwin*)
52 cat << EOF
53 @@ -2420,6 +2428,7 @@ EOF
54 case "${CHOST}" in
55 *-cygwin*) ncpu=$(cmd /D /Q /C 'echo %NUMBER_OF_PROCESSORS%' | tr -d "\\r") ;;
56 *-darwin*) ncpu=$(/usr/sbin/sysctl -n hw.ncpu) ;;
57 + *-freebsd*) ncpu=$(/sbin/sysctl -n hw.ncpu) ;;
58 *-solaris*) ncpu=$(/usr/sbin/psrinfo | wc -l) ;;
59 *-linux-gnu*) ncpu=$(cat /proc/cpuinfo | grep processor | wc -l) ;;
60 *-aix*) ncpu=$(/usr/sbin/bindprocessor -q | cut -d: -f2 | wc -w) ;;
61 @@ -2925,6 +2934,13 @@ if [[ -z ${CHOST} ]]; then
62 CYGWIN*)
63 CHOST="`uname -m`-pc-cygwin"
64 ;;
65 + FreeBSD)
66 + case `uname -m` in
67 + amd64)
68 + CHOST="x86_64-pc-freebsd`uname -r | sed 's|-.*$||'`"
69 + ;;
70 + esac
71 + ;;
72 *)
73 eerror "Nothing known about platform `uname -s`."
74 eerror "Please set CHOST appropriately for your system"