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, crux-arm at mikeux dot dyndns dot org
5 # Depends on: libgmp libmpfr
10 source=(ftp://sources.redhat.com/pub/gcc/releases/$name-$version/$name-{core,g++,objc}-$version.tar.bz2
11 $name-$version-nocheck-fixincludes.patch)
15 patch -d $name-$version -p1 -i $SRC/$name-$version-nocheck-fixincludes.patch
16 sed -i 's|REVISION|REVISION " (CRUX)"|' $name-$version/$name/version.c
19 # apply a sed substitutio that will suppress the installation of libiberty.a
20 sed 's|install_to_$(INSTALL_DEST) ||' -i libiberty/Makefile.in
22 sed 's|@have_mktemp_command@|yes|' -i gcc/gccbug.in
27 LDFLAGS="-Wl,-rpath-link,$CROSSTOOLS/$CTARGET/lib" \
28 ../$name-$version/configure --build=$CHOST \
32 --libexecdir=/usr/lib \
33 --enable-languages=c,c++ \
34 --enable-threads=posix \
36 --enable-__cxa_atexit \
37 --enable-clocale=gnu \
39 --disable-libstdcxx-pch \
42 # prevent GCC from looking in the wrong directories for headers and libraries
43 sed "/^HOST_\(GMP\|PPL\|CLOOG\)\(LIBS\|INC\)/s:-[IL]/\(lib\|include\)::" -i Makefile
46 make -j1 DESTDIR=$PKG install
49 ln -sf ../usr/bin/cpp $PKG/lib/cpp
50 ln -sf gcc $PKG/usr/bin/cc
51 ln -sf g++ $PKG/usr/bin/c++
52 mv $PKG/usr/lib/gcc/*/$version/include-fixed/{limits.h,syslimits.h} $PKG/usr/lib/gcc/*/$version/include/
53 rm -rf $PKG/usr/info $PKG/usr/lib/libiberty.a \
54 $PKG/usr/bin/*-linux-gnu-* \
55 $PKG/usr/lib/gcc/*/$version/install-tools \
56 $PKG/usr/lib/gcc/*/$version/include/README \
57 $PKG/usr/lib/gcc/*/$version/include-fixed
59 sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib/{libstdc++.la,libsupc++.la}