summaryrefslogtreecommitdiff
path: root/community/mingw-w64-gcc-base/PKGBUILD
blob: d1d33407e617383c68d44686a4e2f3445905550d (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
54
55
56
57
58
59
60
61
# $Id: PKGBUILD 101177 2013-11-18 17:42:31Z 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-gcc-base
pkgver=4.8.2
pkgrel=2
pkgdesc="Cross GCC for the MinGW-w64 cross-compiler (bootstrap)"
arch=('i686' 'x86_64')
url="http://gcc.gnu.org"
license=('GPL' 'LGPL' 'FDL' 'custom')
groups=('mingw-w64-bootstrap' 'mingw-w64')
depends=('zlib' 'libmpc' 'ppl' 'cloog' 'mingw-w64-binutils' 'mingw-w64-headers' 'mingw-w64-headers-bootstrap')
conflicts=('mingw-w64-gcc')
options=('staticlibs' '!emptydirs')
source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2)
md5sums=('a3d7d63b9cb6b6ea049469a0c4a43c9d')

prepare() {
  cd ${srcdir}/gcc-${pkgver}

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

build() {
  for _target in ${_targets}; do
    msg "Building ${_target} GCC C compiler"
    mkdir -p ${srcdir}/gcc-build-${_target} && cd ${srcdir}/gcc-build-${_target}

    ${srcdir}/gcc-${pkgver}/configure --prefix=/usr \
        --target=${_target} \
        --enable-languages=c,lto \
        --enable-shared --enable-static \
        --enable-threads=win32 \
        --with-system-zlib --enable-cloog-backend=isl \
        --disable-cloog-version-check --disable-isl-version-check \
        --enable-lto --disable-dw2-exceptions --enable-libgomp \
        --disable-nls --enable-version-specific-runtime-libs \
        --disable-multilib --enable-checking=release
    make all-gcc
  done
}

package() {
  for _target in ${_targets}; do
    msg "Installing ${_target} GCC C compiler"
    cd ${srcdir}/gcc-build-${_target}
    make DESTDIR=${pkgdir} install-gcc
    strip ${pkgdir}/usr/bin/${_target}-*
    strip ${pkgdir}/usr/libexec/gcc/${_target}/${pkgver}/{cc1,collect2,lto*}
  done
  # remove unnecessary files
  msg "Removing man and info pages"
  rm -r ${pkgdir}/usr/share/man
  rm -r ${pkgdir}/usr/share/info
}