blob: 2dfb32856eb2a2866ddfddef502c000e104295a3 (
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
58
59
60
61
62
63
64
65
66
67
68
69
|
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit multilib
DESCRIPTION="Wrappers for gcc tools to be used on non-native CHOSTs"
HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
SRC_URI=""
S=${WORKDIR}
LICENSE="public-domain"
SLOT="0"
KEYWORDS="amd64"
IUSE=""
RDEPEND="sys-devel/gcc:="
src_install() {
local host_prefix=${CHOST}
# stolen from sys-devel/gcc-config
# TODO: check if all of them actually support $(get_ABI_CFLAGS)
local tools=(
cpp cc gcc c++ g++ f77 g77 gcj gcjh gdc gdmd gfortran gccgo
)
cd "${ESYSROOT}"/usr/bin || die
shopt -s nullglob
# same as toolchain.eclass
: ${TARGET_DEFAULT_ABI:=${DEFAULT_ABI}}
: ${TARGET_MULTILIB_ABIS:=${MULTILIB_ABIS}}
local ABI t e
for ABI in $(get_all_abis TARGET); do
[[ ${ABI} == ${TARGET_DEFAULT_ABI} ]] && continue
einfo "Creating wrappers for ${ABI} ..."
for t in "${tools[@]}"; do
# look for both plain *-gcc and e.g. *-gcc-4.8.3
# (but avoid *-gcc-nm)
# note: nullglob applied above
for e in ${host_prefix}[-]${t}{,-[0-9]*}; do
local newname=$(get_abi_CHOST)-${e#${host_prefix}-}
einfo " ${newname}"
newbin - "${newname}" <<-_EOF_
#!${EPREFIX}/bin/sh
exec ${e} $(get_abi_CFLAGS) "\${@}"
_EOF_
done
done
done
shopt -u nullglob
}
pkg_postinst() {
if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
eselect compiler-shadow update all
fi
}
pkg_postrm() {
if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
eselect compiler-shadow clean all
fi
}
|