cross-arm-none-eabi-newlib: build a nano variant

This commit is contained in:
q66 2019-12-28 02:18:41 +01:00 committed by Daniel Kolesa
parent 541236ac9e
commit d8c12f40e2

View file

@ -3,21 +3,14 @@ _triplet=arm-none-eabi
_pkgname=newlib
pkgname=cross-${_triplet}-${_pkgname}
version=3.1.0.20181231
revision=1
revision=2
wrksrc="${_pkgname}-${version}"
build_style=gnu-configure
configure_args="
--disable-newlib-supplied-syscalls
--disable-nls
--enable-interwork
--enable-newlib-io-long-long
--enable-newlib-register-fini
--host=${XBPS_CROSS_TRIPLET}
--prefix=/usr
--target=${_triplet}
--with-gnu-as
--with-gnu-ld
"
--prefix=/usr --target=${_triplet} --host=${XBPS_CROSS_TRIPLET}
--with-gnu-as --with-gnu-ld --disable-nls
--disable-newlib-supplied-syscalls --enable-newlib-retargetable-locking
--enable-interwork"
hostmakedepends="cross-arm-none-eabi-binutils cross-arm-none-eabi-gcc"
short_desc="C library intended for use on embedded systems"
maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
@ -26,3 +19,59 @@ homepage="https://www.sourceware.org/${_pkgname}/"
distfiles="ftp://sources.redhat.com/pub/${_pkgname}/${_pkgname}-${version}.tar.gz"
checksum=9e12fea7297648b114434033ed4458755afe7b9b6c7d58123389e82bd37681c0
nostrip=yes
post_extract() {
mkdir -p build-{newlib,nano}
}
do_configure() {
pushd build-newlib
export CFLAGS_FOR_TARGET="-g -O2 -ffunction-sections -fdata-sections"
../configure ${configure_args} \
--enable-newlib-io-long-long \
--enable-newlib-register-fini
popd
pushd build-nano
export CFLAGS_FOR_TARGET="-g -Os -ffunction-sections -fdata-sections"
../configure ${configure_args} \
--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
popd
}
do_build() {
pushd build-newlib
make ${makejobs}
popd
pushd build-nano
make ${makejobs}
popd
}
do_install() {
pushd build-nano
make DESTDIR=${DESTDIR} install
find ${DESTDIR} -regex ".*/lib\(c\|g\|rdimon\)\.a" \
-exec rename .a _nano.a '{}' \;
install -d ${DESTDIR}/usr/${_triplet}/include/newlib-nano
install -m644 -t ${DESTDIR}/usr/${_triplet}/include/newlib-nano \
${DESTDIR}/usr/${_triplet}/include/newlib.h
popd
pushd build-newlib
make DESTDIR=${DESTDIR} install
popd
}
post_install() {
vlicense COPYING
}