wok-6.x view glibc/receipt @ rev 8922
Fix gob2: add bdep flex
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Tue Mar 01 02:33:54 2011 +0100 (2011-03-01) |
parents | c906b3acf847 |
children | 21ca332597c4 |
line source
1 # SliTaz package receipt.
3 PACKAGE="glibc"
4 VERSION="2.13"
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.13-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 -e 's/"db1"/& \&\& $name ne "nss_test1"/' scripts/test-installation.pl
62 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
64 # Fix a bug that prevents Glibc from building with GCC-4.5.2:
65 patch -Np1 -i ../stuff/glibc-2.13-gcc_fix-1.patch
67 # Fix a stack imbalance that occurs under some conditions:
68 sed -i '195,213 s/PRIVATE_FUTEX/FUTEX_CLOCK_REALTIME/' \
69 nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S \
70 nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
72 mkdir ../glibc-build
73 cd ../glibc-build
75 # Install in the build tree and then move all files
76 # to the source tree to keep $src and $_pkg for genpkg.
77 mkdir -p $WOK/$PACKAGE/install/etc
78 touch $WOK/$PACKAGE/install/etc/ld.so.conf
79 echo "CFLAGS += $CFLAGS" > configparms
80 { $src/configure \
81 --disable-profile \
82 --enable-add-ons \
83 --enable-kernel=2.6.22.5 \
84 --libexecdir=/usr/lib/glibc &&
85 make &&
86 make install_root=$DESTDIR install
87 } || return 1
89 # If temporary toolchain was previously used, switch to
90 # regular toolchain.
91 [ -d /tools ] || return
92 mv /tools/bin/ld /tools/bin/ld-old
93 mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old
94 mv /tools/bin/ld-new /tools/bin/ld
95 ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
96 gcc -dumpspecs | sed -e 's@/tools@@g' \
97 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
98 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
99 `dirname $(gcc --print-libgcc-file-name)`/specs
100 }
102 # Rules to gen a SliTaz package suitable for Tazpkg.
103 genpkg_rules()
104 {
105 LOCALE=""
106 mkdir -p $fs/var
108 # Remove build directory.
109 rm -r $WOK/$PACKAGE/$PACKAGE-build
110 }