1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools eutils multilib
8 DESCRIPTION="A Debug Malloc Library"
9 HOMEPAGE="http://dmalloc.com"
10 SRC_URI="http://dmalloc.com/releases/${P}.tgz"
12 LICENSE="CC-BY-SA-3.0"
14 KEYWORDS="~alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86"
15 IUSE="static-libs threads"
17 DEPEND="sys-apps/texinfo"
20 DOCS=( NEWS README docs/NOTES docs/TODO )
23 # - Build objects twice, once -fPIC for shared.
25 # - Fix SONAME and NEEDED.
26 epatch "${FILESDIR}"/${P}-Makefile.in.patch
27 # - Broken test, always returns false.
28 epatch "${FILESDIR}"/${P}-cxx.patch
29 # - Add threads support.
30 use threads && epatch "${FILESDIR}"/${P}-threads.patch
31 # Respect CFLAGS/LDFLAGS. #337429
33 -e '/libdmalloc/ s:$(CC):& $(CFLAGS) $(LDFLAGS):g' \
34 || die "sed Makefile.in"
35 # - Run autoconf for -cxx.patch.
40 econf --enable-cxx --enable-shlib $(use_enable threads)
47 makeinfo dmalloc.texi || die
57 newdoc ChangeLog.1 ChangeLog
58 insinto /usr/share/doc/${PF}
59 doins docs/dmalloc.pdf
60 dohtml RELEASE.html docs/dmalloc.html
61 doinfo docs/dmalloc.info
63 # add missing symlinks, lazy
64 dosym lib${PN}.so.${PV} /usr/$(get_libdir)/lib${PN}.so
65 dosym lib${PN}.so.${PV} /usr/$(get_libdir)/lib${PN}.so.${PV%%.*}
67 for lib in cxx th thcxx; do
68 dosym lib${PN}${lib}.so.${PV} /usr/$(get_libdir)/lib${PN}${lib}.so
69 dosym lib${PN}${lib}.so.${PV} \
70 /usr/$(get_libdir)/lib${PN}${lib}.so.${PV%%.*}
73 if ! use static-libs; then
74 rm "${D}"/usr/$(get_libdir)/lib${PN}*.a || die