# $Id$ PNAME="gcj" PVER="4.6.2" PBUILD="r1" PCATEGORIE="sys-dev" HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html" DEPEND="== sys-libs/libstdc++-${PVER} >= sys-dev/binutils-2.21 == sys-dev/gcc-${PVER} >= virtual/glibc >= dev-libs/gmp-5.0.2 >= dev-libs/mpfr-3.0.1 >= dev-libs/mpc-0.9 >= dev-libs/ppl-0.11.2 >= dev-libs/cloog-ppl-0.15.11 >= dev-libs/elfutils-0.152" SDEPEND=">= virtual/kernel-headers" PROVIDE="virtual/java virtual/java-jdk" SRCFILE="${PNAME}-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" # you better off when not using distcc to compile # your new compiler :) maybe not all are the same msetfeature "!distcc" # languages to build into gcc MyLanguages=java sminclude mtools cleanutils libtool SRC_URI=( gnu://${PNAME}/${PNAME}-${PVER}/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/${PNAME}-4.5.1-no-fixincludes.patch ) UP2DATE="updatecmd \"http://ftp.gnu.org/gnu/${PNAME}/?C=M;O=A\" | sed -n 's/.*${PNAME}-\(.*\)\//\1/;$ p'" # 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} # generic fixes mpatch ${PNAME}-4.5.1-no-fixincludes.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 local myconf # Straight from the GCC install doc: # "GCC has code to correctly determine the correct value for target # for nearly all native systems. Therefore, we highly recommend you # not provide a configure target when configuring a native compiler." if [[ ${CHOST} != ${CCHOST} ]] then myconf+=" --target=${CCHOST}" fi # gcc >= 4.3 has now configure flags for uri and version - yeah! AR=ar \ ../configure \ --with-bugurl="http://bugs.magellan-linux.de/" \ --with-pkgversion="Magellan-Linux" \ --build=${CHOST} \ --host=${CHOST} \ --prefix=/usr \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --libdir=/usr/$(mlibdir) \ --libexecdir=/usr/$(mlibdir) \ --enable-shared \ --enable-threads=posix \ --enable-__cxa_atexit \ --enable-clocale=gnu \ --disable-checking \ --with-system-zlib \ --enable-long-long \ --enable-cstdio=stdio \ --enable-languages=${MyLanguages} \ --disable-libstdcxx-pch \ --enable-gnu-unique-object \ --enable-lto \ --enable-plugin \ --enable-gold \ ${myconf} \ || die # parallel builds seems to break sometimes on x86_64 local myopts [[ ${ARCH} = x86_64 ]] && myopts=-j1 mmake ${myopts} bootstrap-lean || die } src_install() { cd ${SRCDIR}/build # install all targets make DESTDIR=${BINDIR} install || die # versionize all bins and symlink them for bin in $(find ${BINDIR}/usr/bin -type f) do echo ${bin} mv ${bin} ${bin}-${PVER} || die ln -snf $(basename ${bin}-${PVER}) ${bin} || die done # fix all .la files # they may contain invalid libpathes which are not needed local la for la in $(find ${BINDIR} -name \*.la) do fix_la_file ${la} || die ${la} done }