1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 inherit eutils flag-o-matic toolchain-funcs multilib multilib-minimal
7 DESCRIPTION="Extremely fast library for floating-point convolution"
8 HOMEPAGE="http://cr.yp.to/djbfft.html"
9 SRC_URI="http://cr.yp.to/djbfft/${P}.tar.gz"
11 LICENSE="public-domain"
13 KEYWORDS="alpha amd64 arm arm64 ~hppa ppc ppc64 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
15 DOCS=( CHANGES README TODO VERSION )
18 SOVER="${PV:0:1}.${PV:2:1}.${PV:3:1}" # a.bc -> a.b.c
19 # mask out everything, which is not suggested by the author (RTFM)!
20 ALLOWED_FLAGS="-fstack-protector -march -mcpu -pipe -mpreferred-stack-boundary -ffast-math"
23 SONAME="libdjbfft.so.${SOVER}"
26 "${FILESDIR}"/${P}-gcc3.patch \
27 "${FILESDIR}"/${P}-shared.patch \
28 "${FILESDIR}"/${P}-headers.patch
32 multilib_src_configure() {
33 [[ ${ABI} == x86* ]] && append-cflags -malign-double
35 sed -i -e "s:\"lib\":\"$(get_libdir)\":" hier.c || die
36 echo "$(tc-getCC) ${CFLAGS} -fPIC" > "conf-cc"
37 echo "$(tc-getCC) ${LDFLAGS}" > "conf-ld"
38 echo "${ED}usr" > "conf-home"
39 einfo "conf-cc: $(<conf-cc)"
42 multilib_src_compile() {
47 echo "the compile function was:"
49 echo "the conf-ld function was:"
55 for t in accuracy accuracy2 speed; do
58 LD_LIBRARY_PATH=. ./${t} > ${t}.out || die "test ${t} failed"
62 multilib_src_install() {
63 emake LIBDJBFFT=${SONAME} install
64 ./install || die "install failed"
65 dosym ${SONAME} /usr/$(get_libdir)/libdjbfft.so
66 dosym ${SONAME} /usr/$(get_libdir)/libdjbfft.so.${SOVER%%.*}