From ecf2df25cadbdfe4e5e1fac70f71d1df0f7c1fa1 Mon Sep 17 00:00:00 2001 From: Travis Tilley Date: Tue, 5 Oct 2004 12:25:45 +0000 Subject: fixed the handling of GCC_SPECS-specific gcc configs --- sys-devel/gcc-config/ChangeLog | 8 +- sys-devel/gcc-config/Manifest | 8 +- .../gcc-config/files/digest-gcc-config-1.3.6-r2 | 0 .../gcc-config/files/digest-gcc-config-1.3.6-r3 | 0 sys-devel/gcc-config/files/gcc-config-1.3.6 | 9 +- sys-devel/gcc-config/gcc-config-1.3.6-r2.ebuild | 97 ---------------------- sys-devel/gcc-config/gcc-config-1.3.6-r3.ebuild | 97 ++++++++++++++++++++++ 7 files changed, 115 insertions(+), 104 deletions(-) delete mode 100644 sys-devel/gcc-config/files/digest-gcc-config-1.3.6-r2 create mode 100644 sys-devel/gcc-config/files/digest-gcc-config-1.3.6-r3 delete mode 100644 sys-devel/gcc-config/gcc-config-1.3.6-r2.ebuild create mode 100644 sys-devel/gcc-config/gcc-config-1.3.6-r3.ebuild diff --git a/sys-devel/gcc-config/ChangeLog b/sys-devel/gcc-config/ChangeLog index a21beb905714..bd563a9f84be 100644 --- a/sys-devel/gcc-config/ChangeLog +++ b/sys-devel/gcc-config/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-devel/gcc-config # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/ChangeLog,v 1.58 2004/10/02 12:59:22 kloeri Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/ChangeLog,v 1.59 2004/10/05 12:25:45 lv Exp $ + +*gcc-config-1.3.6-r3 (05 Oct 2004) + + 05 Oct 2004; Travis Tilley files/gcc-config-1.3.6, + -gcc-config-1.3.6-r2.ebuild, +gcc-config-1.3.6-r3.ebuild: + fixed the handling of GCC_SPECS-specific gcc configs 02 Oct 2004; Bryan Østergaard gcc-config-1.3.6-r2.ebuild: diff --git a/sys-devel/gcc-config/Manifest b/sys-devel/gcc-config/Manifest index 3c9d54d38636..5b5336a73342 100644 --- a/sys-devel/gcc-config/Manifest +++ b/sys-devel/gcc-config/Manifest @@ -1,8 +1,8 @@ -MD5 a9c7e1e840365a0af0ec8138c6cb1326 ChangeLog 10959 +MD5 d42fce04cb9a44421709843ca345b49c ChangeLog 11176 MD5 0220f9bd49959356ec0ed4670b71e7d8 gcc-config-1.3.5-r1.ebuild 2076 MD5 9eb40c0112df24e7899358bd77a61f1e gcc-config-1.3.5.ebuild 2191 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164 -MD5 28d1653a494a713564deb4d59299831e gcc-config-1.3.6-r2.ebuild 2613 +MD5 d6cc248810e7b22af60295dac2339034 gcc-config-1.3.6-r3.ebuild 2609 MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-gcc-config-1.3.5 0 MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-gcc-config-1.3.5-r1 0 MD5 654c9238fad29b2bf0954df0a0f3fbe0 files/gcc-config-1.3.5 9302 @@ -13,5 +13,5 @@ MD5 843435f640a4b76d12f8faee16f685f3 files/wrapper-1.4.c 5636 MD5 d9c2c81252d15436663ce61abcb87e19 files/wrapper.c 3520 MD5 b2f6742e0556986c6c1f1de8e737fd6c files/gcc-config-1.4.1 12978 MD5 6fb6357ea1e81976c54079bbac2b5953 files/gcc-config-1.4 12017 -MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-gcc-config-1.3.6-r2 0 -MD5 0867dc1389714974a8bfe7c477b94272 files/gcc-config-1.3.6 9913 +MD5 9e16767e6563d96a417205848b2cea38 files/gcc-config-1.3.6 10070 +MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-gcc-config-1.3.6-r3 0 diff --git a/sys-devel/gcc-config/files/digest-gcc-config-1.3.6-r2 b/sys-devel/gcc-config/files/digest-gcc-config-1.3.6-r2 deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/sys-devel/gcc-config/files/digest-gcc-config-1.3.6-r3 b/sys-devel/gcc-config/files/digest-gcc-config-1.3.6-r3 new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys-devel/gcc-config/files/gcc-config-1.3.6 b/sys-devel/gcc-config/files/gcc-config-1.3.6 index 5aa8dde183b8..d15c1f27cb3d 100755 --- a/sys-devel/gcc-config/files/gcc-config-1.3.6 +++ b/sys-devel/gcc-config/files/gcc-config-1.3.6 @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 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.3.6,v 1.6 2004/10/04 15:52:15 lv Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.3.6,v 1.7 2004/10/05 12:25:45 lv Exp $ # Author: Martin Schlemmer source /etc/init.d/functions.sh || { @@ -309,6 +309,7 @@ get_bin_path() { source "/etc/env.d/gcc/${CC_COMP}" echo "${PATH}" else + echo "no-config" echo "/etc/env.d/gcc/${CC_COMP} doesnt exist" 1>&2 fi @@ -320,6 +321,7 @@ get_lib_path() { source "/etc/env.d/gcc/${CC_COMP}" echo "${LDPATH}" else + echo "no-config" echo "/etc/env.d/gcc/${CC_COMP} doesnt exist" 1>&2 fi @@ -331,6 +333,7 @@ get_stdcxx_incdir() { source "/etc/env.d/gcc/${CC_COMP}" echo "${LDPATH}/include/${STDCXX_INCDIR}" else + echo "no-config" echo "/etc/env.d/gcc/${CC_COMP} doesnt exist" 1>&2 fi @@ -450,7 +453,9 @@ then fi fi -if [ ! -d "/usr/lib/gcc-lib/${CC_COMP%-*}/${CC_COMP##*-}" -o \ +CC_COMP_NO_SPECS=$(echo ${CC_COMP} | awk -F- '{ print $1"-"$2"-"$3"-"$4"-"$5 }') + +if [ ! -d "/usr/lib/gcc-lib/${CC_COMP_NO_SPECS%-*}/${CC_COMP_NO_SPECS##*-}" -o \ ! -f "/etc/env.d/gcc/${CC_COMP}" ] then eerror "$0: Profile does not exist or invalid setting for /etc/env.d/gcc/${CC_COMP}" diff --git a/sys-devel/gcc-config/gcc-config-1.3.6-r2.ebuild b/sys-devel/gcc-config/gcc-config-1.3.6-r2.ebuild deleted file mode 100644 index efcdb6f98dfb..000000000000 --- a/sys-devel/gcc-config/gcc-config-1.3.6-r2.ebuild +++ /dev/null @@ -1,97 +0,0 @@ -# Copyright 1999-2004 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.3.6-r2.ebuild,v 1.2 2004/10/02 12:59:22 kloeri Exp $ - -# Version of .c wrapper to use -W_VER="1.4.2" - -DISABLE_GEN_GCC_WRAPPERS="yes" - -GCC_CONFIG_BIN="${ROOT}/usr/bin/gcc-config" -DESCRIPTION="Utility to change the gcc compiler being used." -HOMEPAGE="http://www.gentoo.org/" -SRC_URI="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="x86 ppc sparc mips alpha arm hppa amd64 ia64 ~ppc64 ~s390" -IUSE="" - -DEPEND="virtual/libc - >=sys-apps/portage-2.0.47-r10" # We need portageq ... - -pkg_setup() { - if [ -x "${GCC_CONFIG_BIN}" ] - then - # Make sure while we have write access that everything is setup Ok ... - ${GCC_CONFIG_BIN} --get-current-profile &> /dev/null - fi -} - -src_install() { - local gcc_bin_path="$(${GCC_CONFIG_BIN} --get-bin-path)" - - # Setup PATH just in case ... - if ${GCC_CONFIG_BIN} --get-current-profile &> /dev/null - then - if [ -x "${GCC_CONFIG_BIN}" ] - then - export PATH="`${GCC_CONFIG_BIN} --get-bin-path`:${PATH}" - else - export PATH="`${GCC_CONFIG_BIN} --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 ${GCC_CONFIG_BIN} --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++ f77 gcj \ - ${CHOST}-gcc ${CHOST}-c++ ${CHOST}-g++ ${CHOST}-f77 ${CHOST}-gcj - do - # Make sure we only install wrappers for those present ... - [ -x "${gcc_bin_path}/${x}" -o \ - "${x}" = "c++" -o "${x}" = "${REAL_CHOST}-c++" -o \ - "${x}" = "cpp" -o "${x}" = "cc" ] && \ - newexe ${WORKDIR}/wrapper ${x} - done - fi - - einfo "Installing gcc-config..." - newbin ${FILESDIR}/${PN}-${PV} ${PN} - dosed "s:PORTAGE-VERSION:${PV}:" /usr/bin/${PN} -} - -pkg_postinst() { - # Do we have a valid multi ver setup ? - if ${GCC_CONFIG_BIN} --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 - ${GCC_CONFIG_BIN} $(/usr/bin/gcc-config --get-current-profile) - fi - fi -} diff --git a/sys-devel/gcc-config/gcc-config-1.3.6-r3.ebuild b/sys-devel/gcc-config/gcc-config-1.3.6-r3.ebuild new file mode 100644 index 000000000000..05e3825510d5 --- /dev/null +++ b/sys-devel/gcc-config/gcc-config-1.3.6-r3.ebuild @@ -0,0 +1,97 @@ +# Copyright 1999-2004 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.3.6-r3.ebuild,v 1.1 2004/10/05 12:25:45 lv Exp $ + +# Version of .c wrapper to use +W_VER="1.4.2" + +DISABLE_GEN_GCC_WRAPPERS="yes" + +GCC_CONFIG_BIN="${ROOT}/usr/bin/gcc-config" +DESCRIPTION="Utility to change the gcc compiler being used." +HOMEPAGE="http://www.gentoo.org/" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="x86 ppc sparc mips alpha arm hppa amd64 ia64 ~ppc64 ~s390" +IUSE="" + +DEPEND="virtual/libc + >=sys-apps/portage-2.0.47-r10" # We need portageq ... + +pkg_setup() { + if [ -x "${GCC_CONFIG_BIN}" ] + then + # Make sure while we have write access that everything is setup Ok ... + ${GCC_CONFIG_BIN} --get-current-profile &> /dev/null + fi +} + +src_install() { + local gcc_bin_path="$(${GCC_CONFIG_BIN} --get-bin-path)" + + # Setup PATH just in case ... + if ${GCC_CONFIG_BIN} --get-current-profile &> /dev/null + then + if [ -x "${GCC_CONFIG_BIN}" ] + then + export PATH="`${GCC_CONFIG_BIN} --get-bin-path`:${PATH}" + else + export PATH="`${GCC_CONFIG_BIN} --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 ${GCC_CONFIG_BIN} --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++ f77 gcj \ + ${CHOST}-gcc ${CHOST}-c++ ${CHOST}-g++ ${CHOST}-f77 ${CHOST}-gcj + do + # Make sure we only install wrappers for those present ... + [ -x "${gcc_bin_path}/${x}" -o \ + "${x}" = "c++" -o "${x}" = "${REAL_CHOST}-c++" -o \ + "${x}" = "cpp" -o "${x}" = "cc" ] && \ + newexe ${WORKDIR}/wrapper ${x} + done + fi + + einfo "Installing gcc-config..." + newbin ${FILESDIR}/${PN}-${PV} ${PN} + dosed "s:PORTAGE-VERSION:${PV}:" /usr/bin/${PN} +} + +pkg_postinst() { + # Do we have a valid multi ver setup ? + if ${GCC_CONFIG_BIN} --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 + ${GCC_CONFIG_BIN} $(/usr/bin/gcc-config --get-current-profile) + fi + fi +} -- cgit v1.2.3-65-gdbad