PKGBUILDs/n64-toolkit/PKGBUILD.binutils

64 lines
1.6 KiB
Plaintext
Raw Normal View History

2017-05-16 10:00:05 -07:00
_target=mips64
2018-03-24 20:45:52 -07:00
_tuple=$_target-elf-ultra64
_prefix=/opt/$_tuple
pkgname=$_tuple-binutils
2019-01-23 20:25:05 -08:00
pkgver=2.31.1
2017-05-16 10:00:05 -07:00
pkgrel=1
_binutils="binutils-$pkgver"
2018-03-24 20:45:52 -07:00
pkgdesc="A set of programs to assemble and manipulate binary and object files ($_target)"
2017-05-16 10:00:05 -07:00
arch=('any')
license=('GPL')
2018-03-24 20:45:52 -07:00
url='http://www.gnu.org/software/binutils/'
2017-05-16 10:00:05 -07:00
depends=('zlib')
source=("ftp://gcc.gnu.org/pub/binutils/releases/$_binutils.tar.bz2")
2019-01-23 20:25:05 -08:00
md5sums=('84edf97113788f106d6ee027f10b046a')
2017-05-16 10:00:05 -07:00
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=""
2019-01-25 22:36:38 -08:00
export CFLAGS_FOR_TARGET="-O2 -G0 \
2017-05-16 10:00:05 -07:00
-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
2018-03-24 20:45:52 -07:00
"../$_binutils/configure" $_build --target=$_target --prefix="$_prefix" \
2017-05-16 10:00:05 -07:00
--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 '{}' \;
}