void-packages/srcpkgs/avr-gcc/template
Robert Lowry dc8948e20f avr-gcc: update to 9.2.0
[ci skip]
2019-10-04 06:26:48 +02:00

81 lines
1.9 KiB
Bash

# Template file for 'avr-gcc'
pkgname=avr-gcc
version=9.2.0
revision=1
wrksrc="gcc-$version"
short_desc="GNU C Compiler for AVR"
maintainer="allan <mail@may.mooo.com>"
license="GFDL-1.2, GPL-3, LGPL-2.1"
homepage="http://gcc.gnu.org"
distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
checksum=ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
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 {} \;
}