description="The GNU Compiler Collection." packager="CRUX System Team " maintainer="Lukc " url="http://$name.gnu.org" depends=(binutils zlib libmpc) if [[ -z ${CROSS_TARGET} ]]; then name=gcc else name=gcc-$CROSS_TARGET fi version=4.5.1 release=1 source=( http://ftp.gnu.org/gnu/$name/$name-$version/$name-core-$version.tar.bz2 http://ftp.gnu.org/gnu/$name/$name-$version/$name-g++-$version.tar.bz2 http://ftp.gnu.org/gnu/$name/$name-$version/$name-objc-$version.tar.bz2 $name-nocheck-fixincludes.patch ) build () { patch -d $name-$version -p1 -i $SRC/$name-nocheck-fixincludes.patch; mkdir build; cd build; ../$name-$version/configure \ ${CHOST:+--build=${CHOST}} \ ${CTARGET:+--host=${CTARGET}} \ ${CROSS_TRIPLET:+--target=${CROSS_TRIPLET}} \ --prefix=$prefix \ --mandir=$mandir \ --libexecdir=$libdir \ --enable-languages=c,c++,objc \ --enable-threads=posix \ --enable-__cxa_atexit \ --enable-clocale=gnu \ --enable-shared \ $(use_enable nls) \ --with-x=no \ --with-system-zlib \ --with-pkgversion="Nutritive"; make bootstrap; make -j1 check; make -j1 DESTDIR=$PKG install; mkdir $PKG/lib; ln -sf ..$bindir/cpp $PKG/lib/cpp; ln -sf $name $PKG$bindir/cc; ln -sf g++ $PKG$bindir/c++; mv $PKG$libdir/$name/*/$version/include-fixed/{limits.h,syslimits.h} $PKG$libdir/$name/*/$version/include/; rm $PKG$libdir/{libiberty.a,libstdc++.so.6.0.14-gdb.py}; #rm -r $PKG$libdir/$name/*/$version/{install-tools,include-fixed}; sed -i "s|-L$SRC[^ ]* ||g" $PKG$libdir/{libstdc++.la,libsupc++.la} || true }