PKGBUILDs/n64-toolkit/PKGBUILD.binutils

64 lines
1.6 KiB
Plaintext

_target=mips64
_tuple=$_target-elf-ultra64
_prefix=/opt/$_tuple
pkgname=$_tuple-binutils
pkgver=2.31.1
pkgrel=1
_binutils="binutils-$pkgver"
pkgdesc="A set of programs to assemble and manipulate binary and object files ($_target)"
arch=('any')
license=('GPL')
url='http://www.gnu.org/software/binutils/'
depends=('zlib')
source=("ftp://gcc.gnu.org/pub/binutils/releases/$_binutils.tar.bz2")
md5sums=('84edf97113788f106d6ee027f10b046a')
options=('!emptydirs' '!strip')
prepare() {
cd "$srcdir/$_binutils"
# Hack - see native package for details
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
}
build() {
# the programs we're compiling are really picky about flags.
# it's best to keep it simple.
export CFLAGS="-O2"
export CXXFLAGS="-O2"
export CPPFLAGS=""
export LDFLAGS=""
export CFLAGS_FOR_TARGET="-O2 -G0 \
-fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables"
export CXXFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET -fno-rtti"
cd "$srcdir"
[ -d "build-binutils" ] || mkdir "build-binutils"
cd "build-binutils"
local _build=
if [ -n "$MINGW_CHOST" ]; then
_build="--build=$MINGW_CHOST --host=$MINGW_CHOST"
fi
"../$_binutils/configure" $_build --target=$_target --prefix="$_prefix" \
--enable-static \
--disable-gold \
--disable-multilib \
--disable-nls \
--disable-shared \
--disable-werror \
make all
}
package() {
local PREFIX="$pkgdir$_prefix"
cd "$srcdir/build-binutils"
make DESTDIR="$pkgdir" install -j1
# strip host binaries
find "$PREFIX/bin" -type f -and \( -executable \) -exec strip '{}' \;
}