| 1 | # Description: The GNU Compiler Collection |
| 2 | # URL: http://gcc.gnu.org |
| 3 | # Maintainer: CRUX System Team, core-ports at crux dot nu |
| 4 | # Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu |
| 5 | # Depends on: zlib libmpc |
| 6 | |
| 7 | name=gcc |
| 8 | version=4.8.3 |
| 9 | release=1 |
| 10 | source=(ftp://gcc.gnu.org/pub/gcc/releases/$name-$version/$name-$version.tar.bz2 |
| 11 | $name-nocheck-fixincludes.patch $name-$version-gnueabihf.patch) |
| 12 | |
| 13 | build() { |
| 14 | patch -d $name-$version -p1 -i $SRC/$name-nocheck-fixincludes.patch |
| 15 | patch -d $name-$version -p1 -i $SRC/$name-$version-gnueabihf.patch |
| 16 | |
| 17 | mkdir build |
| 18 | cd build |
| 19 | |
| 20 | ../$name-$version/configure --prefix=/usr \ |
| 21 | --build=arm-unknown-linux-gnueabihf \ |
| 22 | --with-abi=aapcs-linux --with-mode=arm \ |
| 23 | --with-float=hard \ |
| 24 | --mandir=/usr/man \ |
| 25 | --libexecdir=/usr/lib \ |
| 26 | --enable-languages=c,c++,objc \ |
| 27 | --enable-threads=posix \ |
| 28 | --enable-__cxa_atexit \ |
| 29 | --enable-clocale=gnu \ |
| 30 | --enable-shared \ |
| 31 | --disable-nls \ |
| 32 | --with-x=no \ |
| 33 | --with-system-zlib \ |
| 34 | --with-pkgversion="CRUX-ARM" |
| 35 | |
| 36 | make |
| 37 | make -j1 DESTDIR=$PKG install |
| 38 | |
| 39 | mkdir $PKG/lib |
| 40 | ln -sf ../usr/bin/cpp $PKG/lib/cpp |
| 41 | ln -sf gcc $PKG/usr/bin/cc |
| 42 | ln -sf g++ $PKG/usr/bin/c++ |
| 43 | |
| 44 | mv $PKG/usr/lib/gcc/*/$version/include-fixed/{limits.h,syslimits.h} $PKG/usr/lib/gcc/*/$version/include/ |
| 45 | |
| 46 | rm $PKG/usr/lib/libstdc++.so.6.0.19-gdb.py |
| 47 | rm -r $PKG/usr/share |
| 48 | rm -r $PKG/usr/bin/*-linux-gnu-* |
| 49 | rm -r $PKG/usr/lib/gcc/*/$version/{install-tools,include-fixed} |
| 50 | |
| 51 | sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib/{libstdc++.la,libsupc++.la} |
| 52 | } |