pkgsrc/math/fftw/Makefile.common
nia eab927a4f0 split fftw package into -long and -quad precision variants
the package previously used PKG_OPTIONS for this, but PKG_OPTIONS
are harmful in the case that they effect the resulting ABI of
library packages. this way, things that actually need fftwl and fftwq
can depend on these sub-packages.

this also fixes fftwq on NetBSD by making it pull in libquadmath.
another thing about PKG_OPTIONS for library components is that
they mean certain components don't get tested...
2021-05-16 10:14:09 +00:00

67 lines
1.7 KiB
Text

# $NetBSD: Makefile.common,v 1.4 2021/05/16 10:14:09 nia Exp $
# used by math/fftw/Makefile
# used by math/fftw-long/Makefile
# used by math/fftw-quad/Makefile
DISTNAME= fftw-3.3.9
CATEGORIES= math
MASTER_SITES= ftp://ftp.fftw.org/pub/fftw/
MASTER_SITES+= http://www.fftw.org/
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.fftw.org/
LICENSE= gnu-gpl-v2
DISTINFO_FILE= ${.CURDIR}/../../math/fftw/distinfo
PATCHDIR= ${.CURDIR}/../../math/fftw/patches
USE_LANGUAGES= c
USE_LIBTOOL= yes
USE_TOOLS+= gmake
USE_TOOLS+= perl
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --enable-shared
TEST_TARGET= check
.include "../../mk/bsd.prefs.mk"
PKGCONFIG_OVERRIDE+= fftw.pc.in
INFO_FILES= yes
.include "options.mk"
# Test will only use the default build.
USE_TOOLS+= perl:test sed
PLIST_VARS+= pthreads
PTHREAD_OPTS= native
.include "../../mk/pthread.buildlink3.mk"
.if ${PTHREAD_TYPE} == "native"
CONFIGURE_ARGS+= --enable-threads
PLIST.pthreads= yes
.endif
CONFIGURE_SCRIPT= ./configure
.for p in ${FFTW_PRECISION}
CONFIGURE_DIRS+= build/${p}
MAKE_DIRS+= build/${p}
.endfor
pre-configure:
.for d in ${CONFIGURE_DIRS}
mkdir -p ${WRKSRC:Q}/${d}
. if ${d} == "build/float"
printf '#!/bin/sh\nexec ../../configure "$$@" --enable-${d:S,build/,,} ${FFTW_FLOAT_OPTS}' \
> ${WRKSRC:Q}/${d}/configure
. elif ${d} == "build/double"
printf '#!/bin/sh\nexec ../../configure "$$@" ${FFTW_DOUBLE_OPTS}' \
> ${WRKSRC:Q}/${d}/configure
. elif ${d} == "build/quad-precision"
printf '#!/bin/sh\nexec ../../configure "$$@" --enable-${d:S,build/,,} --disable-mpi\n' \
> ${WRKSRC:Q}/${d}/configure
. else
printf '#!/bin/sh\nexec ../../configure "$$@" --enable-${d:S,build/,,}\n' \
> ${WRKSRC:Q}/${d}/configure
. endif
chmod +x ${WRKSRC:Q}/${d}/configure
.endfor