summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjc_gargma <jc_gargma@iserlohn-fortress.net>2019-05-05 18:18:44 -0700
committerjc_gargma <jc_gargma@iserlohn-fortress.net>2019-05-05 18:18:44 -0700
commita6a909405047a31ce876a269ee678700af42762f (patch)
tree63192681990f31993872fc858659299d2cda4b88
downloadsh-elf-newlib-a6a909405047a31ce876a269ee678700af42762f.tar.xz
Initial commit
-rw-r--r--PKGBUILD45
1 files changed, 45 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 0000000..dc363b0
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,45 @@
+# Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net>
+# Maintainer (Parabola): David P. <megver83@parabola.nu>
+
+# # I maintain this because:
+# Required to build linux-libre-firmware
+
+_target=sh-elf
+pkgname=$_target-newlib
+pkgver=3.0.0.20180831
+pkgrel=1
+_upstream_ver=$pkgver
+pkgdesc='A C standard library implementation intended for use on embedded systems (SuperH)'
+arch=(any)
+url='http://www.sourceware.org/newlib/'
+license=(BSD)
+makedepends=($_target-gcc)
+options=(!emptydirs !strip)
+source=(ftp://sourceware.org/pub/newlib/newlib-$_upstream_ver.tar.gz)
+sha256sums=('3ad3664f227357df15ff34e954bfd9f501009a647667cd307bf0658aefd6eb5b')
+
+build() {
+ mkdir newlib-build
+
+ export CFLAGS_FOR_TARGET='-g -O2 -ffunction-sections -fdata-sections'
+ cd "$srcdir"/newlib-build
+ ../newlib-$_upstream_ver/configure \
+ --target=$_target \
+ --prefix=/usr \
+ --disable-newlib-supplied-syscalls \
+ --disable-nls \
+ --enable-newlib-io-long-long \
+ --enable-newlib-register-fini
+ make
+
+}
+
+package() {
+ cd "$srcdir"/newlib-build
+ make DESTDIR="$pkgdir" install -j1
+
+ find "$pkgdir"/usr/$_target/lib \( -name "*.a" -or -name "*.o" \) -exec $_target-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc '{}' \;
+
+ install -d "$pkgdir"/usr/share/licenses/$pkgname/
+ install -m644 -t "$pkgdir"/usr/share/licenses/$pkgname/ "$srcdir"/newlib-$_upstream_ver/COPYING*
+}