/[gentoo-x86]/dev-util/valgrind/valgrind-3.7.0-r4.ebuild
Gentoo

Contents of /dev-util/valgrind/valgrind-3.7.0-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Fri Sep 14 14:14:32 2012 UTC (22 months, 2 weeks ago) by ago
Branch: MAIN
Changes since 1.3: +2 -2 lines
Stable for amd64, wrt bug #434884

(Portage version: 2.1.11.9/cvs/Linux x86_64)

1 # Copyright 1999-2012 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.7.0-r4.ebuild,v 1.3 2012/09/13 11:22:13 blueness Exp $
4
5 EAPI="4"
6 inherit autotools eutils flag-o-matic toolchain-funcs multilib pax-utils
7
8 DESCRIPTION="An open-source memory debugger for GNU/Linux"
9 HOMEPAGE="http://www.valgrind.org"
10 SRC_URI="http://www.valgrind.org/downloads/${P}.tar.bz2"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="-* amd64 ~arm ppc ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
15 IUSE="mpi"
16
17 DEPEND="mpi? ( virtual/mpi )"
18 RDEPEND="${DEPEND}"
19
20 src_prepare() {
21 # Correct hard coded doc location
22 sed -i -e "s:doc/valgrind:doc/${PF}:" docs/Makefile.am || die
23
24 # Don't force multiarch stuff on OSX, bug #306467
25 sed -i -e 's:-arch \(i386\|x86_64\)::g' Makefile.all.am || die
26
27 # Respect CFLAGS, LDFLAGS
28 epatch "${FILESDIR}"/${PN}-3.7.0-respect-flags.patch
29
30 # Changing Makefile.all.am to disable SSP
31 epatch "${FILESDIR}"/${PN}-3.7.0-fno-stack-protector.patch
32
33 # Yet more local labels, this time for ppc32 & ppc64
34 epatch "${FILESDIR}"/${PN}-3.6.0-local-labels.patch
35
36 # Don't build in empty assembly files for other platforms or we'll get a QA
37 # warning about executable stacks.
38 epatch "${FILESDIR}"/${PN}-3.7.0-non-exec-stack-v2.patch
39
40 # Fix the regex to get gcc's version
41 epatch "${FILESDIR}"/${PN}-3.7.0-fix-gcc-regex.patch
42
43 # Fix stricter use of dir variables, bug #397429
44 epatch "${FILESDIR}"/${PN}-3.7.0-automake-1.11.2.patch
45
46 # Fix for glibc 2.15, bug #398921
47 epatch "${FILESDIR}"/${PN}-3.7.0-glibc-2.15.patch
48
49 # Regenerate autotools files
50 eautoreconf
51 }
52
53 src_configure() {
54 local myconf
55
56 # -fomit-frame-pointer "Assembler messages: Error: junk `8' after expression"
57 # while compiling insn_sse.c in none/tests/x86
58 # -fpie valgrind seemingly hangs when built with pie on
59 # amd64 (bug #102157)
60 # -fstack-protector more undefined references to __guard and __stack_smash_handler
61 # because valgrind doesn't link to glibc (bug #114347)
62 # -m64 -mx32 for multilib-portage, bug #398825
63 # -ggdb3 segmentation fault on startup
64 filter-flags -fomit-frame-pointer
65 filter-flags -fpie
66 filter-flags -fstack-protector
67 filter-flags -m64 -mx32
68 replace-flags -ggdb3 -ggdb2
69
70 if use amd64 || use ppc64; then
71 ! has_multilib_profile && myconf="${myconf} --enable-only64bit"
72 fi
73
74 # Force bitness on darwin, bug #306467
75 use x86-macos && myconf="${myconf} --enable-only32bit"
76 use x64-macos && myconf="${myconf} --enable-only64bit"
77
78 # Don't use mpicc unless the user asked for it (bug #258832)
79 if ! use mpi; then
80 myconf="${myconf} --without-mpicc"
81 fi
82
83 econf ${myconf}
84 }
85
86 src_install() {
87 emake DESTDIR="${D}" install
88 dodoc AUTHORS FAQ.txt NEWS README*
89
90 pax-mark m "${ED}"/usr/$(get_libdir)/valgrind/*-*-linux
91
92 if [[ ${CHOST} == *-darwin* ]] ; then
93 # fix install_names on shared libraries, can't turn them into bundles,
94 # as dyld won't load them any more then, bug #306467
95 local l
96 for l in "${ED}"/usr/lib/valgrind/*.so ; do
97 install_name_tool -id "${EPREFIX}"/usr/lib/valgrind/${l##*/} "${l}"
98 done
99 fi
100 }
101
102 pkg_postinst() {
103 ewarn "Valgrind will not work if glibc does not have debug symbols."
104 ewarn "To fix this you can add splitdebug to FEATURES in make.conf"
105 ewarn "and remerge glibc. See:"
106 ewarn "https://bugs.gentoo.org/show_bug.cgi?id=214065"
107 ewarn "https://bugs.gentoo.org/show_bug.cgi?id=274771"
108 ewarn "https://bugs.gentoo.org/show_bug.cgi?id=388703"
109 }

  ViewVC Help
Powered by ViewVC 1.1.20