/[gentoo-x86]/sys-libs/newlib/newlib-1.20.0.ebuild
Gentoo

Contents of /sys-libs/newlib/newlib-1.20.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Fri Feb 27 08:01:12 2015 UTC (3 years, 5 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +4 -4 lines
Use more readable CTARGET setup logic.

(Portage version: 2.2.17/cvs/Linux x86_64, signed Manifest commit with key D2E96200)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-libs/newlib/newlib-1.20.0.ebuild,v 1.5 2013/02/09 04:40:10 vapier Exp $
4
5 EAPI="4"
6
7 inherit eutils flag-o-matic toolchain-funcs
8
9 export CBUILD=${CBUILD:-${CHOST}}
10 export CTARGET=${CTARGET:-${CHOST}}
11 if [[ ${CTARGET} == ${CHOST} ]] ; then
12 if [[ ${CATEGORY} == cross-* ]] ; then
13 export CTARGET=${CATEGORY#cross-}
14 fi
15 fi
16
17 DESCRIPTION="Newlib is a C library intended for use on embedded systems"
18 HOMEPAGE="http://sourceware.org/newlib/"
19 SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
20
21 LICENSE="NEWLIB LIBGLOSS GPL-2"
22 [[ ${CTARGET} != ${CHOST} ]] \
23 && SLOT="${CTARGET}" \
24 || SLOT="0"
25 KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
26 IUSE="nls threads unicode crosscompile_opts_headers-only"
27 RESTRICT="strip"
28
29 NEWLIBBUILD="${WORKDIR}/build"
30
31 pkg_setup() {
32 # Reject newlib-on-glibc type installs
33 if [[ ${CTARGET} == ${CHOST} ]] ; then
34 case ${CHOST} in
35 *-newlib|*-elf) ;;
36 *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
37 esac
38 fi
39 }
40
41 src_prepare() {
42 epatch "${FILESDIR}"/${P}-cris-install.patch
43 epatch "${FILESDIR}"/${P}-arm-targets.patch #413547
44 }
45
46 src_configure() {
47 # we should fix this ...
48 unset LDFLAGS
49 CHOST=${CTARGET} strip-unsupported-flags
50
51 local myconf=""
52 [[ ${CTARGET} == "spu" ]] \
53 && myconf="${myconf} --disable-newlib-multithread" \
54 || myconf="${myconf} $(use_enable threads newlib-multithread)"
55
56 mkdir -p "${NEWLIBBUILD}"
57 cd "${NEWLIBBUILD}"
58
59 ECONF_SOURCE=${S} \
60 econf \
61 $(use_enable unicode newlib-mb) \
62 $(use_enable nls) \
63 ${myconf}
64 }
65
66 src_compile() {
67 emake -C "${NEWLIBBUILD}"
68 }
69
70 src_install() {
71 cd "${NEWLIBBUILD}"
72 emake -j1 DESTDIR="${D}" install
73 # env -uRESTRICT CHOST=${CTARGET} prepallstrip
74 # minor hack to keep things clean
75 rm -fR "${D}"/usr/share/info
76 rm -fR "${D}"/usr/info
77 }

  ViewVC Help
Powered by ViewVC 1.1.20