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