wok-next view glibc/receipt @ rev 10370
xorg-libXinerama: fix again
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Mon May 23 03:44:45 2011 +0200 (2011-05-23) |
parents | df16b3fe1a42 |
children | f7fe51b9dfae |
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 TARBALL="$PACKAGE-$VERSION.tar.gz"
9 WEB_SITE="http://www.gnu.org/software/libc/"
10 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
12 DEPENDS="glibc-base glibc-locale glibc-dev"
13 BUILD_DEPENDS="linux-api-headers"
15 # Genpkg order for tazwok.
16 COOK_OPT="genpkg=glibc-base:glibc-extra-samba:glib-locale:glibc-dev"
18 # Rules to compile & install the temporary toolchain.
19 cook_tmp_toolchain()
20 {
21 cd $src
23 # Fix a bug that prevents Glibc from building with GCC-4.5.2:
24 patch -Np1 -i $stuff/glibc-2.13-gcc_fix-1.patch
26 # Build in a separate directory.
27 mkdir ../glibc-build && cd ../glibc-build
29 # glibc no longer support i386, so use -march=i486 for better compatibility.
30 # If i686 ???
31 case $ARCH in
32 i?86) echo "CFLAGS += -march=i486 -mtune=native" > configparms ;;
33 esac
35 { $src/configure \
36 --host=$BUILD_HOST \
37 --build=$($src/scripts/config.guess) \
38 --disable-profile --enable-add-ons \
39 --enable-kernel=2.6.22.5 --with-headers=/tools/include \
40 libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes &&
41 make &&
42 make install
43 } || return 1
45 # Link compiler to this new glibc.
46 SPECS=`dirname $($BUILD_HOST-gcc -print-libgcc-file-name)`/specs
47 $BUILD_HOST-gcc -dumpspecs | sed \
48 -e 's@/lib\(64\)\?/ld@/tools&@g' \
49 -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS
50 unset SPECS
51 }
53 # Rules to configure and make the package.
54 compile_rules()
55 {
56 cd $src
58 # SliTaz is a Busybox based OS, why we so small and fast. Using gawk by
59 # default to build package will not ensure package work with Busybox awk
60 # and so should NOT be use to cook.
61 if [ -x /usr/bin/cook ]; then
62 [ -d "/var/lib/tazpkg/installed/gawk" ] || tazpkg get-install gawk
63 fi
65 # Following patches and sed fixes comes from LFS development book:
66 # http://www.linuxfromscratch.org/lfs/view/development/chapter06/glibc.html
67 DL=$(readelf -l /bin/sh | sed -n 's@.*interpret.*/tools\(.*\)]$@\1@p')
68 sed -i "s|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=$DL -o|" \
69 scripts/test-installation.pl
70 unset DL
71 sed -i -e 's/"db1"/& \&\& $name ne "nss_test1"/' scripts/test-installation.pl
72 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
74 # Fix a bug that prevents Glibc from building with GCC-4.5.2:
75 patch -Np1 -i $stuff/glibc-2.13-gcc_fix-1.patch
77 # Fix a stack imbalance that occurs under some conditions:
78 sed -i '195,213 s/PRIVATE_FUTEX/FUTEX_CLOCK_REALTIME/' \
79 nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S \
80 nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
82 # Glibc needs ld.so.conf in the install destdir.
83 mkdir -p $WOK/$PACKAGE/install/etc
84 touch $WOK/$PACKAGE/install/etc/ld.so.conf
85 mkdir ../glibc-build && cd ../glibc-build
87 # Read the INSTALL file in glibc. Also Glibc dont build with -Os flag.
88 # --enale-kernel use latest SliTaz Kernel version. From Glibc INSTALL:
89 # "The higher the VERSION number is, the less compatibility code is
90 # added, and the faster the code gets."
91 unset CFLAGS CXXFLAGS
92 case "$ARCH" in
93 i386|i486)
94 echo "CFLAGS += -O2 -march=i486 -mtune=native" > configparms ;;
95 *)
96 echo "CFLAGS += -O2 -march=$ARCH -mtune=native" > configparms ;;
97 esac
98 { $src/configure \
99 --disable-profile \
100 --enable-add-ons \
101 --enable-kernel=2.6.30 \
102 --libexecdir=/usr/lib/glibc \
103 --build=$HOST_SYSTEM \
104 --host=$HOST_SYSTEM &&
105 make && make install_root=$DESTDIR install
106 } || return 1
108 # If temporary toolchain was previously used, switch to regular toolchain.
109 [ -d /tools ] || return
110 mv /tools/bin/ld /tools/bin/ld-old
111 mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old
112 mv /tools/bin/ld-new /tools/bin/ld
113 ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
114 gcc -dumpspecs | sed -e 's@/tools@@g' \
115 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
116 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
117 `dirname $(gcc --print-libgcc-file-name)`/specs
118 }
120 # Rules to gen a SliTaz package suitable for Tazpkg.
121 genpkg_rules()
122 {
123 LOCALE=""
124 mkdir -p $fs/var
126 # Remove build directory.
127 rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
128 rm -rf $WOK/$PACKAGE/$PACKAGE-build
129 }