Updated toolchain for CRUX 3.0.
[crux-arm-cross-compiler.git] / arm-gcc / Pkgfile
1 # Description: ARM cross compiler
2 # URL:         http://gcc.gnu.org
3 # Depends on:  libgmp libmpfr arm-binutils arm-glibc
4
5 name=arm-gcc
6 version=4.7.2
7 release=1
8 source=(ftp://sources.redhat.com/pub/gcc/releases/gcc-$version/gcc-$version.tar.bz2)
9
10 build() {
11     local TARGET=armv5tel-softfloat-linux-gnueabi
12
13     sed -i 's|REVISION|REVISION " (CRUX)"|' gcc-$version/gcc/version.c
14
15     mkdir build
16     cd build
17
18     unset CFLAGS
19     unset CXXFLAGS
20     unset CC
21
22     AR=ar \
23     ../gcc-$version/configure \
24         --prefix=/usr \
25         --mandir=/usr/man \
26         --build=x86_64-cross-linux-gnu \
27         --host=x86_64-cross-linux-gnu \
28         --target=$TARGET \
29         --libexecdir=/usr/lib \
30         --enable-languages=c,c++ \
31         --enable-threads=posix \
32         --enable-__cxa_atexit \
33         --disable-nls \
34         --with-system-zlib \
35         --disable-multilib \
36         --with-headers=/usr/$TARGET/include \
37         --without-fp
38
39     make
40     make -j1 DESTDIR=$PKG install
41
42     rm $PKG/usr/bin/$TARGET-gcc-{ar,nm,ranlib}
43     rm $PKG/usr/lib/libiberty.a
44
45     rm $PKG/usr/man/man7/{fsf-funding,gfdl,gpl}.7
46     rmdir $PKG/usr/man/man7
47
48     rm -rf $PKG/usr/share/info
49
50     $TARGET-strip --strip-debug \
51         $PKG/usr/$TARGET/lib/libgomp.a \
52         $PKG/usr/$TARGET/lib/libmudflap.a \
53         $PKG/usr/$TARGET/lib/libmudflapth.a \
54         $PKG/usr/$TARGET/lib/libssp.a \
55         $PKG/usr/$TARGET/lib/libssp_nonshared.a \
56         $PKG/usr/$TARGET/lib/libstdc++.a \
57         $PKG/usr/$TARGET/lib/libsupc++.a \
58         $PKG/usr/lib/gcc/$TARGET/$version/libgcc.a \
59         $PKG/usr/lib/gcc/$TARGET/$version/libgcc_eh.a \
60         $PKG/usr/lib/gcc/$TARGET/$version/libgcov.a
61
62     $TARGET-strip --strip-unneeded \
63         $PKG/usr/$TARGET/lib/libgcc_s.so.1 \
64         $PKG/usr/$TARGET/lib/libgomp.so.1.0.0 \
65         $PKG/usr/$TARGET/lib/libitm.so.1.0.0 \
66         $PKG/usr/$TARGET/lib/libmudflap.so.0.0.0 \
67         $PKG/usr/$TARGET/lib/libmudflapth.so.0.0.0 \
68         $PKG/usr/$TARGET/lib/libssp.so.0.0.0 \
69         $PKG/usr/$TARGET/lib/libstdc++.so.6.0.17
70 }