summaryrefslogtreecommitdiff
path: root/community-testing/avr-gcc/PKGBUILD
blob: bd42392eeaadbc735173f45e1e64fbebfd9be307 (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
62
63
64
65
66
67
68
69
70
# $Id: PKGBUILD 68439 2012-03-24 15:13:21Z schuay $
# Maintainer: schuay <jakob.gruber@gmail.com>
# Contributor: Brad Fanella <bradfanella@archlinux.us>
# Contributor: Corrado Primier <bardo@aur.archlinux.org>
# Contributor: danst0 <danst0@west.de>

pkgname=avr-gcc
_pkgname=gcc
pkgver=4.7.0
pkgrel=1
pkgdesc="The GNU avr Compiler Collection"
arch=('i686' 'x86_64')
license=('GPL' 'LGPL' 'custom')
url="http://gcc.gnu.org/"
depends=('avr-binutils>=2.22-3' 'cloog' 'ppl' 'gcc-libs>=4.7.0' 'libmpc')
provides=("gcc-avr=$pkgver")
replaces=('gcc-avr')
options=('!libtool' '!emptydirs' '!libtool' '!strip')
source=(http://ftp.gnu.org/gnu/gcc/${_pkgname}-${pkgver}/gcc-${pkgver}.tar.bz2)

_basedir=${srcdir}/${_pkgname}-${pkgver}

build() {
    # default CFLAGS lead to issues later on when configure 
    # calls avr-gcc with -march set.
    export CFLAGS="-O2 -pipe"
    export CXXFLAGS="-O2 -pipe"

    cd ${_basedir} 

    # Do not install libiberty
    sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in

    echo ${pkgver} > gcc/BASE-VER

    cd ${srcdir}
    mkdir gcc-build && cd gcc-build

    ${_basedir}/configure \
                --prefix=/usr \
                --libdir=/usr/lib \
                --libexecdir=/usr/lib \
                --mandir=/usr/share/man \
                --infodir=/usr/share/info \
                --enable-languages=c,c++ \
                --disable-libssp \
                --disable-nls \
                --target=avr \
                --with-as=/usr/bin/avr-as \
                --with-ld=/usr/bin/avr-ld \
                --with-gnu-as \
                --with-gnu-ld

    make
}

package() {
    cd ${srcdir}/gcc-build

    make -j1 DESTDIR=${pkgdir} install

      # Install Runtime Library Exception
    install -Dm644 ${_basedir}/COPYING.RUNTIME \
        ${pkgdir}/usr/share/licenses/${pkgname}/RUNTIME.LIBRARY.EXCEPTION

    rm -rf ${pkgdir}/usr/share/man/man7
    rm -rf ${pkgdir}/usr/share/info
}

md5sums=('2a0f1d99fda235c29d40b561f81d9a77')