# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ ETYPE="gcc-compiler" EAPI="1" inherit toolchain subversion KEYWORDS="" DESCRIPTION="The GNU Compiler Collection." HOMEPAGE="http://gcc.gnu.org/" ESVN_REPO_URI="svn://gcc.gnu.org/svn/gcc/trunk" SRC_URI="" IUSE="offline +profiledbootstrap debug" LICENSE="GPL-3 LGPL-3" SLOT="${GCC_BRANCH_VER}-svn" SPLIT_SPECS="no" PRERELEASE="yes" RDEPEND=">=sys-libs/zlib-1.1.4 || ( >=sys-devel/gcc-config-1.3.12-r4 ) virtual/libiconv >=dev-libs/gmp-4.2.2 >=dev-libs/mpfr-2.3.0 !build? ( gcj? ( gtk? ( x11-libs/libXt x11-libs/libX11 x11-libs/libXtst x11-proto/xproto x11-proto/xextproto >=x11-libs/gtk+-2.2 x11-libs/pango ) >=media-libs/libart_lgpl-2.1 ) >=sys-libs/ncurses-5.2-r2 nls? ( sys-devel/gettext ) )" DEPEND="${RDEPEND} test? ( >=dev-util/dejagnu-1.4.4 >=sys-devel/autogen-5.5.4 ) >=sys-apps/texinfo-4.8 =sys-devel/automake-1.9* >=sys-devel/bison-1.28 >=sys-devel/flex-2.5.4 >=${CATEGORY}/binutils-2.18" PDEPEND="sys-devel/gcc-config" if [[ ${CATEGORY} != cross-* ]] ; then DEPEND="${DEPEND} elibc_glibc? ( >=sys-libs/glibc-2.7-r2 )" fi src_unpack() { [[ -z ${UCLIBC_VER} ]] && [[ ${CTARGET} == *-uclibc* ]] && die "Sorry, this version does not support uClibc" # use the offline USE flag to prevent the ebuild from trying to update from # the repo. the current sources will be used instead. use offline && ESVN_OFFLINE="yes" subversion_src_unpack cd "${S}" subversion_wc_info echo ${PV/_/-} > "${S}"/gcc/BASE-VER echo "rev. ${ESVN_WC_REVISION}" > "${S}"/gcc/REVISION echo "Gentoo SVN ebuild" > "${S}"/gcc/DEV-PHASE echo "built $(date "+%Y%m%d")" > "${S}"/gcc/DATESTAMP if ! use vanilla ; then EPATCH_SOURCE="${GCC_FILESDIR}/${GCC_RELEASE_VER}" \ EPATCH_EXCLUDE="${GCC_FILESDIR}/${GCC_RELEASE_VER}/exclude" \ EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" epatch \ || die "Failed during patching." fi ${ETYPE}_src_unpack || die "failed to ${ETYPE}_src_unpack" # protoize don't build on FreeBSD, skip it if ! is_crosscompile && ! use elibc_FreeBSD ; then # enable protoize / unprotoize sed -i -e '/^LANGUAGES =/s:$: proto:' "${S}"/gcc/Makefile.in fi fix_files="" for x in contrib/test_summary libstdc++-v3/scripts/check_survey.in ; do [[ -e ${x} ]] && fix_files="${fix_files} ${x}" done ht_fix_file ${fix_files} */configure *.sh */Makefile.in if ! is_crosscompile && is_multilib && \ [[ ( $(tc-arch) == "amd64" || $(tc-arch) == "ppc64" ) && -z ${SKIP_MULTILIB_HACK} ]] ; then disgusting_gcc_multilib_HACK || die "multilib hack failed" fi # Misdesign in libstdc++ (Redhat) if [[ -e ${S}/libstdc++-v3/config/cpu/i486/atomicity.h ]] ; then cp -pPR "${S}"/libstdc++-v3/config/cpu/i{4,3}86/atomicity.h fi use gcj && cp -pPR "${DISTDIR}/ecj-${GCC_BRANCH_VER}.jar" "${S}/ecj.jar" # Fixup libtool to correctly generate .la files with portage elibtoolize --portage --shallow --no-uclibc gnuconfig_update # update configure files local f einfo "Fixing misc issues in configure files" [[ ${GCCMAJOR} -ge 4 ]] && epatch "${GCC_FILESDIR}"/gcc-configure-texinfo.patch for f in $(grep -l 'autoconf version 2.13' $(find "${S}" -name configure)) ; do ebegin " Updating ${f/${S}\/}" patch "${f}" "${GCC_FILESDIR}"/gcc-configure-LANG.patch >& "${T}"/configure-patch.log \ || eerror "Please file a bug about this" eend $? done sed -i 's|A-Za-z0-9|[:alnum:]|g' "${S}"/gcc/*.awk #215828 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" [[ ${CHOST} == ${CTARGET} ]] && epatch "${GCC_FILESDIR}"/gcc-spec-env.patch [[ ${CTARGET} == *-softfloat-* ]] && epatch "${FILESDIR}"/4.0.2/gcc-4.0.2-softfloat.patch use debug && EXTRA_ECONF="${EXTRA_ECONF} --enable-checking" # profiledbootstrap generates profiling information while building the # second stage, which is then used to better optimize the compiler during # the third stage. The end result is a faster (~5-7%) compiler. The # downside is that building gcc in parallel is impossible due to the # possibility of collisions in the profiling data, so building the compiler # itself takes much longer (50-100%+ depending on the number of processors # you usually build with). the profiledbootstrap USE flag lets you decide # which you want more - a faster gcc or a faster built gcc. use profiledbootstrap \ && GCC_MAKE_TARGET=profiledbootstrap \ || GCC_MAKE_TARGET=bootstrap } pkg_preinst() { toolchain_pkg_preinst subversion_pkg_preinst }