| 1 | # Description: The C library used in the GNU system |
| 2 | # URL: http://www.gnu.org/software/libc/ |
| 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: |
| 6 | |
| 7 | name=glibc |
| 8 | version=2.12.2 |
| 9 | release=2 |
| 10 | source=(http://ftp.gnu.org/gnu/glibc/glibc-$version.tar.xz \ |
| 11 | ftp://ftp.gnu.org/gnu/$name/$name-ports-2.12.1.tar.bz2 \ |
| 12 | ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.35.tar.gz \ |
| 13 | glibc-ignore_origin.patch \ |
| 14 | Optimize-__getpagesize-a-bit.patch \ |
| 15 | $name-$version-cross_hacks-2.patch \ |
| 16 | hosts resolv.conf nsswitch.conf host.conf ld.so.conf) |
| 17 | |
| 18 | build() { |
| 19 | # install build kernel headers |
| 20 | cd linux-2.6.35 |
| 21 | make mrproper |
| 22 | make ARCH=arm headers_check |
| 23 | make ARCH=arm INSTALL_HDR_PATH=$PKG/usr headers_install |
| 24 | |
| 25 | cd $SRC |
| 26 | mv $name-ports-2.12.1 $name-$version/ports |
| 27 | |
| 28 | pushd $name-$version |
| 29 | patch -p1 -i $SRC/$name-$version-cross_hacks-2.patch |
| 30 | patch -R -p1 -i $SRC/Optimize-__getpagesize-a-bit.patch |
| 31 | patch -p1 -i $SRC/$name-ignore_origin.patch |
| 32 | popd |
| 33 | |
| 34 | mkdir build |
| 35 | cd build |
| 36 | |
| 37 | cat > config.cache << EOF |
| 38 | libc_cv_gnu89_inline=yes |
| 39 | ac_cv_sizeof_long_double=0 |
| 40 | EOF |
| 41 | |
| 42 | ../$name-$version/configure --build=$CHOST \ |
| 43 | --host=$CTARGET \ |
| 44 | --prefix=/usr \ |
| 45 | --libexecdir=/usr/lib \ |
| 46 | --with-headers=$PKG/usr/include \ |
| 47 | --with-tls \ |
| 48 | --enable-kernel=2.6.0 \ |
| 49 | --enable-add-ons \ |
| 50 | --disable-profile \ |
| 51 | --without-gd \ |
| 52 | --with-__thread |
| 53 | |
| 54 | make CC="$CC" CFLAGS="$CFLAGS" |
| 55 | make install_root=$PKG install |
| 56 | |
| 57 | cp $SRC/{hosts,resolv.conf,nsswitch.conf,host.conf,ld.so.conf} $PKG/etc |
| 58 | ln -sf ../usr/share/zoneinfo/UTC $PKG/etc/localtime |
| 59 | mkdir -p $PKG/etc/ld.so.conf.d $PKG/usr/lib/locale |
| 60 | |
| 61 | rm -rf $PKG/usr/share/{info,locale} |
| 62 | } |