wok-undigest annotate glibc/receipt @ rev 682

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