wok-4.x rev 8172

imported patch toolchain/binutils.patch
author Antoine Bodin <gokhlayeh@slitaz.org>
date Thu Jan 27 00:20:49 2011 +0100 (2011-01-27)
parents fa7b7514e1d8
children a0d1333e073b
files binutils/receipt
line diff
     1.1 --- a/binutils/receipt	Thu Jan 27 00:20:49 2011 +0100
     1.2 +++ b/binutils/receipt	Thu Jan 27 00:20:49 2011 +0100
     1.3 @@ -1,41 +1,66 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="binutils"
     1.7 -VERSION="2.20.1"
     1.8 +VERSION="2.21"
     1.9  CATEGORY="development"
    1.10  SHORT_DESC="GNU assembler, linker and binary utilities."
    1.11  MAINTAINER="pankso@slitaz.org"
    1.12  TARBALL="$PACKAGE-$VERSION.tar.bz2"
    1.13 -DEPENDS="zlib"
    1.14 -BUILD_DEPENDS="zlib-dev texinfo"
    1.15 +DEPENDS="glibc zlib"
    1.16 +BUILD_DEPENDS="glibc zlib"
    1.17  WEB_SITE="http://www.gnu.org/software/binutils/"
    1.18  WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
    1.19  PROVIDE="libbfd"
    1.20  TAGS="assembler linker"
    1.21  
    1.22 +# Rules to compile & install the temporary toolchain.
    1.23 +precook_tmp_toolchain()
    1.24 +{
    1.25 +	mkdir -p binutils-build && cd binutils-build
    1.26 +	{ $src/configure \
    1.27 +		--target=$BUILD_HOST --disable-nls \
    1.28 +		--disable-werror &&
    1.29 +	make
    1.30 +	 } || return 1
    1.31 +
    1.32 +	#If building on x86_64, create a symlink to ensure the sanity of the toolchain.
    1.33 +	[ "$ARCH" = x86_64 ] && mkdir /tools/lib && ln -s lib /tools/lib64
    1.34 +
    1.35 +	make install
    1.36 +}
    1.37 +
    1.38 +cook_tmp_toolchain()
    1.39 +{
    1.40 +	mkdir -p binutils-build && cd binutils-build
    1.41 +	{ CC="$BUILD_HOST-gcc -B/tools/lib/" \
    1.42 +		AR=$BUILD_HOST-ar RANLIB=$BUILD_HOST-ranlib \
    1.43 +		$src/configure \
    1.44 +		--disable-nls --with-lib-path=/tools/lib &&
    1.45 +	make &&
    1.46 +	make install &&
    1.47 +	make -C ld clean &&
    1.48 +	make -C ld LIB_PATH=/usr/lib:/lib 
    1.49 +	} || return 1
    1.50 +	cp ld/ld-new /tools/bin
    1.51 +}
    1.52 +
    1.53  # Rules to configure and make the package.
    1.54 -#
    1.55  compile_rules()
    1.56  {
    1.57  	mkdir -p binutils-build && cd binutils-build
    1.58 -	../$PACKAGE-$VERSION/configure \
    1.59 +	$src/configure \
    1.60  		--program-prefix=$TOOLPREFIX \
    1.61 -		--prefix=/usr \
    1.62 -		--infodir=/usr/share/info \
    1.63 -		--mandir=/usr/share/man \
    1.64 -		--enable-shared \
    1.65 -		$CONFIGURE_ARGS &&
    1.66 -	make -j 4 tooldir=/usr &&
    1.67 +		--enable-shared &&
    1.68 +	make tooldir=/usr &&
    1.69  	# Install in binutils-build/ and then move the files to
    1.70  	# to the source tree. Can't install directly... This is done
    1.71  	# to keep the $src and $_pkg working for genpkg.
    1.72 -	make tooldir=/usr DESTDIR=$PWD/_pkg install &&
    1.73 -	mv _pkg ../$PACKAGE-$VERSION/ &&
    1.74 +	make tooldir=/usr install &&
    1.75  	# This is the default binutils, so create symlinks
    1.76  	# to the target platform binutil binaries.
    1.77  	# Delete duplicate binaries to save space.
    1.78 -	for binutil in $(ls -1 $src/_pkg/usr/bin/ | grep "${TOOLPREFIX}") ; do
    1.79 -		genericBinutilPath="$src/_pkg/usr/bin/$(echo "$binutil" | sed "s:$TOOLPREFIX::g")"
    1.80 +	for binutil in $(ls -1 $DESTDIR/usr/bin/ | grep "${TOOLPREFIX}") ; do
    1.81 +		genericBinutilPath="$DESTDIR/usr/bin/$(echo "$binutil" | sed "s:$TOOLPREFIX::g")"
    1.82  		if [ -e $genericBinutilPath ] ; then
    1.83  			rm -f $genericBinutilPath
    1.84  		fi
    1.85 @@ -57,4 +82,7 @@
    1.86  	# Remove 'strings' (Busybox).
    1.87  	#rm $fs/usr/lib/libiberty.a
    1.88  	rm $fs/usr/bin/strings $fs/usr/bin/*-strings
    1.89 +	
    1.90 +	# Remove build directory.
    1.91 +	rm -r $WOK/$PACKAGE/$PACKAGE-build
    1.92  }