| 1 |
vapier |
1.1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
|
|
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
|
|
# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.5.1.ebuild,v 1.1 2012/02/29 20:16:56 vapier Exp $ |
| 4 |
|
|
|
| 5 |
|
|
inherit flag-o-matic toolchain-funcs multilib |
| 6 |
|
|
|
| 7 |
|
|
# Version of .c wrapper to use |
| 8 |
|
|
W_VER="1.5.2" |
| 9 |
|
|
|
| 10 |
|
|
DESCRIPTION="Utility to change the gcc compiler being used" |
| 11 |
|
|
HOMEPAGE="http://www.gentoo.org/" |
| 12 |
|
|
SRC_URI="" |
| 13 |
|
|
|
| 14 |
|
|
LICENSE="GPL-2" |
| 15 |
|
|
SLOT="0" |
| 16 |
|
|
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" |
| 17 |
|
|
IUSE="" |
| 18 |
|
|
|
| 19 |
|
|
RDEPEND="!app-admin/eselect-compiler" |
| 20 |
|
|
|
| 21 |
|
|
S=${WORKDIR} |
| 22 |
|
|
|
| 23 |
|
|
src_unpack() { |
| 24 |
|
|
cp "${FILESDIR}"/wrapper-${W_VER}.c "${S}"/wrapper.c || die |
| 25 |
|
|
} |
| 26 |
|
|
|
| 27 |
|
|
src_compile() { |
| 28 |
|
|
strip-flags |
| 29 |
|
|
emake CC="$(tc-getCC)" wrapper || die "compile wrapper" |
| 30 |
|
|
} |
| 31 |
|
|
|
| 32 |
|
|
src_install() { |
| 33 |
|
|
newbin "${FILESDIR}"/${PN}-${PV} ${PN} || die "install gcc-config" |
| 34 |
|
|
sed -i \ |
| 35 |
|
|
-e "s:@GENTOO_LIBDIR@:$(get_libdir):g" \ |
| 36 |
|
|
"${D}"/usr/bin/${PN} |
| 37 |
|
|
|
| 38 |
|
|
exeinto /usr/$(get_libdir)/misc |
| 39 |
|
|
newexe wrapper gcc-config || die "install wrapper" |
| 40 |
|
|
} |
| 41 |
|
|
|
| 42 |
|
|
pkg_postinst() { |
| 43 |
|
|
# Scrub eselect-compiler remains |
| 44 |
|
|
if [[ -e ${ROOT}/etc/env.d/05compiler ]] ; then |
| 45 |
|
|
rm -f "${ROOT}"/etc/env.d/05compiler |
| 46 |
|
|
fi |
| 47 |
|
|
|
| 48 |
|
|
# Make sure old versions dont exist #79062 |
| 49 |
|
|
rm -f "${ROOT}"/usr/sbin/gcc-config |
| 50 |
|
|
|
| 51 |
|
|
# We not longer use the /usr/include/g++-v3 hacks, as |
| 52 |
|
|
# it is not needed ... |
| 53 |
|
|
[[ -L ${ROOT}/usr/include/g++ ]] && rm -f "${ROOT}"/usr/include/g++ |
| 54 |
|
|
[[ -L ${ROOT}/usr/include/g++-v3 ]] && rm -f "${ROOT}"/usr/include/g++-v3 |
| 55 |
|
|
|
| 56 |
|
|
# Do we have a valid multi ver setup ? |
| 57 |
|
|
local x |
| 58 |
|
|
for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do |
| 59 |
|
|
gcc-config ${x} |
| 60 |
|
|
done |
| 61 |
|
|
} |