# $Id: PKGBUILD,v 1.37 2004/11/05 20:20:17 judd Exp $ # Maintainer: judd pkgname=gcc pkgver=3.4.3 pkgrel=2 pkgdesc="The GNU Compiler Collection" url="http://gcc.gnu.org" depends=('glibc' 'binutils') conflicts=('gcc-compat') source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/$pkgname-{core,g++,objc,testsuite}-$pkgver.tar.bz2 \ ftp://gcc.gnu.org/pub/gcc/releases/gcc-3.3.5/gcc-{core,g++}-3.3.5.tar.bz2\ gcc-3.4.1-VisibilityPatch2.diff) md5sums=('d2cbfe8fc3205c1d7969b26377405778' '26cb84db92feb8e03bb7bf3bc264844f'\ '2ea6456735403df04c1a368590bc9ce0' 'b4fff6ce0a038021b9e507917abb9a07'\ '83f93c71f9dc640e3dbde4f846fc86de' '313b580cd03ad5c1fa180874acba036d'\ 'd2b2e7d8e2eb265ce445e4e916d83708') build() { # build backward-compatible libstdc++ library # (unfortunately, it seems we have to build the whole thing # to get the libstdc++ libraries) cd $startdir/src/gcc-3.3.5 ./configure --prefix=/usr --enable-shared \ --enable-languages=c++ --enable-threads=posix --enable-__cxa_atexit cd build make all-target-libstdc++-v3 BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || return 1 make DESTDIR=$startdir/pkg install-target-libstdc++-v3 || return 1 rm -rf $startdir/pkg/usr/include # now build the new (current) version cd $startdir/src/gcc-$pkgver patch -Np1 -i $startdir/src/gcc-3.4.1-VisibilityPatch2.diff || return 1 mkdir ../gcc-build cd ../gcc-build ../gcc-$pkgver/configure --prefix=/usr --enable-shared \ --enable-languages=c,c++,objc --enable-threads=posix --enable-__cxa_atexit make bootstrap || return 1 make DESTDIR=$startdir/pkg install || return 1 rm -rf $startdir/pkg/usr/bin/c++filt $startdir/pkg/usr/lib/libiberty.a mkdir -p $startdir/pkg/lib (cd $startdir/pkg/lib; ln -s ../usr/bin/cpp) (cd $startdir/pkg/usr/bin; ln -sf gcc cc; ln -sf g++ c++) # get rid of the references to my build dir sed -i "s|-L$startdir/src[^ ]* ||g" $startdir/pkg/usr/lib/{libstdc++.la,libsupc++.la} chmod 644 $startdir/pkg/usr/lib/*.la }