void-packages/srcpkgs/avr-gcc/template

79 lines
1.8 KiB
Bash
Raw Normal View History

2015-01-16 14:14:43 +01:00
# Template build file for 'avr-gcc'
pkgname=avr-gcc
2016-03-09 14:05:31 +01:00
version=5.3.0
2016-05-19 17:15:42 +02:00
revision=2
2015-01-16 14:14:43 +01:00
short_desc="The GNU C Compiler for AVR"
maintainer="allan <mail@may.mooo.com>"
homepage="http://gcc.gnu.org"
license="GFDL-1.2, GPL-3, LGPL-2.1"
distfiles="$GNU_SITE/gcc/gcc-$version/gcc-$version.tar.bz2"
2016-03-09 14:05:31 +01:00
checksum=b84f5592e9218b73dbae612b5253035a7b34a9a1f7688d2e1bfaaf7267d5c4db
2015-01-16 14:14:43 +01:00
wrksrc="gcc-$version"
2016-05-19 17:15:42 +02:00
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"
2015-01-16 14:14:43 +01:00
depends="avr-binutils"
nostrip=yes
do_configure() {
mkdir obj-avr
cd obj-avr
2016-05-19 17:15:42 +02:00
unset CFLAGS CXXFLAGS LDFLAGS
2016-03-09 14:05:31 +01:00
CFLAGS="-O2 -pipe" \
CONFIG_SHELL=/bin/bash \
LDFLAGS= \
../configure \
2015-01-16 14:14:43 +01:00
--disable-install-libiberty \
--disable-libssp \
--disable-libstdcxx-pch \
--disable-libunwind-exceptions \
--disable-linker-build-id \
--disable-nls \
--disable-werror \
--enable-__cxa_atexit \
--enable-checking=release \
--enable-clocale=gnu \
2016-03-09 14:05:31 +01:00
--enable-gnu-indirect-function \
2015-01-16 14:14:43 +01:00
--enable-gnu-unique-object \
--enable-gold \
--enable-languages=c,c++ \
--enable-ld=default \
--enable-lto \
--enable-plugin \
--enable-shared \
--prefix=/usr \
2016-05-19 17:15:42 +02:00
--build=$XBPS_TRIPLET \
--host=$XBPS_CROSS_TRIPLET \
2015-01-16 14:14:43 +01:00
--target=avr \
--with-gnu-as \
--with-gnu-ld \
2016-03-09 14:05:31 +01:00
--with-as=/usr/bin/avr-as \
2015-01-16 14:14:43 +01:00
--with-ld=/usr/bin/avr-ld \
--with-plugin-ld=ld.gold \
2016-03-09 14:05:31 +01:00
--with-system-zlib
2015-01-16 14:14:43 +01:00
}
do_build() {
cd obj-avr
make ${makejobs}
}
do_install() {
cd obj-avr
make DESTDIR="$DESTDIR" install
}
post_install() {
rm -rf "$DESTDIR"/usr/share/man/man7
rm -rf "$DESTDIR"/usr/share/info
2016-03-09 14:05:31 +01:00
rm -rf "$DESTDIR"/usr/lib/libcc1.*
2016-05-19 17:15:42 +02:00
ln -s avr-gcc "$DESTDIR"/usr/bin/avr-cc
2015-01-16 14:14:43 +01:00
find "$DESTDIR"/usr/lib -type f -name "*.a" \
-exec avr-strip --strip-debug {} \;
}