1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit flag-o-matic toolchain-funcs eutils
8 if [[ ${PV} == "9999" ]] ; then
9 EGIT_REPO_URI="git://sourceware.org/git/newlib-cygwin.git"
12 SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
13 # if [[ ${PV} != *.201[5-9]???? ]] ; then
14 KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
18 export CBUILD=${CBUILD:-${CHOST}}
19 export CTARGET=${CTARGET:-${CHOST}}
20 if [[ ${CTARGET} == ${CHOST} ]] ; then
21 if [[ ${CATEGORY} == cross-* ]] ; then
22 export CTARGET=${CATEGORY#cross-}
26 DESCRIPTION="Newlib is a C library intended for use on embedded systems"
27 HOMEPAGE="https://sourceware.org/newlib/"
29 LICENSE="NEWLIB LIBGLOSS GPL-2"
31 IUSE="nls threads unicode headers-only"
34 NEWLIBBUILD="${WORKDIR}/build"
37 # Reject newlib-on-glibc type installs
38 if [[ ${CTARGET} == ${CHOST} ]] ; then
41 *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
51 # we should fix this ...
53 CHOST=${CTARGET} strip-unsupported-flags
56 # Disable legacy syscall stub code in newlib. These have been
57 # moved to libgloss for a long time now, so the code in newlib
58 # itself just gets in the way.
59 --disable-newlib-supplied-syscalls
61 [[ ${CTARGET} == "spu" ]] \
62 && myconf+=( --disable-newlib-multithread ) \
63 || myconf+=( $(use_enable threads newlib-multithread) )
65 mkdir -p "${NEWLIBBUILD}"
70 $(use_enable unicode newlib-mb) \
76 emake -C "${NEWLIBBUILD}"
81 emake -j1 DESTDIR="${D}" install
82 # env -uRESTRICT CHOST=${CTARGET} prepallstrip
83 # minor hack to keep things clean
84 rm -fR "${D}"/usr/share/info
85 rm -fR "${D}"/usr/info