| 1 |
# Copyright 1999-2006 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/dev-util/valgrind/valgrind-3.1.1.ebuild,v 1.1 2006/03/30 15:51:01 griffon26 Exp $ |
| 4 |
|
| 5 |
inherit eutils flag-o-matic |
| 6 |
|
| 7 |
DESCRIPTION="An open-source memory debugger for GNU/Linux" |
| 8 |
HOMEPAGE="http://www.valgrind.org" |
| 9 |
SRC_URI="http://www.valgrind.org/downloads/${P}.tar.bz2" |
| 10 |
|
| 11 |
LICENSE="GPL-2" |
| 12 |
SLOT="0" |
| 13 |
KEYWORDS="-* ~amd64 ~ppc x86" |
| 14 |
IUSE="X" |
| 15 |
|
| 16 |
# bug #49147 (bogus stacktrace in gdb with --db-attach=yes) does not seem to be applicable anymore |
| 17 |
#RESTRICT="strip" |
| 18 |
|
| 19 |
src_unpack() { |
| 20 |
unpack ${A} |
| 21 |
cd "${S}" |
| 22 |
|
| 23 |
# make sure our CFLAGS are respected |
| 24 |
einfo "Changing configure.in to respect CFLAGS" |
| 25 |
sed -i -e 's:^CFLAGS="-Wno-long-long":CFLAGS="$CFLAGS -Wno-long-long":' configure.in |
| 26 |
|
| 27 |
# undefined references to __guard and __stack_smash_handler in VEX (bug #114347) |
| 28 |
einfo "Changing Makefile.flags.am to disable SSP" |
| 29 |
sed -i -e 's:^AM_CFLAGS_BASE = :AM_CFLAGS_BASE = -fno-stack-protector :' Makefile.flags.am |
| 30 |
|
| 31 |
# Correct hard coded doc location |
| 32 |
sed -i -e "s:doc/valgrind/:doc/${P}/:" docs/Makefile.am |
| 33 |
|
| 34 |
einfo "Regenerating autotools files..." |
| 35 |
autoconf || die "autoconf failed" |
| 36 |
automake || die "automake failed" |
| 37 |
|
| 38 |
# fix for amd64 no-multilib profile till valgrind 3.2.0 is out (bug #114407) |
| 39 |
use amd64 && (has_multilib_profile || epatch "${FILESDIR}/valgrind-3.1.0-amd64-nomultilib-fix.patch") |
| 40 |
} |
| 41 |
|
| 42 |
src_compile() { |
| 43 |
local myconf |
| 44 |
|
| 45 |
# -fomit-frame-pointer "Assembler messages: Error: junk `8' after expression" |
| 46 |
# while compiling insn_sse.c in none/tests/x86 |
| 47 |
# -fpie valgrind seemingly hangs when built with pie on |
| 48 |
# amd64 (bug #102157) |
| 49 |
# -fstack-protector more undefined references to __guard and __stack_smash_handler |
| 50 |
# because valgrind doesn't link to glibc (bug #114347) |
| 51 |
# -ggdb3 segmentation fault on startup |
| 52 |
filter-flags -fomit-frame-pointer |
| 53 |
filter-flags -fpie |
| 54 |
filter-flags -fstack-protector |
| 55 |
replace-flags -ggdb3 -ggdb2 |
| 56 |
|
| 57 |
# Optionally build in X suppression files |
| 58 |
use X && myconf="--with-x" || myconf="--with-x=no" |
| 59 |
|
| 60 |
econf ${myconf} || die "Configure failed!" |
| 61 |
emake || die "Make failed!" |
| 62 |
} |
| 63 |
|
| 64 |
src_install() { |
| 65 |
make DESTDIR="${D}" install || die "Install failed!" |
| 66 |
dodoc ACKNOWLEDGEMENTS AUTHORS FAQ.txt NEWS README* |
| 67 |
} |