diff options
Diffstat (limited to 'sys-devel/gcc/gcc-3.3-r1.ebuild')
-rw-r--r-- | sys-devel/gcc/gcc-3.3-r1.ebuild | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/sys-devel/gcc/gcc-3.3-r1.ebuild b/sys-devel/gcc/gcc-3.3-r1.ebuild index a1f9ed6e3fa0..50d8f9f6f4cb 100644 --- a/sys-devel/gcc/gcc-3.3-r1.ebuild +++ b/sys-devel/gcc/gcc-3.3-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-3.3-r1.ebuild,v 1.3 2003/08/10 01:18:41 george Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-3.3-r1.ebuild,v 1.4 2003/08/24 08:40:43 azarah Exp $ IUSE="static nls bootstrap java build X" @@ -130,15 +130,25 @@ PDEPEND="sys-devel/gcc-config" chk_gcc_version() { # This next bit is for updating libtool linker scripts ... - OLD_GCC_VERSION="`gcc -dumpversion`" + local OLD_GCC_VERSION="`gcc -dumpversion`" + local OLD_GCC_CHOST="$(gcc -v 2>&1 | egrep '^Reading specs' |\ + sed -e 's:^.*/gcc-lib/\([^/]*\)/[0-9]\+.*$:\1:')" if [ "${OLD_GCC_VERSION}" != "${MY_PV_FULL}" ] then - echo "${OLD_GCC_VERSION}" > ${WORKDIR}/.oldgccversion + echo "${OLD_GCC_VERSION}" > "${WORKDIR}/.oldgccversion" + fi + + if [ -n "${OLD_GCC_CHOST}" ] + then + if [ "${CHOST}" = "${CCHOST}" -a "${OLD_GCC_CHOST}" != "${CHOST}" ] + then + echo "${OLD_GCC_CHOST}" > "${WORKDIR}/.oldgccchost" + fi fi # Did we check the version ? - touch ${WORKDIR}/.chkgccversion + touch "${WORKDIR}/.chkgccversion" } version_patch() { @@ -551,11 +561,27 @@ pkg_postinst() { fi # Update libtool linker scripts to reference new gcc version ... - if [ -f ${WORKDIR}/.oldgccversion -a "${ROOT}" = "/" ] + if [ "${ROOT}" = "/" ] && \ + [ -f "${WORKDIR}/.oldgccversion" -o -f "${WORKDIR}/.oldgccchost" ] then - OLD_GCC_VERSION="`cat ${WORKDIR}/.oldgccversion`" + local OLD_GCC_VERSION= + local OLD_GCC_CHOST= + + if [ -f "${WORKDIR}/.oldgccversion" ] && \ + [ -n "$(cat "${WORKDIR}/.oldgccversion")" ] + then + OLD_GCC_VERSION="$(cat "${WORKDIR}/.oldgccversion")" + else + OLD_GCC_VERSION="${MY_PV_FULL}" + fi + + if [ -f "${WORKDIR}/.oldgccchost" ] && \ + [ -n "$(cat "${WORKDIR}/.oldgccchost")" ] + then + OLD_GCC_CHOST="--oldarch $(cat "${WORKDIR}/.oldgccchost")" + fi - /sbin/fix_libtool_files.sh ${OLD_GCC_VERSION} + /sbin/fix_libtool_files.sh ${OLD_GCC_VERSION} ${OLD_GCC_CHOST} fi # Fix ncurses b0rking (if r5 isn't unmerged) |