mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Luca Barbato <lu_zero@gentoo.org>
To: musl@lists.openwall.com
Subject: musl live ebuild
Date: Tue, 31 Jul 2012 00:54:44 +0200	[thread overview]
Message-ID: <501710B4.9080307@gentoo.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 254 bytes --]

It should work fine as system ebuild, using it in crossdev requires the
toolchain to be patched to understand musl isn't a bare-metal libc (the
default search path change between those)

lu

-- 

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero


[-- Attachment #2: musl-9999.ebuild --]
[-- Type: text/plain, Size: 1735 bytes --]

# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=4

if [[ ${PV} == *9999 ]] ; then
	SCM="git-2"
#	EGIT_REPO_URI="git://git.etalabs.net/musl"
	EGIT_REPO_URI="/usr/src/musl"
fi


inherit eutils flag-o-matic toolchain-funcs ${SCM}

DESCRIPTION="Lightweight C standard library"
HOMEPAGE="http://www.etalabs.net/musl/"

if [[ ${PV} == *9999 ]] ; then
	SRC_URI=""
elif [[ ${PV%_p*} != ${PV} ]] ; then # Gentoo snapshot
	SRC_URI="http://dev.gentoo.org/~lu_zero/${PN}/${P}.tar.xz"
else # Official release
	SRC_URI="http://www.etalabs.net/${PN}/releases/${P}.tar.gz"
fi

export CBUILD=${CBUILD:-${CHOST}}
export CTARGET=${CTARGET:-${CHOST}}
if [[ ${CTARGET} == ${CHOST} ]] ; then
	if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
		export CTARGET=${CATEGORY/cross-}
	fi
fi

LICENSE="MIT"
[[ ${CTARGET} != ${CHOST} ]] \
	&& SLOT="${CTARGET}" \
	|| SLOT="0"

[[ ${PV} == *9999 ]] || KEYWORDS="~arm ~amd64 ~x86"
IUSE="crosscompile_opts_headers-only debug"

DEPEND=""
RDEPEND="${DEPEND}"

pkt_setup() {
	if [[ ${CTARGET} == ${CHOST} ]] ; then
		case ${CHOST} in
			*-musl) ;;
			*) die "Use sys-devel/crossdev to build a musl toolchain"
		esac
	fi
}

src_configure() {
	tc-export CC
	local myconf="--disable-gcc-wrapper"

	if tc-is-cross-compiler ; then
		myconf+=" --target=${CTARGET}"
	fi

#		$(use_enable static-libs static) \
	./configure ${myconf} \
		--prefix=/usr \
		$(use_enable debug) \
		|| die "configure failed"
}

src_install() {
	local sysroot=${D}
	local target=install
	[[ ${CTARGET} != ${CHOST} ]] && sysroot+="/usr/${CTARGET}"
	emake DESTDIR="${sysroot}" ${target}

	[[ ${CTARGET} != ${CHOST} ]] && \
		dosym usr/include /usr/${CTARGET}/sys-include
}

             reply	other threads:[~2012-07-30 22:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-30 22:54 Luca Barbato [this message]
2012-08-01  0:59 ` John Spencer
2012-08-01  1:12   ` Kyle Sanderson
2012-08-01  7:33   ` Luca Barbato

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=501710B4.9080307@gentoo.org \
    --to=lu_zero@gentoo.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).