CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Imported core-cross ports from 2.5
[crossrootfs.git] / gcc / Pkgfile
CommitLineData
6dca1d21
JB
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
6
7name=gcc
8version=4.3.3
9release=1
10source=(ftp://sources.redhat.com/pub/gcc/releases/$name-$version/$name-{core,g++,objc}-$version.tar.bz2
11 $name-$version-nocheck-fixincludes.patch)
12
13
14build() {
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
17
18 cd $name-$version
19 # apply a sed substitutio that will suppress the installation of libiberty.a
20 sed 's|install_to_$(INSTALL_DEST) ||' -i libiberty/Makefile.in
21 # avoid hardcodeds
22 sed 's|@have_mktemp_command@|yes|' -i gcc/gccbug.in
23
24 mkdir $SRC/build
25 cd $SRC/build
26
27 LDFLAGS="-Wl,-rpath-link,$CROSSTOOLS/$CTARGET/lib" \
28 ../$name-$version/configure --build=$CHOST \
29 --host=$CTARGET \
30 --target=$CTARGET \
31 --prefix=/usr \
32 --libexecdir=/usr/lib \
33 --enable-languages=c,c++ \
34 --enable-threads=posix \
35 --enable-shared \
36 --enable-__cxa_atexit \
37 --enable-clocale=gnu \
38 --disable-nls \
39 --disable-libstdcxx-pch \
40 --with-x=no
41
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
44
45 make
46 make -j1 DESTDIR=$PKG install
47
48 mkdir $PKG/lib
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
58
59 sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib/{libstdc++.la,libsupc++.la}
60}
61