void-packages/srcpkgs/avr-gcc/template
2018-08-14 17:08:54 +02:00

81 lines
1.9 KiB
Bash

# Template build file for 'avr-gcc'
pkgname=avr-gcc
version=8.2.0
revision=1
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.xz"
checksum=196c3c04ba2613f893283977e6011b2345d1cd1af9abeac58e916b1aab3e0080
wrksrc="gcc-$version"
hostmakedepends="flex avr-binutils"
if [ "$CROSS_BUILD" ]; then
# Need a direct cross-compiler for libgcc.
hostmakedepends+=" avr-gcc"
fi
makedepends="zlib-devel libmpc-devel isl15-devel"
depends="avr-binutils"
nostrip=yes
do_configure() {
[ -d obj-avr ] && rm -rf obj-avr
mkdir obj-avr
cd obj-avr
unset CFLAGS CXXFLAGS LDFLAGS
CFLAGS="-O2 -pipe" \
CONFIG_SHELL=/bin/bash \
LDFLAGS= \
../configure \
--prefix=/usr \
--disable-install-libiberty \
--disable-libssp \
--disable-libstdcxx-pch \
--disable-libunwind-exceptions \
--disable-linker-build-id \
--disable-nls \
--disable-werror \
--enable-checking=release \
--enable-clocale=gnu \
--enable-gnu-indirect-function \
--enable-gnu-unique-object \
--enable-gold \
--enable-languages=c,c++ \
--enable-ld=default \
--enable-lto \
--enable-plugin \
--enable-shared \
--build=$XBPS_TRIPLET \
--host=$XBPS_CROSS_TRIPLET \
--target=avr \
--with-isl \
--with-gnu-as \
--with-gnu-ld \
--with-as=/usr/bin/avr-as \
--with-ld=/usr/bin/avr-ld \
--with-plugin-ld=ld.gold \
--with-default-libstdcxx-abi=gcc4-compatible \
--with-system-zlib
}
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
rm -rf "$DESTDIR"/usr/lib/libcc1.*
rm -rf "$DESTDIR"/usr/lib64
ln -s avr-gcc "$DESTDIR"/usr/bin/avr-cc
find "$DESTDIR"/usr/lib -type f -name "*.a" \
-exec avr-strip --strip-debug {} \;
}