summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2006-06-14 18:29:49 +0000
committerLuca Barbato <lu_zero@gentoo.org>2006-06-14 18:29:49 +0000
commit7de6703c56f2cb0aa22b78c99caab09abba81be1 (patch)
tree97cfb5601539d3c8522f261d48286f63fe33c7e4 /sys-libs
parentBuilds the spu target (diff)
downloadlu_zero-7de6703c56f2cb0aa22b78c99caab09abba81be1.tar.gz
lu_zero-7de6703c56f2cb0aa22b78c99caab09abba81be1.tar.bz2
lu_zero-7de6703c56f2cb0aa22b78c99caab09abba81be1.zip
Cleanup, thanks to vapier for the input
svn path=/; revision=7
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/newlib/newlib-1.14.0.ebuild59
1 files changed, 35 insertions, 24 deletions
diff --git a/sys-libs/newlib/newlib-1.14.0.ebuild b/sys-libs/newlib/newlib-1.14.0.ebuild
index c58a9be..30e8af9 100644
--- a/sys-libs/newlib/newlib-1.14.0.ebuild
+++ b/sys-libs/newlib/newlib-1.14.0.ebuild
@@ -6,6 +6,16 @@ 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 uclibc 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/"
@@ -16,7 +26,7 @@ LICENSE="NEWLIB"
&& SLOT="${CTARGET}" \
|| SLOT="0"
KEYWORDS="-*"
-IUSE="nls threads"
+IUSE="nls threads unicode multilib"
DEPEND=""
RDEPEND=""
@@ -35,24 +45,10 @@ alt_build_kprefix() {
fi
}
-target_myconf() { #target specific features
- case ${CTARGET} in
- spu) echo "--disable-threads"
- ;;
- *) echo "`use_enable threads`"
- ;;
- esac
-}
-
target_cflags() { #target specific cflags
- if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
- export CTARGET=${CATEGORY/cross-}
- fi
- else
- #FIXME
- unset CFLAGS
- unset CXXFLAGS
+
+ unset CFLAGS
+ unset CXXFLAGS
case ${CTARGET} in
spu) CFLAGS="-O2" # -DBPA
@@ -61,7 +57,6 @@ target_cflags() { #target specific cflags
;;
esac
- fi
}
src_unpack() {
@@ -74,9 +69,21 @@ src_unpack() {
src_compile() {
- local myconf=$(target_myconf)
-
- target_cflags
+ local myconf=""
+#hardwired to avoid breakages
+ case ${CTARGET} in
+ *-softfloat-*) myconf="--disable-newlib-hw-fp"
+ ;;
+ esac
+
+#to the user discretion
+ myconf="${myconf} `use_enable unicode newlib-mb`"
+ myconf="${myconf} `use_enable nls`"
+ myconf="${myconf} `use_enable multilib`"
+ [[ ${CTARGET} == "spu" ]] || myconf="${myconf} `use_enable threads`"
+ [[ ${CTARGET} == "spu" ]] && myconf="${myconf} --disable-threads"
+
+#useflag stripping game
cd ${NEWLIBBUILD}
@@ -84,8 +91,7 @@ src_compile() {
--host=${CHOST} \
--target=${CTARGET} \
--prefix=$(alt_build_kprefix) \
- ${myconf} \
- `use_enable nls` || die "econf failed"
+ ${myconf} || die "econf failed"
emake || die "emake failed"
}
@@ -93,3 +99,8 @@ src_install() {
cd ${NEWLIBBUILD}
emake -j1 DESTDIR=${D} install
}
+
+src_strip() {
+env -uRESTRICT CHOST=${CTARGET} prepallstrip
+}
+