# $Header: /magellan-cvs/smage/gcc-v34/gcc-v34-3.4.6-r1.smage2,v 1.4 2007-11-10 14:07:48 niro Exp $ PNAME="gcc-v34" PVER="3.4.6" PBUILD="r1" PCATEGORIE="sys-dev" STATE="stable" DESCRIPTION="Compat C/C++ v${PVER} compiler written by the GNU people." HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html" DEPEND=">= virtual/glibc" SDEPEND=">= sys-dev/binutils-2.4" SRCFILE="gcc-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/gcc-${PVER}" # languages to build into gcc MyLanguages=c,c++ SRC_URI=( mirror://gcc/${SRCFILE} mirror://gcc/gcc-3.4.4-no_fixincludes-1.patch mirror://gcc/gcc-3.4.4-linkonce-1.patch mirror://gcc/gcc-3.4.4-fix_configure_for_target_native-1.patch mirror://gcc/gcc-3.4.6-magellan-version.patch ) # gcc don't like strong CFLAGS export CFLAGS="${CFLAGS//-O?} -O2" export CXXFLAGS="${CFLAGS}" # check for crosscompile or export default CHOST if [[ -z ${CCHOST} ]] then # no crosscompile defined export CCHOST=${CHOST} else # use crosscompile host export CCHOST=${CCHOST} fi src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} mpatch -Np1 gcc-3.4.4-no_fixincludes-1.patch || die mpatch -Np1 gcc-3.4.4-linkonce-1.patch || die mpatch -Np1 gcc-3.4.4-fix_configure_for_target_native-1.patch || die mpatch -Np0 gcc-3.4.6-magellan-version.patch || die # suppress installation of libiberty, as we will be # using the one from binutils sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || die install -d ${SRCDIR}/build || die cd ${SRCDIR}/build } src_compile() { cd ${SRCDIR}/build # you better off when not using distcc to compile # your new compiler :) maybe not all are the same export SMAGE_USE_DISTCC=false # install this thing to /opt/gcc-${PVER} ../configure \ --host=${CHOST} \ --target=${CCHOST} \ --prefix=/opt/gcc-${PVER} \ --enable-shared \ --enable-threads=posix \ --enable-__cxa_atexit \ --enable-clocale=gnu \ --disable-checking \ --disable-libunwind-exceptions \ --with-system-zlib \ --enable-long-long \ --enable-cstdio=stdio \ --enable-languages=${MyLanguages} \ || die # smaller boostrap mmake bootstrap-lean || die } src_install() { cd ${SRCDIR}/build make DESTDIR=${BINDIR} install || die }