1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
10 inherit flag-o-matic eutils
12 DESCRIPTION="C library for Atmel AVR microcontrollers"
13 HOMEPAGE="http://www.nongnu.org/avr-libc/"
14 SRC_URI="http://savannah.nongnu.org/download/avr-libc/${P}.tar.bz2
15 http://savannah.nongnu.org/download/avr-libc/${PN}-manpages-${PV}.tar.bz2
16 doc? ( http://savannah.nongnu.org/download/avr-libc/${PN}-user-manual-${PV}.tar.bz2 )"
20 KEYWORDS="amd64 ppc ppc64 x86"
21 IUSE="doc crosscompile_opts_headers-only"
23 DEPEND=">=sys-devel/crossdev-0.9.1"
24 [[ ${CATEGORY/cross-} != ${CATEGORY} ]] \
25 && RDEPEND="!dev-embedded/avr-libc" \
28 DOCS="AUTHORS ChangeLog* NEWS README"
31 # check for avr-gcc, bug #134738
32 ebegin "Checking for avr-gcc"
33 if type -p avr-gcc > /dev/null ; then
39 eerror "Failed to locate 'avr-gcc' in \$PATH. You can install an AVR toolchain using:"
40 eerror " $ crossdev -t avr"
42 die "AVR toolchain not found"
49 # work around broken gcc versions PR45261
51 for mcu in $(sed -r -n '/CHECK_AVR_DEVICE/{s:.*[(](.*)[)]:\1:;p}' configure.ac) ; do
52 if avr-gcc -E - -mmcu=${mcu} <<<"" |& grep -q 'unknown MCU' ; then
53 sed -i "/HAS_${mcu}=yes/s:yes:no:" configure
57 # Install docs in correct directory
58 sed -i -e "/DOC_INST_DIR/s:\$(VERSION):${PVR}:" configure || die
61 strip-unsupported-flags
67 # man pages can not go into standard locations
68 # as they would then overwrite libc man pages
69 insinto /usr/share/doc/${PF}/man/man3
70 doins "${WORKDIR}"/man/man3/*
72 use doc && dohtml "${WORKDIR}"/${PN}-user-manual-${PV}/*
74 # Make sure diff cross-compilers don't collide #414075
75 mv "${ED}"/usr/share/doc/{${PF},${CTARGET}-${PF}} || die