void-packages/srcpkgs/avr-gcc/template

83 lines
1.9 KiB
Bash

# Template build file for 'avr-gcc'
pkgname=avr-gcc
version=6.2.1
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="https://repo.voidlinux.eu/distfiles/gcc-$version.tar.xz"
checksum=a7addd2d4e42e66c3b56ced8baee5a11ef7fb577e23615a4f43877273eaf9409
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-__cxa_atexit \
--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 {} \;
}