diff options
author | 2004-02-08 16:52:01 +0000 | |
---|---|---|
committer | 2004-02-08 16:52:01 +0000 | |
commit | 64529ac2ccc1e5cfef377dc16c7f87f0a200c6f0 (patch) | |
tree | cb94320cf626440c1f5ece9790478cbbb2f06970 /sys-devel/gcc-config/gcc-config-1.3.5.ebuild | |
parent | Fixed an error in the patch- it would never affect us, but should be fixed an... (diff) | |
download | gentoo-2-64529ac2ccc1e5cfef377dc16c7f87f0a200c6f0.tar.gz gentoo-2-64529ac2ccc1e5cfef377dc16c7f87f0a200c6f0.tar.bz2 gentoo-2-64529ac2ccc1e5cfef377dc16c7f87f0a200c6f0.zip |
Update wrapper to also treat symlinks as valid targets - this fixes a problem
where -gcc called the symlink, and not the proper binary. Also fix a few
issues where we used data->tmp as they can cause possible corruption when used
in recursive calls and child functions. Closes bug #39162.
Diffstat (limited to 'sys-devel/gcc-config/gcc-config-1.3.5.ebuild')
-rw-r--r-- | sys-devel/gcc-config/gcc-config-1.3.5.ebuild | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/sys-devel/gcc-config/gcc-config-1.3.5.ebuild b/sys-devel/gcc-config/gcc-config-1.3.5.ebuild new file mode 100644 index 000000000000..12da40e3d1c5 --- /dev/null +++ b/sys-devel/gcc-config/gcc-config-1.3.5.ebuild @@ -0,0 +1,92 @@ +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.3.5.ebuild,v 1.1 2004/02/08 16:52:01 azarah Exp $ + +IUSE= + +W_VER="1.4.2" + +DISABLE_GEN_GCC_WRAPPERS="yes" + +S="${WORKDIR}/${P}" +DESCRIPTION="Utility to change the gcc compiler being used." +SRC_URI="" +HOMEPAGE="http://www.gentoo.org/" + +KEYWORDS="~amd64 ~x86 ~ppc ~sparc ~alpha ~mips ~hppa ~arm ~ia64 ~ppc64" +SLOT="0" +LICENSE="GPL-2" + +DEPEND="virtual/glibc + >=sys-apps/portage-2.0.47-r10" # We need portageq ... + + +src_install() { + + # Setup PATH just in case ... + if /usr/bin/gcc-config --get-current-profile &> /dev/null + then + if [ -x /usr/bin/gcc-config ] + then + export PATH="`/usr/bin/gcc-config --get-bin-path`:${PATH}" + else + export PATH="`/usr/sbin/gcc-config --get-bin-path`:${PATH}" + fi + fi + + einfo "Compiling wrapper..." + ${CC:-gcc} -O2 -Wall -o ${WORKDIR}/wrapper \ + ${FILESDIR}/wrapper-${W_VER}.c || die + + exeinto /usr/lib/gcc-config + doexe ${WORKDIR}/wrapper || die + + # Only setup this if we have a proper gcc version installed, else + # we will nuke the non gcc-config versions ... + if /usr/bin/gcc-config --get-current-profile &> /dev/null + then + einfo "Creating wrappers for compiler tools..." + exeinto /lib + newexe ${WORKDIR}/wrapper cpp + + exeinto /usr/bin + for x in gcc cpp cc c++ g++ ${CHOST}-gcc ${CHOST}-c++ ${CHOST}-g++ + do + newexe ${WORKDIR}/wrapper ${x} + done + fi + + einfo "Adding compat symlinks..." + into /usr + dodir /usr/sbin + if [ "${ARCH}" = "amd64" ] + then + newbin ${FILESDIR}/${PN}-${PV}-multi-ldpath ${PN} + else + newbin ${FILESDIR}/${PN}-${PV} ${PN} + fi +} + +pkg_postinst() { + + # Do we have a valid multi ver setup ? + if ${ROOT}/usr/bin/gcc-config --get-current-profile &> /dev/null + then + # We not longer use the /usr/include/g++-v3 hacks, as + # it is not needed ... + if [ -L ${ROOT}/usr/include/g++ ] + then + rm -f ${ROOT}/usr/include/g++ + fi + if [ -L ${ROOT}/usr/include/g++-v3 ] + then + rm -f ${ROOT}/usr/include/g++-v3 + fi + + if [ ${ROOT} = "/" ] + then + /usr/bin/gcc-config $(/usr/bin/gcc-config --get-current-profile) + fi + fi +} + |