summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-12-05 05:04:28 +0000
committerMike Frysinger <vapier@gentoo.org>2005-12-05 05:04:28 +0000
commitc31ad3d93dff7587a0b6bfd580ff744c195470ae (patch)
treeebdd9422ca8912151538d992d09667b66fab7fe2 /eclass
parentNew version (diff)
downloadgentoo-2-c31ad3d93dff7587a0b6bfd580ff744c195470ae.tar.gz
gentoo-2-c31ad3d93dff7587a0b6bfd580ff744c195470ae.tar.bz2
gentoo-2-c31ad3d93dff7587a0b6bfd580ff744c195470ae.zip
run gcc_movelibs before we strip and clean up the gcc_movelibs func to get rid of warnings displayed during emerge #114333
Diffstat (limited to 'eclass')
-rw-r--r--eclass/toolchain.eclass66
1 files changed, 24 insertions, 42 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index b03561bf9aa7..ba4d9f52890a 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.225 2005/12/03 21:37:33 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.226 2005/12/05 05:04:28 vapier Exp $
HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html"
LICENSE="GPL-2 LGPL-2.1"
@@ -1515,13 +1515,16 @@ gcc-compiler_src_install() {
make DESTDIR="${D}" install || die
# Punt some tools which are really only useful while building gcc
rm -r "${D}${LIBEXECPATH}"/install-tools
+ # This one comes with binutils
+ find "${D}" -name libiberty.a -exec rm -f {} \;
+
+ # Move the libraries to the proper location
+ gcc_movelibs
+
# Now do the fun stripping stuff
env RESTRICT="" STRIP=${CHOST}-strip prepstrip "${D}${BINPATH}" "${D}${LIBEXECPATH}"
env RESTRICT="" STRIP=${CTARGET}-strip prepstrip "${D}${LIBPATH}"
- # This one comes with binutils
- find "${D}" -name libiberty.a -exec rm -f {} \;
-
# Basic sanity check
is_crosscompile || [[ -r ${D}${BINPATH}/gcc ]] || die "gcc not found in ${D}"
@@ -1545,9 +1548,6 @@ gcc-compiler_src_install() {
cp ${WORKDIR}/build/*.specs "${D}"${LIBPATH}
fi
- # Move the libraries to the proper location
- gcc_movelibs
-
# Make sure we dont have stuff lying around that
# can nuke multiple versions of gcc
if ! use build ; then
@@ -1662,7 +1662,7 @@ gcc_movelibs() {
local multiarg
for multiarg in $(${XGCC} -print-multi-lib) ; do
multiarg=${multiarg#*;}
- multiarg=${multiarg/@/-}
+ multiarg=${multiarg//@/-}
local OS_MULTIDIR=$(${XGCC} ${multiarg} --print-multi-os-directory)
local MULTIDIR=$(${XGCC} ${multiarg} --print-multi-directory)
@@ -1671,40 +1671,22 @@ gcc_movelibs() {
[[ -d ${TODIR} ]] || mkdir -p ${TODIR}
- FROMDIR=${D}${LIBPATH}/${OS_MULTIDIR}
- if [[ ${FROMDIR} != "${TODIR}" && -d ${FROMDIR} ]] ; then
- mv ${FROMDIR}/{*.a,*.so*,*.la} ${TODIR}
- rmdir ${FROMDIR}
- fi
-
- FROMDIR=${D}${LIBPATH}/../${MULTIDIR}
- if [[ -d ${FROMDIR} ]] ; then
- mv ${FROMDIR}/{*.a,*.so*,*.la} ${TODIR}
- rmdir ${FROMDIR}
- fi
-
- FROMDIR=${D}${PREFIX}/lib/${OS_MULTIDIR}
- if [[ -d ${FROMDIR} ]] ; then
- mv ${FROMDIR}/{*.a,*.so*,*.la} ${TODIR}
- rmdir ${FROMDIR}
- fi
-
- FROMDIR=${D}${PREFIX}/${CTARGET}/lib/${OS_MULTIDIR}
- if [[ -d ${FROMDIR} ]] ; then
- mv ${FROMDIR}/{*.a,*.so*,*.la} ${TODIR}
- rmdir ${FROMDIR}
- fi
-
- FROMDIR=${D}${PREFIX}/lib/${MULTIDIR}
- if [[ -d ${FROMDIR} ]] ; then
- # The only thing that ends up here is libiberty.a (which is deleted)
- # Lucky for us nothing mistakenly gets placed here that we need...
- # otherwise we'd have a potential conflict when OS_MULTIDIR=../lib and
- # MULTIDIR=. for different ABI. If this happens, the fix is to patch
- # the gcc Makefiles to behave with LIBDIR properly.
- #mv ${FROMDIR}/{*.a,*.so*,*.la} ${TODIR}
- rmdir ${FROMDIR}
- fi
+ for FROMDIR in \
+ ${LIBPATH}/${OS_MULTIDIR} \
+ ${LIBPATH}/../${MULTIDIR} \
+ ${PREFIX}/lib/${OS_MULTIDIR} \
+ ${PREFIX}/${CTARGET}/lib/${OS_MULTIDIR} \
+ ${PREFIX}/lib/${MULTIDIR}
+ do
+ FROMDIR=${D}${FROMDIR}
+ if [[ ${FROMDIR} != "${TODIR}" && -d ${FROMDIR} ]] ; then
+ local files=$(find "${FROMDIR}" -maxdepth 1 ! -type d 2>/dev/null)
+ if [[ -n ${files} ]] ; then
+ mv ${files} "${TODIR}"
+ rmdir "${FROMDIR}" 2>/dev/null
+ fi
+ fi
+ done
done
# make sure the libtool archives have libdir set to where they actually