#!/bin/bash
set +h
set -e

cd $PKGDIR
expect -c "spawn ls" >> $TEST_LOG 2>&1
rm -fv etc/standards.info
sed -i.bak '/^INFO/s/standards.info //' etc/Makefile.in
patch -Np1 -i ../binutils-2.23.1-testsuite_fix-1.patch
mkdir -v ../binutils-build
cd ../binutils-build
../binutils-2.23.1/configure --prefix=/usr --enable-shared
make tooldir=/usr
make -k check >> $TEST_LOG 2>&1 || true
make tooldir=/usr install
cp -v ../binutils-2.23.1/include/libiberty.h /usr/include
echo -e "\n\nTotalseconds: $SECONDS\n"
exit
