# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.319 2006/12/27 06:04:03 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.320 2006/12/30 09:12:36 vapier Exp $
HOMEPAGE="http://gcc.gnu.org/"
LICENSE="GPL-2 LGPL-2.1"
else
LIBPATH=${TOOLCHAIN_LIBPATH:-${PREFIX}/lib/gcc-lib/${CTARGET}/${GCC_CONFIG_VER}}
fi
- LIBEXECPATH=${TOOLCHAIN_LIBEXE:-${PREFIX}/libexec/gcc/${CTARGET}/${GCC_CONFIG_VER}}
INCLUDEPATH=${TOOLCHAIN_INCLUDEPATH:-${LIBPATH}/include}
if is_crosscompile ; then
BINPATH=${TOOLCHAIN_BINPATH:-${PREFIX}/${CHOST}/${CTARGET}/gcc-bin/${GCC_CONFIG_VER}}
# specific gcc targets, like libffi. Note that we dont override the value
# returned by get_libdir here.
LIBPATH=${TOOLCHAIN_LIBPATH:-${PREFIX}/$(get_libdir)}
- LIBEXECPATH=${TOOLCHAIN_LIBEXE:-${PREFIX}/libexec/gcc}
INCLUDEPATH=${TOOLCHAIN_INCLUDEPATH:-${PREFIX}/include}
BINPATH=${TOOLCHAIN_BINPATH:-${PREFIX}/bin}
DATAPATH=${TOOLCHAIN_DATAPATH:-${PREFIX}/share}
eend $?
done
- einfo "Touching generated files"
- ./contrib/gcc_update --touch | \
- while read f ; do
- einfo " ${f%%...}"
- done
+ if [[ -x contrib/gcc_update ]] ; then
+ einfo "Touching generated files"
+ ./contrib/gcc_update --touch | \
+ while read f ; do
+ einfo " ${f%%...}"
+ done
+ fi
disable_multilib_libjava || die "failed to disable multilib java"
}
S=${WORKDIR}/build \
make DESTDIR="${D}" install || die
# Punt some tools which are really only useful while building gcc
- rm -r "${D}${LIBEXECPATH}"/install-tools
+ find "${D}" -name install-tools -type d -exec rm -rf "{}" \;
# This one comes with binutils
- find "${D}" -name libiberty.a -exec rm -f {} \;
+ find "${D}" -name libiberty.a -exec rm -f "{}" \;
# 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
- cd ${D}${LIBPATH}
+ cd "${D}"${LIBPATH}
# Move Java headers to compiler-specific dir
- for x in ${D}${PREFIX}/include/gc*.h ${D}${PREFIX}/include/j*.h ; do
- [[ -f ${x} ]] && mv -f "${x}" ${D}${LIBPATH}/include/
+ for x in "${D}"${PREFIX}/include/gc*.h "${D}"${PREFIX}/include/j*.h ; do
+ [[ -f ${x} ]] && mv -f "${x}" "${D}"${LIBPATH}/include/
done
for x in gcj gnu java javax org ; do
if [[ -d ${D}${PREFIX}/include/${x} ]] ; then
dodir /${LIBPATH}/include/${x}
- mv -f ${D}${PREFIX}/include/${x}/* ${D}${LIBPATH}/include/${x}/
- rm -rf ${D}${PREFIX}/include/${x}
+ mv -f "${D}"${PREFIX}/include/${x}/* "${D}"${LIBPATH}/include/${x}/
+ rm -rf "${D}"${PREFIX}/include/${x}
fi
done
if [[ -d ${D}${PREFIX}/lib/security ]] ; then
dodir /${LIBPATH}/security
- mv -f ${D}${PREFIX}/lib/security/* ${D}${LIBPATH}/security
- rm -rf ${D}${PREFIX}/lib/security
+ mv -f "${D}"${PREFIX}/lib/security/* "${D}"${LIBPATH}/security
+ rm -rf "${D}"${PREFIX}/lib/security
fi
# Move libgcj.spec to compiler-specific directories
[[ -f ${D}${PREFIX}/lib/libgcj.spec ]] && \
- mv -f ${D}${PREFIX}/lib/libgcj.spec ${D}${LIBPATH}/libgcj.spec
+ mv -f "${D}"${PREFIX}/lib/libgcj.spec "${D}"${LIBPATH}/libgcj.spec
# Rename jar because it could clash with Kaffe's jar if this gcc is
# primary compiler (aka don't have the -<version> extension)
- cd ${D}${BINPATH}
+ cd "${D}"${BINPATH}
[[ -f jar ]] && mv -f jar gcj-jar
# Move <cxxabi.h> to compiler-specific directories
[[ -f ${D}${STDCXX_INCDIR}/cxxabi.h ]] && \
- mv -f ${D}${STDCXX_INCDIR}/cxxabi.h ${D}${LIBPATH}/include/
+ mv -f "${D}"${STDCXX_INCDIR}/cxxabi.h "${D}"${LIBPATH}/include/
# These should be symlinks
dodir /usr/bin
fi
# Now do the fun stripping stuff
- env RESTRICT="" CHOST=${CHOST} prepstrip "${D}${BINPATH}" "${D}${LIBEXECPATH}"
+ env RESTRICT="" CHOST=${CHOST} prepstrip "${D}${BINPATH}"
env RESTRICT="" CHOST=${CTARGET} prepstrip "${D}${LIBPATH}"
+ # gcc used to install helper binaries in lib/ but then moved to libexec/
+ [[ -d ${D}${PREFIX}/libexec/gcc ]] && \
+ env RESTRICT="" CHOST=${CHOST} prepstrip "${D}${PREFIX}/libexec/gcc/${CTARGET}/${GCC_CONFIG_VER}"
cd "${S}"
if use build || is_crosscompile; then
# when installing gcc, it dumps internal libraries into /usr/lib
# instead of the private gcc lib path
gcc_movelibs() {
+ # older versions of gcc did not support --print-multi-os-directory
+ tc_version_is_at_least 3.0 || return 0
+
local multiarg removedirs=""
for multiarg in $($(XGCC) -print-multi-lib) ; do
multiarg=${multiarg#*;}
# make sure the libtool archives have libdir set to where they actually
# -are-, and not where they -used- to be.
- fix_libtool_libdir_paths "$(find ${D}${LIBPATH} -name *.la)"
+ fix_libtool_libdir_paths $(find "${D}"${LIBPATH} -name *.la)
}
#----<< src_* >>----