Subject: [alpine-aports] [PATCH] testing/gcc-cross-bare-metal: New aport

From: Marian Buschsieweke <[email-masked]>
Date: Tue, 19 Sep 2017 22:42:50 +0200

The GNU Compiler Collection for embedded targets
http://gcc.gnu.org

Provides: gcc-avr, gcc-arm-none-eabi, gcc-xtensa-lx106-elf
---
 testing/gcc-cross-bare-metal/APKBUILD | 110 ++++++++++++++++++++++++++++++++++
 1 file changed, 110 insertions(+)
 create mode 100644 testing/gcc-cross-bare-metal/APKBUILD

diff --git a/testing/gcc-cross-bare-metal/APKBUILD b/testing/gcc-cross-bare-metal/APKBUILD
new file mode 100644
index 0000000000..d51238457c
--- /dev/null
+++ b/testing/gcc-cross-bare-metal/APKBUILD
@@ -0,0 +1,110 @@
+# Contributor: Marian Buschsieweke <[email-masked]>
+# Maintainer: Marian Buschsieweke <[email-masked]>
+# Based on gcc-avr
+_pkgbase=gcc
+_targets="arm-none-eabi avr xtensa-lx106-elf"
+pkgname="$_pkgbase-cross-bare-metal"
+pkgver=6.4.0
+pkgrel=0
+pkgdesc="The GNU Compiler Collection for embedded targets"
+url="http://gcc.gnu.org"
+makedepends="bash linux-headers gmp-dev mpfr-dev mpc1-dev zlib-dev"
+arch="all"
+license="GPL LGPL"
+for target in $_targets; do
+	targetnorm="${target//-/_}"
+	subpackages="${_pkgbase}-${target}:${targetnorm} ${subpackages}"
+	makedepends="binutils-${target} ${makedepends}"
+done
+_islver=0.18
+source="ftp://gcc.gnu.org/pub/${_pkgbase}/releases/${_pkgbase}-$pkgver/${_pkgbase}-$pkgver.tar.xz
+	http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2"
+
+builddir="$srcdir/${_pkgbase}-$pkgver"
+
+build() {
+	# link isl for in-tree build
+	ln -s "$srcdir"/isl-"$_islver" "$builddir"/isl
+
+	for target in $_targets; do
+		workingdir="${builddir}/build-${target}"
+		mkdir "${workingdir}"
+		cd "${workingdir}"
+		
+		export CFLAGS_FOR_TARGET='-pipe'
+		export CXXFLAGS_FOR_TARGET='-pipe'
+
+		"$builddir"/configure \
+			--build="$CBUILD" \
+			--target=${target} \
+			--prefix=/usr \
+			--enable-languages=c,c++ \
+			--enable-ld=default \
+			--enable-__cxa_atexit \
+			--disable-install-libiberty \
+			--disable-libssp \
+			--disable-libstdcxx-pch \
+			--disable-libunwind-exceptions \
+			--disable-linker-build-id \
+			--disable-multilib \
+			--disable-nls \
+			--disable-libstdcxx \
+			--disable-werror \
+			--libdir=/usr/lib \
+			--libexecdir=/usr/lib \
+			--with-as="/usr/bin/${target}-as" \
+			--with-gnu-as \
+			--with-gnu-ld \
+			--with-ld="/usr/bin/${target}-ld" \
+			--with-system-zlib \
+			--with-isl \
+			--with-newlib
+		make
+	done
+}
+
+#check() {
+#	for target in $_targets; do
+#		workingdir="${builddir}/build-${target}"
+#		cd "${workingdir}"
+#		make check
+#	done
+#}
+
+package() {
+	mkdir -p "$pkgdir"
+}
+
+install_subpkg() {
+	workingdir="${builddir}/build-${target}"
+	cd "${workingdir}"
+	make install DESTDIR="$subpkgdir"
+	rm -rf "$subpkgdir"/usr/share/man
+	rm -f "$subpkgdir"/usr/lib/libcc1.*
+	rm -rf "$subpkgdir"/usr/share/info
+	find "$subpkgdir"/usr/lib -type f -name "*.a" -exec "/usr/bin/${_target}-strip" --strip-debug '{}' \;
+}
+
+arm_none_eabi() {
+	target="${subpkgname#${_pkgbase}-}"
+	depends="binutils-${target}"
+	pkgdesc="The GNU Compiler Collection for platform ${target}"
+	install_subpkg
+}
+
+avr() {
+	target="${subpkgname#${_pkgbase}-}"
+	depends="binutils-${target}"
+	pkgdesc="The GNU Compiler Collection for platform ${target}"
+	install_subpkg
+}
+
+xtensa_lx106_elf() {
+	target="${subpkgname#${_pkgbase}-}"
+	depends="binutils-${target}"
+	pkgdesc="The GNU Compiler Collection for platform ${target}"
+	install_subpkg
+}
+
+sha512sums="02c60e54527c7adf584798d5251f8a0b80c93d5deafce82501b2c28e6692e0bd783927bbfc4bc527a863c0cccc025150a34740a9e29badb02d4b48e56a8aba90  gcc-6.4.0.tar.xz
+85d0b40f4dbf14cb99d17aa07048cdcab2dc3eb527d2fbb1e84c41b2de5f351025370e57448b63b2b8a8cf8a0843a089c3263f9baee1542d5c2e1cb37ed39d94  isl-0.18.tar.bz2"
-- 
2.14.1

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---