#!/bin/sh
cd $LFS/usr/src/binutils-*/ ||exit

#this way you get the current cvs version:
#cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/src login
#{enter "anoncvs" as the password}
#cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/src co binutils

#old: use posix syntax:
#patch -p 1 <../binutils-2.16-posix-1.patch

#configure-host is needed for static build
cd .. &&
rm -rf _binutils &&
mkdir _binutils &&
cd _binutils &&
../binutils-*/configure --prefix=/prelfs --disable-nls --disable-werror && # --with-gmp=/prelfs
make &&
make install

#remove all binaries in ld subdir and rebuild with new lib dir
make -C ld clean
make -C ld LIB_PATH="/prelfs/lib"

#do not delete the package yet!!!
