# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="An extension to gcc that knows how to compile nesC applications" HOMEPAGE="http://nescc.sourceforge.net/" SRC_URI="mirror://sourceforge/nescc/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="doc avr" RDEPEND=">=dev-embedded/tos-1.1.0 \ avr? ( >=cross-avr/binutils-2.14 \ >=cross-avr/gcc-3.3-r1 \ >=cross-avr/avr-libc-1.0.2-r1 )" DEPEND=">=dev-lang/perl-5.8.5-r2 \ ${RDEPEND}" pkg_setup() { if [ -z "${TOSDIR}" ] || [ ! -d "${TOSDIR}" ] then eerror "In order to compile nesc you have to set the" eerror "\$TOSDIR environment properly." eerror "" eerror "You can achieve this by emerging >=dev-embedded/tinyos-1.1.13" eerror "or by exporting TOSDIR=\"path to your tinyos dir\"" die "Couldn't find a valid TinyOS home" else if !use avr then ewarn "You are trying to build nesc without as-avr support." ewarn "Note that if you have gcc-avr, the support will be enabled by" ewarn "the configure script." fi einfo "Building nesC for ${TOSDIR}" fi } src_unpack() { unpack ${A} epatch ${FILESDIR}/${P}-*.patch.bz2 } src_compile() { econf --disable-dependency-tracking || die "econf failed" # language setting needed, otherwise gcc version # will sometimes not be detected right LANGUAGE=C emake || die "emake failed" } src_install() { LANGUAGE=C einstall || die "einstall failed" if use doc then dohtml -r -a html,jpg,pdf,txt doc/* fi dodoc COPYING COPYRIGHT INSTALL README }