avr-gcc: enable cross-build.

This commit is contained in:
Christian Neukirchen 2016-05-19 17:15:42 +02:00
parent be81f33d96
commit 99feb2a80f

View file

@ -1,7 +1,7 @@
# Template build file for 'avr-gcc'
pkgname=avr-gcc
version=5.3.0
revision=1
revision=2
short_desc="The GNU C Compiler for AVR"
maintainer="allan <mail@may.mooo.com>"
homepage="http://gcc.gnu.org"
@ -9,9 +9,13 @@ license="GFDL-1.2, GPL-3, LGPL-2.1"
distfiles="$GNU_SITE/gcc/gcc-$version/gcc-$version.tar.bz2"
checksum=b84f5592e9218b73dbae612b5253035a7b34a9a1f7688d2e1bfaaf7267d5c4db
wrksrc="gcc-$version"
only_for_archs="i686 x86_64"
hostmakedepends="avr-binutils zlib-devel libmpc-devel cloog-devel gmp-devel mpfr-devel"
hostmakedepends="avr-binutils"
if [ "$CROSS_BUILD" ]; then
# Need a direct cross-compiler for libgcc.
hostmakedepends+=" avr-gcc"
fi
makedepends="zlib-devel libmpc-devel cloog-devel gmp-devel mpfr-devel"
depends="avr-binutils"
nostrip=yes
@ -19,6 +23,7 @@ do_configure() {
mkdir obj-avr
cd obj-avr
unset CFLAGS CXXFLAGS LDFLAGS
CFLAGS="-O2 -pipe" \
CONFIG_SHELL=/bin/bash \
LDFLAGS= \
@ -42,6 +47,8 @@ do_configure() {
--enable-plugin \
--enable-shared \
--prefix=/usr \
--build=$XBPS_TRIPLET \
--host=$XBPS_CROSS_TRIPLET \
--target=avr \
--with-gnu-as \
--with-gnu-ld \
@ -65,6 +72,7 @@ post_install() {
rm -rf "$DESTDIR"/usr/share/man/man7
rm -rf "$DESTDIR"/usr/share/info
rm -rf "$DESTDIR"/usr/lib/libcc1.*
ln -s avr-gcc "$DESTDIR"/usr/bin/avr-cc
find "$DESTDIR"/usr/lib -type f -name "*.a" \
-exec avr-strip --strip-debug {} \;
}