summaryrefslogtreecommitdiff
path: root/cross/cross-mips64el-unknown-linux-gnu-binutils/PKGBUILD
blob: e30319d19a1ea7f9761b601e6ebd1fb6f8b094fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Contributor: Vojtech Horky <vojta . horky at-symbol seznam . cz>

_pkgname=binutils
_target="mips64el-unknown-linux-gnu"
# We don't add the target because it duplicates it /usr/lib/$target/$target
_sysroot="/usr/lib"

pkgname=cross-${_target}-binutils
pkgver=2.22
pkgrel=6
pkgdesc="A set of programs to assemble and manipulate binary and object files for the MIPS architecture"
url="http://www.gnu.org/software/binutils/"
arch=('i686' 'x86_64')
license=('GPL')
depends=('zlib')
source=("ftp://ftp.gnu.org/gnu/binutils/${_pkgname}-${pkgver}.tar.bz2")
md5sums=('ee0f10756c84979622b992a4a61ea3f5')

build() {
	cd ${srcdir}/${_pkgname}-${pkgver}

	./configure \
        --prefix=${_sysroot} \
		--bindir=/usr/bin --program-prefix=${_target}- \
		--target=${_target} --build=$CHOST --host=$CHOST \
		--disable-nls \
        --disable-werror  \
        --disable-multilib \
		#--with-gcc --with-gnu-as --with-gnu-ld \
		#--without-included-gettext \
        #--with-lib-path=${_sysroot} \
		#--with-sysroot=${_sysroot}/${_target} \
		
    make configure-host
	make 
}

package() {
	cd ${srcdir}/${_pkgname}-${pkgver}
	
	make DESTDIR=${pkgdir} install

    mv ${pkgdir}/usr/lib/lib/libiberty.a ${pkgdir}${_sysroot}/${_target}/lib/
    rm -r ${pkgdir}/usr/lib/lib
	
	msg "Removing duplicate files..."
	# remove these files as they are already in the system
	# (with native binutils)
	rm -Rf ${pkgdir}${_sysroot}/share/{man,info}
	# remove conflicting binaries
	find ${pkgdir}/usr/bin/ -type f -not -name "${_target}-*" -delete
}