# $Header: /alx-cvs/smage-eglibc/libstdc++/libstdc++-4.2.3-r2.smage2,v 1.2 2008/06/10 19:17:22 niro Exp $ PNAME="libstdc++" PVER="4.2.3" PBUILD="r2" PCATEGORIE="sys-libs" STATE="unstable" DESCRIPTION="Standard GNU C and C++ libraries." HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html" # needed to prevent compat issues with gcc-3.4.x and gcc-4.0.x DEPEND=">= sys-libs/libstdc++-v3-3.3.3 >= virtual/base-files" SDEPEND=">= sys-dev/binutils-2.16 >= virtual/kernel-headers" SRCFILE="gcc-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/gcc-${PVER}" # languages to build into gcc MyLanguages=c,c++ sminclude cleanutils libtool alx SRC_URI=( gnu://gcc/gcc-${PVER}/${SRCFILE} mirror://gcc/${SRCFILE} mirror://gcc/gcc-${PVER}-no-fixincludes.patch mirror://gcc/gcc-${PVER}-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 gcc-${PVER}-no-fixincludes.patch || die mpatch gcc-${PVER}-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 ../configure \ --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 install -d ${BINDIR}/$(mlibdir) || die make DESTDIR=${BINDIR} install || die # deletes everything excluding libgcc_s and libstdc++ zapmost ${BINDIR}/usr/$(mlibdir) libgcc_s*.* libstdc++*.* || die # other not needed rm -rf ${BINDIR}/$(mlibdir) || die rm -rf ${BINDIR}/usr/{bin,include,share} || die rm -rf ${BINDIR}/usr/libexec || 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 }