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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat Feb 12 23:49:27 2011 UTC (3 years, 9 months ago) by vapier
Branch: MAIN
Version bump.

(Portage version: 2.2.0_alpha20/cvs/Linux x86_64)

1 # Copyright 1999-2011 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.18.0.ebuild,v 1.2 2010/02/28 20:12:04 lu_zero Exp $
4
5 inherit eutils flag-o-matic toolchain-funcs
6
7 export CBUILD=${CBUILD:-${CHOST}}
8 export CTARGET=${CTARGET:-${CHOST}}
9 if [[ ${CTARGET} == ${CHOST} ]] ; then
10 if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
11 export CTARGET=${CATEGORY/cross-}
12 fi
13 fi
14
15 DESCRIPTION="Newlib is a C library intended for use on embedded systems"
16 HOMEPAGE="http://sourceware.org/newlib/"
17 SRC_URI="ftp://sources.redhat.com/pub/newlib/${P}.tar.gz"
18
19 LICENSE="NEWLIB LIBGLOSS GPL-2"
20 [[ ${CTARGET} != ${CHOST} ]] \
21 && SLOT="${CTARGET}" \
22 || SLOT="0"
23 KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
24 IUSE="nls threads unicode crosscompile_opts_headers-only"
25 RESTRICT="strip"
26
27 NEWLIBBUILD="${WORKDIR}/build"
28
29 pkg_setup() {
30 # Reject newlib-on-glibc type installs
31 if [[ ${CTARGET} == ${CHOST} ]] ; then
32 case ${CHOST} in
33 *-newlib|*-elf) ;;
34 *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
35 esac
36 fi
37 }
38
39 src_unpack() {
40 unpack ${A}
41 mkdir -p "${NEWLIBBUILD}"
42 }
43
44 src_compile() {
45 # we should fix this ...
46 unset LDFLAGS
47 CHOST=${CTARGET} strip-unsupported-flags
48
49 local myconf=""
50 # hardwired to avoid breakages
51 [[ $(tc-is-softfloat) != "no" ]] \
52 && myconf="--disable-newlib-hw-fp" \
53 || myconf="--enable-newlib-hw-fp"
54 [[ ${CTARGET} == "spu" ]] \
55 && myconf="${myconf} --disable-newlib-multithread" \
56 || myconf="${myconf} $(use_enable threads newlib-multithread)"
57
58 cd "${NEWLIBBUILD}"
59
60 ECONF_SOURCE=${S} \
61 econf \
62 $(use_enable unicode newlib-mb) \
63 $(use_enable nls) \
64 ${myconf} \
65 || die "econf failed"
66 emake || die "emake failed"
67 }
68
69 src_install() {
70 cd "${NEWLIBBUILD}"
71 emake -j1 DESTDIR="${D}" install || die
72 # env -uRESTRICT CHOST=${CTARGET} prepallstrip
73 # minor hack to keep things clean
74 rm -fR "${D}"/usr/share/info
75 rm -fR "${D}"/usr/info
76 }

  ViewVC Help
Powered by ViewVC 1.1.20