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: libgmp libmpfr
10 source=(ftp://sources.redhat.com/pub/gcc/releases/$name-$version/$name-{core,g++}-$version.tar.bz2
11 $name-nocheck-fixincludes.patch test-demangle.c.diff)
17 patch -p1 -i $SRC/$name-nocheck-fixincludes.patch
18 patch -p0 -i $SRC/test-demangle.c.diff
19 sed -i 's|REVISION|REVISION " (CRUX)"|' $name/version.c
20 # apply a sed substitutio that will suppress the installation of libiberty.a
21 sed 's|install_to_$(INSTALL_DEST) ||' -i libiberty/Makefile.in
23 sed 's|@have_mktemp_command@|yes|' -i gcc/gccbug.in
28 LDFLAGS="-Wl,-rpath-link,$CROSSTOOLS/$CTARGET/lib" \
29 ../$name-$version/configure --build=$CHOST \
33 --libexecdir=/usr/lib \
34 --enable-languages=c,c++ \
35 --enable-threads=posix \
37 --enable-__cxa_atexit \
38 --enable-clocale=gnu \
40 --disable-libstdcxx-pch \
43 # prevent GCC from looking in the wrong directories for headers and libraries
44 sed "/^HOST_\(GMP\|PPL\|CLOOG\)\(LIBS\|INC\)/s:-[IL]/\(lib\|include\)::" -i Makefile
47 make DESTDIR=$PKG install
50 ln -sf ../usr/bin/cpp $PKG/lib/cpp
51 ln -sf gcc $PKG/usr/bin/cc
52 ln -sf g++ $PKG/usr/bin/c++
53 mv $PKG/usr/lib/gcc/*/$version/include-fixed/{limits.h,syslimits.h} $PKG/usr/lib/gcc/*/$version/include/
54 rm -rf $PKG/usr/info $PKG/usr/lib/libiberty.a \
55 $PKG/usr/bin/*-linux-gnu-* \
56 $PKG/usr/lib/gcc/*/$version/install-tools \
57 $PKG/usr/lib/gcc/*/$version/include/README \
58 $PKG/usr/lib/gcc/*/$version/include-fixed
60 sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib/{libstdc++.la,libsupc++.la}