summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-11-11 16:12:49 +0000
committerMike Frysinger <vapier@gentoo.org>2011-11-11 16:12:49 +0000
commit707ff23bcb7d395f7c99fbc4b31184161e0f19dd (patch)
treef0223f796ff9ff462598b38f77409ae0c027116e /sys-devel/gcc-config
parentStable for HPPA (bug #384227). (diff)
downloadgentoo-2-707ff23bcb7d395f7c99fbc4b31184161e0f19dd.tar.gz
gentoo-2-707ff23bcb7d395f7c99fbc4b31184161e0f19dd.tar.bz2
gentoo-2-707ff23bcb7d395f7c99fbc4b31184161e0f19dd.zip
Add a fallback when tac is unavailable as suggested by Alexis Ballier #390179.
(Portage version: 2.2.0_alpha72/cvs/Linux x86_64)
Diffstat (limited to 'sys-devel/gcc-config')
-rw-r--r--sys-devel/gcc-config/ChangeLog9
-rwxr-xr-xsys-devel/gcc-config/files/gcc-config-1.520
-rw-r--r--sys-devel/gcc-config/gcc-config-1.5-r2.ebuild61
3 files changed, 85 insertions, 5 deletions
diff --git a/sys-devel/gcc-config/ChangeLog b/sys-devel/gcc-config/ChangeLog
index 05ce166fb7ce..bfcdaab940ef 100644
--- a/sys-devel/gcc-config/ChangeLog
+++ b/sys-devel/gcc-config/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-devel/gcc-config
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/ChangeLog,v 1.196 2011/11/11 12:15:40 aballier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/ChangeLog,v 1.197 2011/11/11 16:12:49 vapier Exp $
+
+*gcc-config-1.5-r2 (11 Nov 2011)
+
+ 11 Nov 2011; Mike Frysinger <vapier@gentoo.org> files/gcc-config-1.5,
+ +gcc-config-1.5-r2.ebuild:
+ Add a fallback when tac is unavailable as suggested by Alexis Ballier
+ #390179.
11 Nov 2011; Alexis Ballier <aballier@gentoo.org> gcc-config-1.5-r1.ebuild:
unkeyword 1.5 on fbsd due to bug #390179
diff --git a/sys-devel/gcc-config/files/gcc-config-1.5 b/sys-devel/gcc-config/files/gcc-config-1.5
index 46e7b5c1511d..ae9e580e6462 100755
--- a/sys-devel/gcc-config/files/gcc-config-1.5
+++ b/sys-devel/gcc-config/files/gcc-config-1.5
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.5,v 1.5 2011/03/21 13:49:02 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.5,v 1.6 2011/11/11 16:12:49 vapier Exp $
# Format of /etc/env.d/gcc/:
# config-TARGET: CURRENT=version for TARGET
@@ -34,6 +34,11 @@ die_eerror() {
SED=$(type -P gsed)
: ${SED:=$(type -P sed)}
+# Further pain: `tac` is not available everywhere #390179
+if ! type -P tac >/dev/null ; then
+ tac() { ${SED} -e '1!G;h;$!d' "$@" ; }
+fi
+
GENTOO_LIBDIR="lib"
[[ ${GENTOO_LIBDIR} == @*@ ]] && GENTOO_LIBDIR="lib"
@@ -176,7 +181,14 @@ update_wrappers() {
[[ -e ${wrapper} ]] && break
done
- # Update the wrappers for this profile
+ # Update the wrappers for this profile. We maintain this list
+ # by hand as the tools that are available can come & go if the
+ # user re-emerges gcc with dif USE flags. We need to clean out
+ # the old wrappers if the functionality no longer exists.
+ # XXX: Future work: save the list of wrappers we generated in
+ # the generated env.d file so we can scrub things better.
+ # After that, we can use a dynamic list based on what tools are
+ # actually available in ${GCC_PATH}/.
for x in {,${CTARGET}-}{cpp,cc,gcc,c++,g++,f77,g77,gcj,gcjh,gcov,gdc,gdmd,gfortran,gccgo} ; do
# Obviously don't want to touch native stuff for cross-compilers
[[ ${x} != ${CTARGET}-* ]] && is_cross_compiler && continue
@@ -621,9 +633,9 @@ for x in "$@" ; do
rcsfile="$RCSfile: gcc-config-1.5,v $"
rcsfile=${rcsfile#: }
rcsfile=${rcsfile%,v*}
- cvsrev="$Revision: 1.5 $"
+ cvsrev="$Revision: 1.6 $"
cvsrev=${cvsrev#: }
- cvsdate="$Date: 2011/03/21 13:49:02 $"
+ cvsdate="$Date: 2011/11/11 16:12:49 $"
cvsdate=${cvsdate#: }
echo "${rcsfile} (r${cvsrev% *} @ ${cvsdate% *})"
exit 0
diff --git a/sys-devel/gcc-config/gcc-config-1.5-r2.ebuild b/sys-devel/gcc-config/gcc-config-1.5-r2.ebuild
new file mode 100644
index 000000000000..4e2e1a685a3e
--- /dev/null
+++ b/sys-devel/gcc-config/gcc-config-1.5-r2.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.5-r2.ebuild,v 1.1 2011/11/11 16:12:49 vapier Exp $
+
+inherit flag-o-matic toolchain-funcs multilib
+
+# Version of .c wrapper to use
+W_VER="1.5.2"
+
+DESCRIPTION="Utility to change the gcc compiler being used"
+HOMEPAGE="http://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="!app-admin/eselect-compiler"
+
+S=${WORKDIR}
+
+src_unpack() {
+ cp "${FILESDIR}"/wrapper-${W_VER}.c "${S}"/wrapper.c || die
+}
+
+src_compile() {
+ strip-flags
+ emake CC="$(tc-getCC)" wrapper || die "compile wrapper"
+}
+
+src_install() {
+ newbin "${FILESDIR}"/${PN}-${PV} ${PN} || die "install gcc-config"
+ sed -i \
+ -e "s:@GENTOO_LIBDIR@:$(get_libdir):g" \
+ "${D}"/usr/bin/${PN}
+
+ exeinto /usr/$(get_libdir)/misc
+ newexe wrapper gcc-config || die "install wrapper"
+}
+
+pkg_postinst() {
+ # Scrub eselect-compiler remains
+ if [[ -e ${ROOT}/etc/env.d/05compiler ]] ; then
+ rm -f "${ROOT}"/etc/env.d/05compiler
+ fi
+
+ # Make sure old versions dont exist #79062
+ rm -f "${ROOT}"/usr/sbin/gcc-config
+
+ # We not longer use the /usr/include/g++-v3 hacks, as
+ # it is not needed ...
+ [[ -L ${ROOT}/usr/include/g++ ]] && rm -f "${ROOT}"/usr/include/g++
+ [[ -L ${ROOT}/usr/include/g++-v3 ]] && rm -f "${ROOT}"/usr/include/g++-v3
+
+ # Do we have a valid multi ver setup ?
+ local x
+ for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
+ gcc-config ${x}
+ done
+}