1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils multilib flag-o-matic toolchain-funcs
8 if [[ ${PV} == "9999" ]] ; then
9 inherit autotools git-2
11 EGIT_REPO_URI="git://${PN}.git.sourceforge.net/gitroot/${PN}/${PN}"
13 KEYWORDS="~amd64 ~x86"
14 SRC_URI="mirror://sourceforge/project/${PN}/${PN}/${PV}/${P}.tar.bz2"
17 DESCRIPTION="OpenOCD - Open On-Chip Debugger"
18 HOMEPAGE="http://openocd.sourceforge.net"
22 IUSE="blaster dummy ftd2xx ftdi minidriver parport presto segger stlink usb versaloon"
23 RESTRICT="strip" # includes non-native binaries
25 # libftd2xx is the default because it is reported to work better.
26 DEPEND=">=dev-lang/jimtcl-0.73
27 usb? ( virtual/libusb:0 )
28 presto? ( dev-embedded/libftd2xx )
29 ftd2xx? ( dev-embedded/libftd2xx )
30 ftdi? ( dev-embedded/libftdi )"
33 REQUIRED_USE="blaster? ( || ( ftdi ftd2xx ) ) ftdi? ( !ftd2xx )"
36 if [[ ${PV} == "9999" ]] ; then
37 sed -i -e "/@include version.texi/d" doc/${PN}.texi || die
38 AT_NO_RECURSIVE=yes eautoreconf
41 # Disable craptastic build settings.
43 -e 's:if test "[$]OCDxprefix" != "[$]ac_default_prefix":if false:' \
47 local pc="libftdi$(has_version '=dev-embedded/libftdi-1*' && echo 1)"
48 # Use libftdi-1 paths #460916
49 local libs=$($(tc-getPKG_CONFIG) --libs ${pc})
51 -e "s:-lftdi -lusb:${libs}:" \
52 configure src/Makefile.in || die
53 append-cppflags $($(tc-getPKG_CONFIG) --cflags ${pc})
58 # Here are some defaults
63 --disable-internal-jimtcl
81 # add explicitely the path to libftd2xx
82 use ftd2xx && append-ldflags -L/opt/$(get_libdir)
85 use ftdi && myconf+=( --enable-usb_blaster_libftdi )
86 use ftd2xx && myconf+=( --enable-usb_blaster_ftd2xx )
90 $(use_enable ftdi ft2232_libftdi) \
91 $(use_enable ftd2xx ft2232_ftd2xx) \
92 $(use_enable minidriver minidriver-dummy) \
93 $(use_enable parport) \
94 $(use_enable presto presto_ftd2xx) \
95 $(use_enable stlink) \
96 $(use_enable segger jlink) \
97 $(use_enable versaloon vsllink) \
103 env -uRESTRICT prepstrip "${ED}"/usr/bin "${ED}"/usr/$(get_libdir)