# $Header: /magellan-cvs/smage/gcc/gcc-4.2.3-r2.smage2,v 1.1 2008/04/02 21:15:47 niro Exp $ PNAME="gcc" PVER="4.3.2" PBUILD="r1" PCATEGORIE="sys-dev" STATE="unstable" DESCRIPTION="Modern C/C++ compiler written by the GNU people." HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html" DEPEND="== sys-libs/libstdc++-${PVER} >= sys-dev/binutils-2.19 >= virtual/glibc >= dev-libs/gmp-4.2.4 >= dev-libs/mpfr-2.3.2" SDEPEND=">= virtual/kernel-headers" SRCFILE="${PNAME}-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" # languages to build into gcc MyLanguages=c,c++ sminclude mtools libtool SRC_URI=( gnu://${PNAME}/${PNAME}-${PVER}/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/${PNAME}-${PVER}-no-fixincludes.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} # generic fixes mpatch ${PNAME}-${PVER}-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 # you better off when not using distcc to compile # your new compiler :) maybe not all are the same export SMAGE_USE_DISTCC=false # gcc >= 4.3 has now configure flags for uri and version - yeah! ../configure \ --with-bugurl="http://bugs.magellan-linux.de/" \ --with-pkgversion="${PVER} (Magellan-Linux)" \ --host=${CHOST} \ --target=${CCHOST} \ --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 \ --disable-libunwind-exceptions \ --with-system-zlib \ --enable-long-long \ --enable-cstdio=stdio \ --enable-languages=${MyLanguages} \ --disable-libstdcxx-pch \ || 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 minstalldir /$(mlibdir) || die 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 mlink ../usr/bin/cpp-${PVER} /$(mlibdir)/cpp || die # this one is needed on multlib system. # rpcgen may not find the cpp compiler correctly if not in /lib/cpp if [[ $(mlibdir) != lib ]] then minstalldir /lib || die mlink ../usr/bin/cpp-${PVER} /lib/cpp || die fi mlink gcc-${PVER} /usr/bin/cc || die # deletes libstdc++ && libgcc_s rm ${BINDIR}/usr/$(mlibdir)/{libgcc_s*.*,libstdc++*.*} || die # fix all .la files # the contain invalid libpathes and they are not needed local la for la in $(find ${BINDIR} -name \*.la) do fix_la_file ${la} || die ${la} done } postinstall() { echo echo "Please remember that the flag -mcpu does not exist anymore." echo "It has been replaced with '-mtune'. Please update your /etc/mage.rc." echo }