# Maintainer: Orlando Arias com> _target="msp430-elf" pkgname=${_target}-gcc pkgver=12.1.0 _islver=0.25 pkgrel=1 pkgdesc="The GNU Compiler Collection for the ${_target} target." arch=(i686 x86_64) license=('GPL' 'LGPL') url="http://gcc.gnu.org" depends=("${_target}-newlib" "${_target}-binutils" 'libmpc' 'elfutils' 'zlib') options=('staticlibs' '!buildflags' '!libtool' '!emptydirs' 'zipman' 'docs' '!strip') conflicts=("${_target}-gcc-stage1") replaces=("${_target}-gcc-stage1") provides=("${_target}-gcc-stage1") optdepends=("${_target}-libstdc++: C++ standard library support") source=(https://libisl.sourceforge.io/isl-${_islver}.tar.xz ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.xz) sha256sums=('be7b210647ccadf90a2f0b000fca11a4d40546374a850db67adb32fad4b230d9' '62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b') prepare() { cd "${srcdir}/gcc-${pkgver}" [[ -L isl ]] && rm -f isl ln -s ../isl-${_islver} isl [[ -d gcc-build ]] && rm -rf gcc-build mkdir gcc-build } build() { cd "${srcdir}/gcc-${pkgver}" export CFLAGS="-O2 -pipe" export CXXFLAGS="-O2 -pipe" export CFLAGS_FOR_TARGET="-Os -pipe" export CXXFLAGS_FOR_TARGET="-Os -pipe" echo ${pkgver} > gcc/BASE-VER cd gcc-build ../configure \ --prefix=/usr \ --program-prefix=${_target}- \ --target=${_target} \ --host=$CHOST \ --build=$CHOST \ --enable-shared \ --disable-nls \ --disable-threads \ --enable-languages=c,c++ \ --enable-multilib \ --with-system-zlib \ --with-local-prefix=/usr/${_target} \ --with-sysroot=/usr/${_target} \ --with-as=/usr/bin/${_target}-as \ --with-ld=/usr/bin/${_target}-ld \ --disable-libgomp \ --disable-libssp \ --enable-interwork \ --enable-addons \ --enable-lto make all-gcc all-target-libgcc } package() { cd "${srcdir}/gcc-${pkgver}/gcc-build" export CFLAGS="-O2 -pipe" export CXXFLAGS="-O2 -pipe" export CFLAGS_FOR_TARGET="-Os -pipe" export CXXFLAGS_FOR_TARGET="-Os -pipe" make DESTDIR="${pkgdir}" install-gcc install-target-libgcc rm -rf "${pkgdir}/usr/share/man/man7/" rm -rf "${pkgdir}/usr/share/info" cp -r "${pkgdir}"/usr/libexec/* "${pkgdir}/usr/lib/" rm -rf "${pkgdir}/usr/libexec" # strip it manually strip "${pkgdir}"/usr/bin/* 2>/dev/null || true find "${pkgdir}"/usr/lib -type f -exec /usr/bin/${_target}-strip \ --strip-unneeded {} \; 2>/dev/null || true } # vim:set ts=2 sw=2 et: