2021-09-14 17:17:10 -07:00
|
|
|
_target=mips
|
|
|
|
_triplet="$_target-ultra64-elf"
|
|
|
|
_prefix="/opt/$_triplet"
|
|
|
|
_sysroot="$_prefix/sysroot"
|
|
|
|
|
|
|
|
pkgname="$_triplet-newlib"
|
|
|
|
pkgver=4.1.0
|
2017-05-16 17:00:05 +00:00
|
|
|
pkgrel=1
|
|
|
|
_newlib="newlib-$pkgver"
|
2021-09-14 17:17:10 -07:00
|
|
|
pkgdesc="A C library intended for use on embedded systems ($_triplet)"
|
2017-05-16 17:00:05 +00:00
|
|
|
arch=('any')
|
|
|
|
license=('BSD')
|
|
|
|
url='http://sourceware.org/newlib/'
|
2021-09-14 17:17:10 -07:00
|
|
|
makedepends=("$_triplet-bootstrap")
|
2017-05-16 17:00:05 +00:00
|
|
|
source=("ftp://sourceware.org/pub/newlib/$_newlib.tar.gz")
|
2021-09-14 17:17:10 -07:00
|
|
|
sha256sums=('f296e372f51324224d387cc116dc37a6bd397198756746f93a2b02e9a5d40154')
|
2017-05-16 17:00:05 +00:00
|
|
|
options=('!emptydirs' '!strip')
|
|
|
|
|
|
|
|
build() {
|
|
|
|
export PATH="$PATH:$_prefix/bin"
|
|
|
|
|
|
|
|
# the programs we're compiling are really picky about flags.
|
|
|
|
# it's best to keep it simple.
|
|
|
|
export CFLAGS="-O2"
|
|
|
|
export CXXFLAGS="-O2"
|
|
|
|
export CPPFLAGS=""
|
|
|
|
export LDFLAGS=""
|
|
|
|
|
2021-09-14 17:17:10 -07:00
|
|
|
export CFLAGS_FOR_TARGET="-fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables"
|
2017-05-16 17:00:05 +00:00
|
|
|
export CXXFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET -fno-rtti"
|
|
|
|
|
|
|
|
cd "$srcdir"
|
|
|
|
[ -d "build-newlib" ] || mkdir "build-newlib"
|
|
|
|
cd "build-newlib"
|
|
|
|
|
|
|
|
local _build=
|
|
|
|
if [ -n "$MINGW_CHOST" ]; then
|
|
|
|
_build="--build=$MINGW_CHOST --host=$MINGW_CHOST"
|
|
|
|
fi
|
|
|
|
|
2021-09-14 17:17:10 -07:00
|
|
|
"../$_newlib/configure" $_build \
|
|
|
|
--target=$_target \
|
|
|
|
--prefix="$_prefix" \
|
|
|
|
\
|
|
|
|
--disable-libssp \
|
2017-05-16 17:00:05 +00:00
|
|
|
--disable-newlib-atexit-dynamic-alloc \
|
|
|
|
--disable-newlib-fvwrite-in-streamio \
|
|
|
|
--disable-newlib-supplied-syscalls \
|
2021-09-14 17:17:10 -07:00
|
|
|
--disable-newlib-unbuf-stream-opt \
|
|
|
|
--disable-newlib-wide-orient \
|
|
|
|
--disable-nls \
|
|
|
|
--disable-shared \
|
|
|
|
--disable-threads \
|
|
|
|
--enable-lite-exit \
|
|
|
|
--enable-lto \
|
|
|
|
--enable-newlib-global-atexit \
|
|
|
|
--enable-newlib-nano-malloc \
|
|
|
|
--enable-target-optspace \
|
|
|
|
--with-newlib \
|
2017-05-16 17:00:05 +00:00
|
|
|
|
|
|
|
#--enable-newlib-nano-formatted-io
|
|
|
|
make
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
export PATH="$PATH:$_prefix/bin"
|
|
|
|
|
|
|
|
local PREFIX="$pkgdir$_prefix"
|
|
|
|
|
|
|
|
cd "$srcdir/build-newlib"
|
|
|
|
make DESTDIR="$pkgdir" install -j1
|
|
|
|
|
|
|
|
# strip target binaries
|
|
|
|
find "$PREFIX/$_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 \
|
|
|
|
'{}' \;
|
|
|
|
}
|