1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit eutils flag-o-matic multilib toolchain-funcs versionator
7 MY_P="${PN}_$(replace_all_version_separators '_')"
9 DESCRIPTION="DUMA (Detect Unintended Memory Access) is a memory debugging library"
10 HOMEPAGE="http://duma.sourceforge.net/"
12 SRC_URI="mirror://sourceforge/duma/${MY_P}.tar.gz"
16 KEYWORDS="amd64 ppc x86"
23 S="${WORKDIR}/${MY_P}"
26 #DUMA_OPTIONS="-DDUMA_LIB_NO_LEAKDETECTION"
27 DUMA_OPTIONS="-DDUMA_USE_FRAMENO"
28 if [ -n "${DUMA_OPTIONS}" ]; then
30 elog "Custom build options are ${DUMA_OPTIONS}."
33 elog "Custom build options are not set!"
35 elog "See the package Makefile for for more options (also installed"
36 elog "with package docs as Makefile.duma)."
43 sed -i -e "s:(prefix)/lib:(prefix)/$(get_libdir):g" Makefile
44 sed -i -e "s:share/doc/duma:share/doc/${P}:g" Makefile
49 append-flags -Wall -Wextra -U_FORTIFY_SOURCE
50 tc-export AR CC CXX LD RANLIB
52 use amd64 && export DUMA_ALIGNMENT=16
54 make CPPFLAGS="${DUMA_OPTIONS}" reconfig || die "make reconfig failed"
55 emake CFLAGS="${CFLAGS}" CC=$(tc-getCC) || die "make failed"
59 ewarn "Control-C now if you want to disable tests..."
63 use amd64 && export DUMA_ALIGNMENT=16
64 make CFLAGS="${DUMA_OPTIONS} ${CFLAGS}" \
65 CC=$(tc-getCC) test || die "make test failed"
68 ewarn "Check output above to verify all tests have passed. Both"
69 ewarn "static and dynamic confidence tests should say PASSED."
74 # make install fails nicely here on the first file...
75 make DESTDIR="${D}" install || die "make install failed"
77 # All the good comments on duma build options are in the Makefile
78 newdoc Makefile Makefile.duma
81 insinto /usr/share/doc/${P}/examples
82 doins example[1-6].cpp
83 doins example_makes/ex6/Makefile