version=2.37
source=(http://ftp.gnu.org/gnu/binutils/binutils-$version.tar.xz)

build() {
cd binutils-$version

mkdir -v build
cd build

CC=$LFS_TARGET-gcc         \
AR=$LFS_TARGET-ar          \
RANLIB=$LFS_TARGET-ranlib  \
../configure               \
    --prefix=/tools        \
    --disable-nls          \
    --disable-werror       \
    --with-lib-path=/tools/lib \
    --with-sysroot

make
make install
make -C ld clean
make -C ld LIB_PATH=/usr/lib:/lib
cp -v ld/ld-new /tools/bin
}
