# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-libs/dietlibc/dietlibc-0.33.ebuild,v 1.1 2013/10/13 15:15:44 polynomial-c Exp $ EAPI=5 inherit eutils flag-o-matic toolchain-funcs DESCRIPTION="A libc optimized for small size" HOMEPAGE="http://www.fefe.de/dietlibc/" SRC_URI="http://www.fefe.de/dietlibc/${P}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~alpha ~amd64 ~arm -hppa ~ia64 ~mips ~sparc ~x86 ~amd64-linux ~x86-linux" IUSE="" DEPEND="" RDEPEND="" DIETHOME=/usr/diet IUSE_LIBC_TARGET="alpha arm armeb i386 ia64 mips mipsel parisc parisc64 ppc ppc64 s390 s390x sparc sparc64 x86_64" for t in ${IUSE_LIBC_TARGET} ; do IUSE="${IUSE} target_${t}" done src_prepare() { epatch "${FILESDIR}/${PV}-BJA-nostrip.diff" } diet_flags() { # Reset CFLAGS CFLAGS="" # Replace sparc64 related C[XX]FLAGS (see bug #45716) use sparc && replace-sparc64-flags # gcc-hppa suffers support for SSP, compilation will fail use hppa && strip-unsupported-flags # Makefile does not append CFLAGS append-flags -nostdinc -W -Wall -Wextra -Wchar-subscripts \ -Wmissing-prototypes -Wmissing-declarations -Wno-switch \ -Wno-unused -Wredundant-decls -fno-strict-aliasing # only use -nopie on archs that support it gcc-specs-pie && append-flags -nopie append-flags -Wa,--noexecstack } src_compile() { for t in ${IUSE_LIBC_TARGET} ; do use target_$t $USE || continue tC="CROSS_$t" if [ -z "${!tC}" ] ; then ewarn "CROSS_$t not defined, can't build" sleep 15 continue fi CHOST="$t" diet_flags einfo "Building libc $t" emake prefix="${EPREFIX}"${DIETHOME} \ MYARCH="${t}" \ CROSS="${!tC}" \ CFLAGS="${CFLAGS}" done } src_install() { emake prefix="${EPREFIX}"${DIETHOME} \ DESTDIR="${ED}" \ install-headers for t in ${IUSE_LIBC_TARGET} ; do use target_$t $USE || continue einfo "Installing libc $t" emake prefix="${EPREFIX}"${DIETHOME} \ MYARCH="${t}" \ DESTDIR="${ED}" \ install-bin done dobin "${ED}"${DIETHOME}/bin/* doman "${ED}"${DIETHOME}/man/*/* rm -r "${ED}"${DIETHOME}/{man,bin} || die dodoc AUTHOR BUGS CAVEAT CHANGES README THANKS TODO PORTING }