wok-next view glibc/receipt @ rev 13355
Add naim
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Sep 10 16:30:34 2012 +0200 (2012-09-10) |
parents | 52fadc2d223d |
children | 380ffe05937a |
line source
1 # SliTaz package receipt.
3 PACKAGE="glibc"
4 VERSION="2.14.1"
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 autoconf bash"
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 # Glibc Bug Fixes Patch from LFS
24 patch -Np1 -i $stuff/glibc-2.14.1-fixes-1.patch
25 # Glibc Bug Sort Relocatable Objects Patch
26 patch -Np1 -i $stuff/glibc-2.14.1-sort-1.patch
27 # Fix a bug that prevents Glibc from building with GCC-4.6.2
28 patch -Np1 -i stuff/glibc-2.14.1-gcc_fix-1.patch
30 # Build in a separate directory.
31 mkdir ../glibc-build && cd ../glibc-build
33 # glibc no longer support i386, so use -march=i486 for better compatibility.
34 # If i686 ???
35 unset CFLAGS CXXFLAGS
36 case $ARCH in
37 i386|i486)
38 echo "CFLAGS += -O2 -march=i486 -mtune=i486" > configparms ;;
39 *)
40 echo "CFLAGS += -O2 -march=$ARCH -mtune=$ARCH" > configparms ;;
41 esac
43 { $src/configure \
44 --host=$HOST_SYSTEM \
45 --build=$($src/scripts/config.guess) \
46 --disable-profile --enable-add-ons \
47 --enable-kernel=2.6.30 --with-headers=/tools/include \
48 libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes &&
49 make &&
50 make install
51 } || return 1
53 # Link compiler to this new glibc.
54 SPECS=`dirname $($HOST_SYSTEM-gcc -print-libgcc-file-name)`/specs
55 $HOST_SYSTEM-gcc -dumpspecs | sed \
56 -e 's@/lib\(64\)\?/ld@/tools&@g' \
57 -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS
58 unset SPECS
59 }
61 # Rules to configure and make the package.
62 compile_rules()
63 {
64 cd $src
66 # SliTaz is a Busybox based OS, why we so small and fast. Using gawk by
67 # default to build package will not ensure package work with Busybox awk
68 # and so should NOT be use to cook.
69 if [ -x /usr/bin/cook ]; then
70 [ -d "/var/lib/tazpkg/installed/gawk" ] || tazpkg get-install gawk
71 fi
73 # Fixes and patches from LFS, Redhat
74 sed -i -e 's/"db1"/& \&\& $name ne "nss_test1"/' scripts/test-installation.pl
75 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
77 # Glibc misc Bug Fixes
78 patch -Np1 -i $stuff/glibc-2.14.1-fixes-1.patch
80 # Glibc Bug Sort Relocatable Objects Patch
81 #patch -Np1 -i $stuff/glibc-2.14.1-sort-1.patch
83 # Fix a bug that prevents Glibc from building with GCC-4.6.2
84 patch -Np1 -i $stuff/glibc-2.14.1-gcc_fix-1.patch
86 # Revert commit causing issues with crappy DNS servers
87 patch -Np1 -i $stuff/glibc-2.14-revert-4768ae77.patch
89 # re-export RPC interface until libtirpc is ready as a replacement
90 # http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=acee4873 (only fedora branch...)
91 patch -Np1 -i $stuff/glibc-2.14-reexport-rpc-interface.patch
92 # http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=bdd816a3 (only fedora branch...)
93 patch -Np1 -i $stuff/glibc-2.14-reinstall-nis-rpc-headers.patch
95 # Fix a stack imbalance that occurs under some conditions:
96 sed -i '195,213 s/PRIVATE_FUTEX/FUTEX_CLOCK_REALTIME/' \
97 nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S \
98 nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
100 # Glibc needs ld.so.conf in the install destdir.
101 mkdir -p $WOK/$PACKAGE/install/etc
102 touch $WOK/$PACKAGE/install/etc/ld.so.conf
103 mkdir ../glibc-build && cd ../glibc-build
105 # Read the INSTALL file in glibc. Also Glibc dont build with -Os flag.
106 # --enale-kernel use latest SliTaz Kernel version. From Glibc INSTALL:
107 # "The higher the VERSION number is, the less compatibility code is
108 # added, and the faster the code gets."
109 unset CFLAGS CXXFLAGS
110 case "$ARCH" in
111 i386|i486)
112 echo "CFLAGS += -O2 -march=i486 -mtune=i486" > configparms ;;
113 *)
114 echo "CFLAGS += -O2 -march=$ARCH -mtune=$ARCH" > configparms ;;
115 esac
116 { $src/configure \
117 --disable-profile \
118 --enable-add-ons \
119 --enable-kernel=2.6.30 \
120 --libexecdir=/usr/lib/glibc \
121 --build=$HOST_SYSTEM \
122 --host=$HOST_SYSTEM \
123 --target=$BUILD_SYSTEM &&
124 make && make install_root=$DESTDIR install
125 } || return 1
127 # If temporary toolchain was previously used, switch to regular toolchain.
128 [ -d /tools ] || return
129 mv /tools/bin/ld /tools/bin/ld-old
130 mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old
131 mv /tools/bin/ld-new /tools/bin/ld
132 ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
133 gcc -dumpspecs | sed -e 's@/tools@@g' \
134 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
135 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
136 `dirname $(gcc --print-libgcc-file-name)`/specs
137 }
139 # Rules to gen a SliTaz package suitable for Tazpkg.
140 genpkg_rules()
141 {
142 LOCALE=""
143 mkdir -p $fs/var
145 # Remove build directory.
146 rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
147 rm -rf $WOK/$PACKAGE/$PACKAGE-build
148 }