1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit flag-o-matic toolchain-funcs eutils
9 if [[ ${PV} == "9999" ]] ; then
10 EGIT_REPO_URI="git://sourceware.org/git/newlib-cygwin.git"
13 SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
14 if [[ ${PV} != *.201[5-9]???? ]] ; then
15 KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
19 export CBUILD=${CBUILD:-${CHOST}}
20 export CTARGET=${CTARGET:-${CHOST}}
21 if [[ ${CTARGET} == ${CHOST} ]] ; then
22 if [[ ${CATEGORY} == cross-* ]] ; then
23 export CTARGET=${CATEGORY#cross-}
27 DESCRIPTION="Newlib is a C library intended for use on embedded systems"
28 HOMEPAGE="http://sourceware.org/newlib/"
30 LICENSE="NEWLIB LIBGLOSS GPL-2"
32 IUSE="nls threads unicode crosscompile_opts_headers-only"
35 NEWLIBBUILD="${WORKDIR}/build"
38 # Reject newlib-on-glibc type installs
39 if [[ ${CTARGET} == ${CHOST} ]] ; then
42 *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
52 # we should fix this ...
54 CHOST=${CTARGET} strip-unsupported-flags
57 [[ ${CTARGET} == "spu" ]] \
58 && myconf="${myconf} --disable-newlib-multithread" \
59 || myconf="${myconf} $(use_enable threads newlib-multithread)"
61 mkdir -p "${NEWLIBBUILD}"
66 $(use_enable unicode newlib-mb) \
72 emake -C "${NEWLIBBUILD}"
77 emake -j1 DESTDIR="${D}" install
78 # env -uRESTRICT CHOST=${CTARGET} prepallstrip
79 # minor hack to keep things clean
80 rm -fR "${D}"/usr/share/info
81 rm -fR "${D}"/usr/info