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