Mail archive
alpine-aports

[alpine-aports] [PATCH 3/3] testing/newlib-arm-none-eabi: New aport

From: Marian Buschsieweke <marian.buschsieweke_at_ovgu.de>
Date: Sat, 26 Aug 2017 16:07:29 +0200

A C standard library implementation intended for use on embedded systems
http://www.sourceware.org/newlib/
---
 testing/newlib-arm-none-eabi/APKBUILD | 83 +++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)
 create mode 100644 testing/newlib-arm-none-eabi/APKBUILD
diff --git a/testing/newlib-arm-none-eabi/APKBUILD b/testing/newlib-arm-none-eabi/APKBUILD
new file mode 100644
index 0000000000..581bcc1ebe
--- /dev/null
+++ b/testing/newlib-arm-none-eabi/APKBUILD
_at_@ -0,0 +1,83 @@
+# Contributor: Marian Buschsieweke <marian.buschsieweke_at_ovgu.de>
+# Maintainer: Marian Buschsieweke <marian.buschsieweke_at_ovgu.de>
+
+_pkgbase=newlib
+_target=arm-none-eabi
+pkgname="${_pkgbase}-${_target}"
+pkgver=2.5.0.20170818
+pkgrel=0
+pkgdesc="A C standard library implementation intended for use on embedded systems"
+url="http://www.sourceware.org/newlib/"
+depends="binutils-${_target} gcc-${_target}"
+makedepends="texinfo"
+arch="all"
+license="BSD"
+subpackages="$pkgname-doc"
+source="ftp://sourceware.org/pub/$_pkgbase/$_pkgbase-$pkgver.tar.gz"
+options="!check"
+
+builddir="$srcdir/$_pkgbase-$pkgver"
+
+# This package installes two version of the newlib library to remain compatible
+# with projects expecting the GNU ARM Embedded Toolchain [1]. The nano version
+# appends the postix "_nano" to the libaries. The is not an arbitrary choice,
+# it matches the specs in "/usr/arm-none-eabi/lib/nano.specs", which is
+# part of the default newlib installation.
+# [1]: https://launchpad.net/gcc-arm-embedded/
+
+build() {
+	mkdir "${builddir}/build" "${builddir}/build-nano"
+	
+	# nano version
+	cd "${builddir}/build-nano"
+	CFLAGS_NANO="-Os -ffunction-sections -fdata-sections -D=__OPTIMIZE_SIZE__ -DPREFER_SIZE_OVER_SPEED"
+	env CFLAGS_FOR_TARGET="$CFLAGS_NANO" "$builddir"/configure \
+		--prefix=/usr/ \
+		--target=$_target \
+		--disable-newlib-supplied-syscalls \
+		--enable-newlib-reent-small \
+		--disable-newlib-fvwrite-in-streamio \
+		--disable-newlib-fseek-optimization \
+		--disable-newlib-wide-orient \
+		--enable-newlib-nano-malloc \
+		--disable-newlib-unbuf-stream-opt \
+		--enable-lite-exit \
+		--enable-newlib-global-atexit \
+		--enable-newlib-nano-formatted-io \
+		--disable-nls \
+		--disable-newlib-io-float \
+		--disable-libssp
+	make
+	
+	# regular version
+	cd "${builddir}/build"
+	"$builddir"/configure \
+		--prefix=/usr/ \
+		--target=$_target \
+		--enable-newlib-io-long-long \
+		--enable-newlib-register-fini \
+		--disable-newlib-supplied-syscalls \
+		--disable-nls
+	make
+}
+
+package() {
+	for dir in include lib/thumb lib/fpu lib/cpu-init; do
+		mkdir -p "${pkgdir}/usr/${_target}/${dir}"
+	done
+	
+	# install nano version
+	cd "${builddir}/build-nano"
+	make DESTDIR="$pkgdir" install
+	# rename nano version libs
+	cd "${pkgdir}/usr/${_target}/lib"
+	for file in $(find . -regex ".*\(c\|g\|rdimon\)\.a"); do
+		mv "$file" "${file%.a}_nano.a"
+	done
+	
+	# install regular version
+	cd "${builddir}/build"
+	make DESTDIR="$pkgdir" install
+}
+
+sha512sums="41382f722232593a9a2bf7de09dc51a26ad51bf8ad06259b0fd38a13cfcd577688e836446d7e88b7741eeec316cfa137ff9b4e16cca846b11bb70948ff1b8c16  newlib-2.5.0.20170818.tar.gz"
-- 
2.14.1
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Sat Aug 26 2017 - 16:07:29 UTC