blob: 820565725445849eb6334d3b2b8ec9ecf259f029 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
#!/bin/sh
# Copyright 2009-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
SITEDIR="@SITEDIR@"
config_site_arch() {
local host="${CHOST%%-*}"
case ${host} in
arm*b*) host=armeb ;;
arm*) host=arm ;;
mips*l*) host=mipsel ;;
mips*) host=mips ;;
esac
echo "${host}"
}
config_site_names() {
local site_arch="$(config_site_arch)"
local sites=""
local x
case ${CHOST} in
*-linux-*) sites="${sites} linux ${site_arch}-linux" ;;
*-darwin*) sites="${sites} darwin ${site_arch}-darwin" ;;
mingw*|*-mingw*) sites="${sites} mingw ${site_arch}-mingw" ;;
esac
case ${CHOST} in
*-linux-uclibc*) sites="${sites} linux-uclibc ${site_arch}-linux-uclibc" ;;
*-linux-gnu*) sites="${sites} linux-gnu ${site_arch}-linux-gnu" ;;
*-linux-musl*) sites="${sites} linux-musl ${site_arch}-linux-musl" ;;
esac
case ${CHOST} in
*-linux-uclibceabi*) sites="${sites} linux-uclibceabi ${site_arch}-linux-uclibceabi" ;;
*-linux-gnueabi*) sites="${sites} linux-gnueabi ${site_arch}-linux-gnueabi" ;;
esac
for x in ${sites} ${CHOST}; do
[ -e "${SITEDIR}/${x}" ] && echo "${SITEDIR}/${x}"
done
}
# Only kick in for cross-compiles so we don't break native builds #427184
if [ "${CBUILD:-${CHOST}}" != "${CHOST}" ] ; then
sites="$(config_site_names)"
if [ -n "${sites}" ] ; then
for site in ${sites}; do
echo "${0##*/}: loading site script ${site}"
. "${site}"
done
fi
unset site sites
fi
|