wok-current diff glibc/receipt @ rev 8208

imported patch toolchain/perl-core.patch
author Antoine Bodin <gokhlayeh@slitaz.org>
date Thu Jan 27 00:20:50 2011 +0100 (2011-01-27)
parents e4319b0b765a
children d778beb035e4
line diff
     1.1 --- a/glibc/receipt	Sat Jul 10 18:02:56 2010 +0200
     1.2 +++ b/glibc/receipt	Thu Jan 27 00:20:50 2011 +0100
     1.3 @@ -1,39 +1,96 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="glibc"
     1.7 -VERSION="2.11.2"
     1.8 +VERSION="2.12.2"
     1.9  CATEGORY="meta"
    1.10  SHORT_DESC="The GNU C libraries. This package is used to compile the libc."
    1.11  MAINTAINER="pankso@slitaz.org"
    1.12  DEPENDS="glibc-base glibc-locale glibc-dev"
    1.13 -BUILD_DEPENDS="slitaz-toolchain gawk perl"
    1.14 +BUILD_DEPENDS="linux-api-headers"
    1.15  TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.16  WEB_SITE="http://www.gnu.org/software/libc/"
    1.17  WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
    1.18 +# Genpkg order: glibc-base, glibc-locale, glibc-dev.
    1.19 +COOK_OPT="genpkg=glibc-base:glib-locale:glibc-dev"
    1.20 +	
    1.21 +# Rules to compile & install the temporary toolchain.
    1.22 +cook_tmp_toolchain()
    1.23 +{
    1.24 +	cd $src
    1.25 +
    1.26 +	# Fix a bug that prevents Glibc from building with GCC-4.5.2:
    1.27 +	patch -Np1 -i ../stuff/glibc-2.12.2-gcc_fix-1.patch
    1.28 +
    1.29 +	# Build in a separate directory.
    1.30 +	mkdir ../glibc-build && cd ../glibc-build
    1.31 +
    1.32 +	# glibc no longer support i386, so use -march=i486 for better compatibility.
    1.33 +	case $ARCH in
    1.34 +		i?86) echo "CFLAGS += -march=i486 -mtune=native" > configparms ;;
    1.35 +	esac
    1.36 +
    1.37 +	{ $src/configure \
    1.38 +		--host=$BUILD_HOST \
    1.39 +		--build=$($src/scripts/config.guess) \
    1.40 +		--disable-profile --enable-add-ons \
    1.41 +		--enable-kernel=2.6.22.5 --with-headers=/tools/include \
    1.42 +		libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes &&
    1.43 +	make &&
    1.44 +	make install
    1.45 +	} || return 1
    1.46 +
    1.47 +	# Link compiler to this new glibc.
    1.48 +	SPECS=`dirname $($BUILD_HOST-gcc -print-libgcc-file-name)`/specs
    1.49 +	$BUILD_HOST-gcc -dumpspecs | sed \
    1.50 +		-e 's@/lib\(64\)\?/ld@/tools&@g' \
    1.51 +		-e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS 
    1.52 +	unset SPECS
    1.53 +}
    1.54  
    1.55  # Rules to configure and make the package.
    1.56 -#
    1.57 -# Build order: glibc, glibc-base, glibc-locale, glibc-dev.
    1.58 -#
    1.59  compile_rules()
    1.60  {
    1.61 -	mkdir glibc-build
    1.62 -	cd glibc-build
    1.63 +	# Some patch are needed to make things work correctly.
    1.64 +	# Following patches and sed fixes comes from LFS development book :
    1.65 +	# http://www.linuxfromscratch.org/lfs/view/development/chapter06/glibc.html
    1.66 +	cd $src
    1.67 +	DL=$(readelf -l /bin/sh | sed -n 's@.*interpret.*/tools\(.*\)]$@\1@p')
    1.68 +	sed -i "s|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=$DL -o|" \
    1.69 +		scripts/test-installation.pl
    1.70 +	unset DL
    1.71 +	sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
    1.72 +
    1.73 +	# Fix a bug that prevents Glibc from building with GCC-4.5.2:
    1.74 +	patch -Np1 -i ../stuff/glibc-2.12.2-gcc_fix-1.patch
    1.75 +
    1.76 +	mkdir ../glibc-build
    1.77 +	cd ../glibc-build
    1.78 +
    1.79  	# Install in the build tree and then move all files
    1.80  	# to the source tree to keep $src and $_pkg for genpkg.
    1.81 -	mkdir -p ../$PACKAGE-$VERSION/_pkg/etc
    1.82 -	touch ../$PACKAGE-$VERSION/_pkg/etc/ld.so.conf
    1.83 -	#echo "CFLAGS += -march=i486 -mtune=native -O3 -pipe" > configparms
    1.84 -	../$PACKAGE-$VERSION/configure \
    1.85 -		--prefix=/usr \
    1.86 -		--infodir=/usr/share/info \
    1.87 +	mkdir -p $WOK/$PACKAGE/install/etc
    1.88 +	touch $WOK/$PACKAGE/install/etc/ld.so.conf
    1.89 +	echo "CFLAGS += $CFLAGS" > configparms
    1.90 +	{ $src/configure \
    1.91  		--disable-profile \
    1.92  		--enable-add-ons \
    1.93 -		--enable-kernel=2.6.18 \
    1.94 -		--libexecdir=/usr/lib/glibc \
    1.95 -		$CONFIGURE_ARGS &&
    1.96 -	make -j 4 &&
    1.97 -	make install_root=$(cd ../$PACKAGE-$VERSION ; pwd)/_pkg install
    1.98 +		--enable-kernel=2.6.22.5 \
    1.99 +		--libexecdir=/usr/lib/glibc &&
   1.100 +	make &&
   1.101 +	make install_root=$DESTDIR install
   1.102 +	} || return 1
   1.103 +
   1.104 +	# If temporary toolchain was previously used, switch to
   1.105 +	# regular toolchain.
   1.106 +	[ -d /tools ] || return
   1.107 +	mv /tools/bin/ld /tools/bin/ld-old
   1.108 +	mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old
   1.109 +	mv /tools/bin/ld-new /tools/bin/ld
   1.110 +	ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
   1.111 +	gcc -dumpspecs | sed -e 's@/tools@@g' \
   1.112 +		-e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
   1.113 +		-e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
   1.114 +		`dirname $(gcc --print-libgcc-file-name)`/specs
   1.115  }
   1.116  
   1.117  # Rules to gen a SliTaz package suitable for Tazpkg.
   1.118 @@ -41,10 +98,7 @@
   1.119  {
   1.120  	LOCALE=""
   1.121  	mkdir -p $fs/var
   1.122 -	for i in $(grep -l '^WANTED="glibc"' $WOK/*/receipt); do
   1.123 -		tazwok genpkg $(basename $(dirname $i))
   1.124 -	done
   1.125 -	echo ""
   1.126 -	echo "--> Install glibc-base, glibc-dev and cook busybox"
   1.127 -	echo ""
   1.128 +
   1.129 +	# Remove build directory.
   1.130 +	rm -r $WOK/$PACKAGE/$PACKAGE-build
   1.131  }