summaryrefslogtreecommitdiff
path: root/community/mingw-w64-binutils/PKGBUILD
blob: 469ced17d08afb46d68a2e035d7989cef75d38b0 (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
53
# $Id: PKGBUILD 101172 2013-11-18 17:41:58Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: rubenvb vanboxem <dottie> ruben <attie> gmail <dottie> com

_targets="i686-w64-mingw32 x86_64-w64-mingw32"

pkgname=mingw-w64-binutils
pkgver=2.23.2
pkgrel=2
pkgdesc="Cross binutils for the MinGW-w64 cross-compiler"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/binutils"
license=('GPL')
groups=('mingw-w64-toolchain' 'mingw-w64')
depends=('zlib')
options=('!libtool' '!emptydirs')
source=("http://ftp.gnu.org/gnu/binutils/binutils-${pkgver}.tar.gz"
        "binutils-2.23.2-texinfo-5.0.patch.txt")
md5sums=('cda9dcc08c86ff2fd3f27e4adb250f6f'
         '34e439ce23213a91e2af872dfbb5094c')

prepare() {
  cd ${srcdir}/binutils-${pkgver}
  # http://sourceware.org/git/?p=binutils.git;a=patch;h=e02bf935
  # http://sourceware.org/git/?p=binutils.git;a=patch;h=935f8542
  patch -p1 -i ${srcdir}/binutils-2.23.2-texinfo-5.0.patch.txt

  #do not install libiberty
  sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
  # hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS"
  sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
}

build() {
  for _target in $_targets; do
    msg "Building ${_target} cross binutils"
    mkdir -p ${srcdir}/binutils-${_target} && cd "${srcdir}/binutils-${_target}"
    $srcdir/binutils-${pkgver}/configure --prefix=/usr \
        --target=${_target} \
        --infodir=/usr/share/info/${_target} \
        --enable-lto --enable-plugins \
        --disable-multilib --disable-nls
     make
  done
}

package() {
  for _target in ${_targets}; do
    msg "Installing ${_target} cross binutils"
    cd ${srcdir}/binutils-${_target}
    make DESTDIR=${pkgdir} install
  done
}