#!/bin/sh # Copyright 2009-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 TOPDIR=__TOPDIR__ 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" ;; esac case ${CHOST} in *-linux-uclibc*) sites="${sites} linux-uclibc ${site_arch}-linux-uclibc" ;; *-linux-gnu*) sites="${sites} linux-gnu ${site_arch}-linux-gnu" ;; 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 "${TOPDIR}/${x}" ] && echo "${TOPDIR}/${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