/[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.4 - (show annotations) (download)
Fri Feb 27 08:01:12 2015 UTC (3 years, 4 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +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.19.0.ebuild,v 1.3 2013/02/09 04:40:10 vapier 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-* ]] ; 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://sourceware.org/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 [[ ${CTARGET} == "spu" ]] \
51 && myconf="${myconf} --disable-newlib-multithread" \
52 || myconf="${myconf} $(use_enable threads newlib-multithread)"
53
54 cd "${NEWLIBBUILD}"
55
56 ECONF_SOURCE=${S} \
57 econf \
58 $(use_enable unicode newlib-mb) \
59 $(use_enable nls) \
60 ${myconf} \
61 || die "econf failed"
62 emake || die "emake failed"
63 }
64
65 src_install() {
66 cd "${NEWLIBBUILD}"
67 emake -j1 DESTDIR="${D}" install || die
68 # env -uRESTRICT CHOST=${CTARGET} prepallstrip
69 # minor hack to keep things clean
70 rm -fR "${D}"/usr/share/info
71 rm -fR "${D}"/usr/info
72 }

  ViewVC Help
Powered by ViewVC 1.1.20