wok-current view glibc/receipt @ rev 8613
Fix bdep: ario needs intltool to compile
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Mon Feb 14 18:31:12 2011 +0100 (2011-02-14) |
parents | e4319b0b765a |
children | d778beb035e4 |
line source
1 # SliTaz package receipt.
3 PACKAGE="glibc"
4 VERSION="2.12.2"
5 CATEGORY="meta"
6 SHORT_DESC="The GNU C libraries. This package is used to compile the libc."
7 MAINTAINER="pankso@slitaz.org"
8 DEPENDS="glibc-base glibc-locale glibc-dev"
9 BUILD_DEPENDS="linux-api-headers"
10 TARBALL="$PACKAGE-$VERSION.tar.gz"
11 WEB_SITE="http://www.gnu.org/software/libc/"
12 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
13 # Genpkg order: glibc-base, glibc-locale, glibc-dev.
14 COOK_OPT="genpkg=glibc-base:glib-locale:glibc-dev"
16 # Rules to compile & install the temporary toolchain.
17 cook_tmp_toolchain()
18 {
19 cd $src
21 # Fix a bug that prevents Glibc from building with GCC-4.5.2:
22 patch -Np1 -i ../stuff/glibc-2.12.2-gcc_fix-1.patch
24 # Build in a separate directory.
25 mkdir ../glibc-build && cd ../glibc-build
27 # glibc no longer support i386, so use -march=i486 for better compatibility.
28 case $ARCH in
29 i?86) echo "CFLAGS += -march=i486 -mtune=native" > configparms ;;
30 esac
32 { $src/configure \
33 --host=$BUILD_HOST \
34 --build=$($src/scripts/config.guess) \
35 --disable-profile --enable-add-ons \
36 --enable-kernel=2.6.22.5 --with-headers=/tools/include \
37 libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes &&
38 make &&
39 make install
40 } || return 1
42 # Link compiler to this new glibc.
43 SPECS=`dirname $($BUILD_HOST-gcc -print-libgcc-file-name)`/specs
44 $BUILD_HOST-gcc -dumpspecs | sed \
45 -e 's@/lib\(64\)\?/ld@/tools&@g' \
46 -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS
47 unset SPECS
48 }
50 # Rules to configure and make the package.
51 compile_rules()
52 {
53 # Some patch are needed to make things work correctly.
54 # Following patches and sed fixes comes from LFS development book :
55 # http://www.linuxfromscratch.org/lfs/view/development/chapter06/glibc.html
56 cd $src
57 DL=$(readelf -l /bin/sh | sed -n 's@.*interpret.*/tools\(.*\)]$@\1@p')
58 sed -i "s|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=$DL -o|" \
59 scripts/test-installation.pl
60 unset DL
61 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
63 # Fix a bug that prevents Glibc from building with GCC-4.5.2:
64 patch -Np1 -i ../stuff/glibc-2.12.2-gcc_fix-1.patch
66 mkdir ../glibc-build
67 cd ../glibc-build
69 # Install in the build tree and then move all files
70 # to the source tree to keep $src and $_pkg for genpkg.
71 mkdir -p $WOK/$PACKAGE/install/etc
72 touch $WOK/$PACKAGE/install/etc/ld.so.conf
73 echo "CFLAGS += $CFLAGS" > configparms
74 { $src/configure \
75 --disable-profile \
76 --enable-add-ons \
77 --enable-kernel=2.6.22.5 \
78 --libexecdir=/usr/lib/glibc &&
79 make &&
80 make install_root=$DESTDIR install
81 } || return 1
83 # If temporary toolchain was previously used, switch to
84 # regular toolchain.
85 [ -d /tools ] || return
86 mv /tools/bin/ld /tools/bin/ld-old
87 mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old
88 mv /tools/bin/ld-new /tools/bin/ld
89 ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
90 gcc -dumpspecs | sed -e 's@/tools@@g' \
91 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
92 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
93 `dirname $(gcc --print-libgcc-file-name)`/specs
94 }
96 # Rules to gen a SliTaz package suitable for Tazpkg.
97 genpkg_rules()
98 {
99 LOCALE=""
100 mkdir -p $fs/var
102 # Remove build directory.
103 rm -r $WOK/$PACKAGE/$PACKAGE-build
104 }