wok view glibc/receipt @ rev 10315

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