mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-10 14:36:58 +02:00
newlib: import from portage/
We need this for the bare metal arm cross-compiler. BUG=chromium-os:26016 TEST=`./setup_board --board=x86-alex` worked for installing newlib Change-Id: I2c0771b8969c297f25c9e4fcea2e0b5176d871c3 Reviewed-on: https://gerrit.chromium.org/gerrit/16965 Reviewed-by: Matt Tennant <mtennant@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
b74d1845ca
commit
5500cea420
1
sdk_container/src/third_party/portage-stable/sys-libs/newlib/Manifest
vendored
Normal file
1
sdk_container/src/third_party/portage-stable/sys-libs/newlib/Manifest
vendored
Normal file
@ -0,0 +1 @@
|
||||
DIST newlib-1.18.0.tar.gz 13598301 RMD160 69d96fd323a23857072f30cb51899040099857cd SHA1 a47d3b8a508304143334b36bdb5b33786a61ce94 SHA256 d608f22b0b2e7725d2fca13cac19f34bc652d9773acadae778db9881746cb071
|
74
sdk_container/src/third_party/portage-stable/sys-libs/newlib/newlib-1.18.0.ebuild
vendored
Normal file
74
sdk_container/src/third_party/portage-stable/sys-libs/newlib/newlib-1.18.0.ebuild
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $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 $
|
||||
|
||||
inherit eutils flag-o-matic toolchain-funcs
|
||||
|
||||
export CBUILD=${CBUILD:-${CHOST}}
|
||||
export CTARGET=${CTARGET:-${CHOST}}
|
||||
if [[ ${CTARGET} == ${CHOST} ]] ; then
|
||||
if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
|
||||
export CTARGET=${CATEGORY/cross-}
|
||||
fi
|
||||
fi
|
||||
|
||||
# Handle the case where we want newlib on glibc ...
|
||||
if [[ ${CTARGET} == ${CHOST} ]] && [[ ${CHOST} != *-newlib ]] ; then
|
||||
export CTARGET=${CHOST%%-*}-pc-linux-newlib
|
||||
fi
|
||||
|
||||
DESCRIPTION="Newlib is a C library intended for use on embedded systems"
|
||||
HOMEPAGE="http://sourceware.org/newlib/"
|
||||
SRC_URI="ftp://sources.redhat.com/pub/newlib/${P}.tar.gz"
|
||||
|
||||
LICENSE="NEWLIB LIBGLOSS GPL-2"
|
||||
[[ ${CTARGET} != ${CHOST} ]] \
|
||||
&& SLOT="${CTARGET}" \
|
||||
|| SLOT="0"
|
||||
KEYWORDS="-* arm hppa m68k mips ppc ppc64 sh sparc x86"
|
||||
IUSE="nls threads unicode crosscompile_opts_headers-only"
|
||||
RESTRICT="strip"
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND=""
|
||||
|
||||
NEWLIBBUILD="${WORKDIR}/build"
|
||||
|
||||
src_unpack() {
|
||||
unpack ${A}
|
||||
mkdir -p "${NEWLIBBUILD}"
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# we should fix this ...
|
||||
unset LDFLAGS
|
||||
CHOST=${CTARGET} strip-unsupported-flags
|
||||
|
||||
local myconf=""
|
||||
# hardwired to avoid breakages
|
||||
[[ $(tc-is-softfloat) != "no" ]] \
|
||||
&& myconf="--disable-newlib-hw-fp" \
|
||||
|| myconf="--enable-newlib-hw-fp"
|
||||
[[ ${CTARGET} == "spu" ]] \
|
||||
&& myconf="${myconf} --disable-newlib-multithread" \
|
||||
|| myconf="${myconf} $(use_enable threads newlib-multithread)"
|
||||
|
||||
cd "${NEWLIBBUILD}"
|
||||
|
||||
ECONF_SOURCE=${S} \
|
||||
econf \
|
||||
$(use_enable unicode newlib-mb) \
|
||||
$(use_enable nls) \
|
||||
${myconf} \
|
||||
|| die "econf failed"
|
||||
emake || die "emake failed"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cd "${NEWLIBBUILD}"
|
||||
emake -j1 DESTDIR="${D}" install
|
||||
# env -uRESTRICT CHOST=${CTARGET} prepallstrip
|
||||
# minor hack to keep things clean
|
||||
rm -fR "${D}"/usr/share/info
|
||||
rm -fR "${D}"/usr/info
|
||||
}
|
Loading…
Reference in New Issue
Block a user