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

Contents of /sys-libs/newlib/newlib-9999.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, 7 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +3 -3 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-9999.ebuild,v 1.3 2015/02/25 19:42:48 vapier Exp $
4
5 EAPI="4"
6
7 inherit flag-o-matic toolchain-funcs eutils
8
9 if [[ ${PV} == "9999" ]] ; then
10 EGIT_REPO_URI="git://sourceware.org/git/newlib.git"
11 inherit git-r3
12 else
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"
16 fi
17 fi
18
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-}
24 fi
25 fi
26
27 DESCRIPTION="Newlib is a C library intended for use on embedded systems"
28 HOMEPAGE="http://sourceware.org/newlib/"
29
30 LICENSE="NEWLIB LIBGLOSS GPL-2"
31 SLOT="0"
32 IUSE="nls threads unicode crosscompile_opts_headers-only"
33 RESTRICT="strip"
34
35 NEWLIBBUILD="${WORKDIR}/build"
36
37 pkg_setup() {
38 # Reject newlib-on-glibc type installs
39 if [[ ${CTARGET} == ${CHOST} ]] ; then
40 case ${CHOST} in
41 *-newlib|*-elf) ;;
42 *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
43 esac
44 fi
45 }
46
47 src_prepare() {
48 epatch_user
49 }
50
51 src_configure() {
52 # we should fix this ...
53 unset LDFLAGS
54 CHOST=${CTARGET} strip-unsupported-flags
55
56 local myconf=""
57 [[ ${CTARGET} == "spu" ]] \
58 && myconf="${myconf} --disable-newlib-multithread" \
59 || myconf="${myconf} $(use_enable threads newlib-multithread)"
60
61 mkdir -p "${NEWLIBBUILD}"
62 cd "${NEWLIBBUILD}"
63
64 ECONF_SOURCE=${S} \
65 econf \
66 $(use_enable unicode newlib-mb) \
67 $(use_enable nls) \
68 ${myconf}
69 }
70
71 src_compile() {
72 emake -C "${NEWLIBBUILD}"
73 }
74
75 src_install() {
76 cd "${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
82 }

  ViewVC Help
Powered by ViewVC 1.1.20