PKGBUILD 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # Maintainer: David P. <megver83@parabola.nu>
  2. _target=sh-elf
  3. pkgname=$_target-newlib
  4. pkgver=4.1.0
  5. pkgrel=1
  6. _upstream_ver=$pkgver
  7. pkgdesc='A C standard library implementation intended for use on embedded systems (SuperH bare metal)'
  8. arch=(any)
  9. url='http://www.sourceware.org/newlib/'
  10. license=(BSD)
  11. makedepends=($_target-gcc)
  12. options=(!emptydirs !strip)
  13. source=(https://sourceware.org/pub/newlib/newlib-$_upstream_ver.tar.gz)
  14. sha256sums=('f296e372f51324224d387cc116dc37a6bd397198756746f93a2b02e9a5d40154')
  15. build() {
  16. mkdir newlib-build
  17. export CFLAGS_FOR_TARGET='-g -O2 -ffunction-sections -fdata-sections'
  18. cd "$srcdir"/newlib-build
  19. ../newlib-$_upstream_ver/configure \
  20. --target=$_target \
  21. --prefix=/usr \
  22. --enable-newlib-io-long-long \
  23. --enable-newlib-io-c99-formats \
  24. --enable-newlib-register-fini \
  25. --enable-newlib-retargetable-locking \
  26. --disable-newlib-supplied-syscalls \
  27. --disable-nls
  28. make
  29. }
  30. package() {
  31. cd "$srcdir"/newlib-build
  32. make DESTDIR="$pkgdir" install -j1
  33. 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 '{}' \;
  34. install -d "$pkgdir"/usr/share/licenses/$pkgname/
  35. install -m644 -t "$pkgdir"/usr/share/licenses/$pkgname/ "$srcdir"/newlib-$_upstream_ver/COPYING*
  36. }