aboutsummaryrefslogtreecommitdiffstats
path: root/main/binutils/APKBUILD
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-09-06 11:23:59 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-09-10 08:56:20 +0000
commit9feea1bff91b46702b96d72242a452c5772fc1c1 (patch)
tree6bef58d93b264d95cf7a49b48a247aaaa02d48c2 /main/binutils/APKBUILD
parent90407d04bb534dbd23ea1c373512f0de80fdb6a8 (diff)
downloadaports-9feea1bff91b46702b96d72242a452c5772fc1c1.tar.bz2
aports-9feea1bff91b46702b96d72242a452c5772fc1c1.tar.xz
main/binutils: fix musl build, support crosscompiler creation
Diffstat (limited to 'main/binutils/APKBUILD')
-rw-r--r--main/binutils/APKBUILD29
1 files changed, 21 insertions, 8 deletions
diff --git a/main/binutils/APKBUILD b/main/binutils/APKBUILD
index acc1ad4345..c85a3a4570 100644
--- a/main/binutils/APKBUILD
+++ b/main/binutils/APKBUILD
@@ -1,18 +1,25 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=binutils
pkgver=2.23.2
-pkgrel=0
+pkgrel=1
pkgdesc="Tools necessary to build programs"
url="http://www.gnu.org/software/binutils/"
depends=
makedepends="bison flex texinfo zlib-dev"
arch="all"
license="GPL"
+_pkgname=$pkgname
+
+if [ "$CHOST" != "$CTARGET" ] && [ -n "$CHOST" -a -n "$CTARGET" ]; then
+ pkgname="$pkgname-$CTARGET"
+ somask="libbfd-$pkgver.so libopcodes-$pkgver.so"
+fi
+
subpackages="$pkgname-doc"
source="http://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2
binutils-ld-fix-static-linking.patch"
-_builddir="$srcdir/$pkgname-$pkgver"
+_builddir="$srcdir/$_pkgname-$pkgver"
prepare() {
local i
@@ -25,19 +32,24 @@ prepare() {
;;
esac
done
+
+ update_config_sub || return 1
}
build() {
- cd "$_builddir"
+ local _cross_configure=
+ [ "$CHOST" != "$CTARGET" ] && _cross_configure="--with-sysroot=$CBUILDROOT"
+ cd "$_builddir"
./configure \
--build=$CBUILD \
--host=$CHOST \
+ --target=$CTARGET \
+ --with-build-sysroot="$CBUILDROOT" \
+ $_cross_configure \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
- --with-build-sysroot="${CBUILDROOT}" \
- --target=${CTARGET} \
--disable-multilib \
--enable-shared \
--enable-64-bit-bfd \
@@ -49,13 +61,14 @@ build() {
}
package() {
- cd "$srcdir/$pkgname-$pkgver"
- make install DESTDIR="$pkgdir"
+ cd "$_builddir"
+ make install DESTDIR="$pkgdir" || return 1
if [ -d "$pkgdir"/usr/lib64 ]; then
mv "$pkgdir"/usr/lib64/* "$pkgdir"/usr/lib/
rmdir "$pkgdir"/usr/lib64
fi
- rm "$pkgdir"/usr/lib/*.la || return 1
+ rm "$pkgdir"/usr/lib/libiberty.a
+ find "$pkgdir" -name "*.la" -delete
}
md5sums="4f8fa651e35ef262edc01d60fb45702e binutils-2.23.2.tar.bz2
6b744d0574338cc69d3096a890a7b609 binutils-ld-fix-static-linking.patch"