Updated toolchain for CRUX 3.0.
[crux-arm-cross-compiler.git] / arm-glibc / Pkgfile
1 # Description: The GNU C library for the ARM cross compiler
2 # URL:         http://www.gnu.org/software/libc/
3 # Depends on:  arm-gcc-interim
4
5 name=arm-glibc
6 version=2.11
7 release=1
8 source=(http://ftp.gnu.org/gnu/glibc/glibc-$version.tar.bz2
9         http://ftp.gnu.org/gnu/glibc/glibc-ports-$version.tar.bz2 
10         http://crux.nu/~tilman/arm-kernel-headers-2.6.33.tar.xz)
11
12 build() {
13     # Don't try to build the manual (its Makefile is broken).
14     sed -i -e 's/manual//' glibc-$version/Makeconfig
15
16     # install kernel headers
17     mkdir -p $PKG/usr/armv5tel-softfloat-linux-gnueabi
18     cp -r arm-kernel-headers-2.6.33/include \
19         $PKG/usr/armv5tel-softfloat-linux-gnueabi
20     chown root:root $PKG/usr/armv5tel-softfloat-linux-gnueabi
21
22     mv glibc-ports-$version glibc-$version/ports
23
24     sed -e 's/-lgcc_eh//g' -i glibc-$version/Makeconfig
25
26     mkdir build
27     cd build
28
29     cat >config.cache<<EOF
30 libc_cv_forced_unwind=yes
31 libc_cv_c_cleanup=yes
32 libc_cv_gnu89_inline=yes
33 EOF
34
35     unset CFLAGS
36     unset CXXFLAGS
37
38     BUILD_CC=gcc CC=armv5tel-softfloat-linux-gnueabi-gcc \
39     AR=armv5tel-softfloat-linux-gnueabi-ar \
40     RANLIB=armv5tel-softfloat-linux-gnueabi-ranlib \
41     ../glibc-$version/configure \
42         --prefix=/usr/armv5tel-softfloat-linux-gnueabi \
43         --libexecdir=/usr/armv5tel-softfloat-linux-gnueabi/lib \
44         --build=x86_64-cross-linux-gnu \
45         --host=armv5tel-softfloat-linux-gnueabi \
46         --with-headers=$PKG/usr/armv5tel-softfloat-linux-gnueabi/include \
47         --with-tls \
48         --enable-kernel=2.6.33 \
49         --enable-add-ons \
50         --disable-profile \
51         --without-gd \
52         --with-fp=no \
53         --with-__thread \
54         --cache-file=config.cache
55
56     make
57     make install_root=$PKG install
58
59     rm -rf $PKG/usr/armv5tel-softfloat-linux-gnueabi/share/{info,locale}
60
61     # I _think_ these aren't needed :)
62     rm -rf $PKG/usr/armv5tel-softfloat-linux-gnueabi/share/{i18n,zoneinfo}
63     rmdir $PKG/usr/armv5tel-softfloat-linux-gnueabi/share
64     rm -rf $PKG/usr/armv5tel-softfloat-linux-gnueabi/{etc,bin,sbin}
65     rm -rf $PKG/usr/armv5tel-softfloat-linux-gnueabi/lib/gconv
66
67     # Strip libraries. We cannot let pkgmk do this; the system's strip
68     # program cannot handle ARM binaries.
69     armv5tel-softfloat-linux-gnueabi-strip --strip-debug \
70         $PKG/usr/armv5tel-softfloat-linux-gnueabi/lib/*.a
71
72     find $PKG/usr/armv5tel-softfloat-linux-gnueabi/lib \
73         -name "*.so" ! -name libc.so ! -name libpthread.so | xargs \
74              armv5tel-softfloat-linux-gnueabi-strip
75 }