force cdecl to use c90 std
[portage-squeep] / dev-util / cdecl / cdecl-2.5-r2.ebuild
1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 inherit eutils toolchain-funcs
6
7 DESCRIPTION="Turn English phrases to C or C++ declarations"
8 SRC_URI="ftp://ftp.netsw.org/softeng/lang/c/tools/cdecl/${P}.tar.gz"
9 HOMEPAGE="http://www.boutell.com/lsm/lsmbyid.cgi/002103"
10
11 KEYWORDS="amd64 ~mips ppc x86"
12 LICENSE="public-domain"
13 SLOT="0"
14
15 RDEPEND="readline? (
16 sys-libs/ncurses
17 sys-libs/readline
18 )"
19
20 DEPEND="${RDEPEND}
21 || (
22 dev-util/yacc
23 sys-devel/bison
24 )
25 !<dev-util/cutils-1.6-r2"
26
27 IUSE="readline"
28
29 src_unpack() {
30 unpack ${A}
31 cd "${S}"
32 epatch "${FILESDIR}/${P}.patch"
33 epatch "${FILESDIR}/${P}-implicit-pointer.patch"
34 }
35
36 src_compile() {
37 CFLAGS="${CFLAGS} --std=c90"
38 if use readline; then
39 CFLAGS="${CFLAGS} -DUSE_READLINE"
40 LIBS="${LIBS} -lreadline -lncurses"
41 fi
42 emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" || die
43 }
44
45 src_install() {
46 dobin cdecl
47 dohard /usr/bin/cdecl /usr/bin/c++decl
48 dodoc README
49 doman *.1
50 }