summaryrefslogtreecommitdiff
path: root/repo/fftw/fftw.xibuild
blob: 41dd124c598b450a445b923af13e39dc6b2f2d88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh

NAME="fftw"
DESC="Discrete Fourier transform (DFT) library"

MAKEDEPS="make tar"
DEPS="musl "

PKG_VER=3.3.10
SOURCE="http://www.fftw.org/fftw-$PKG_VER.tar.gz"
ADDITIONAL="cycle.h.patch "

precisions="single double long-double"

prepare () {
    for i in $precisions; do
        mkdir $i
        tar -xf fftw-$PKG_VER.tar.gz -C $i
    done
}

build () {
	local i; for i in $precisions; do
		case "$i" in
			single) cf="--enable-single";;
			double) cf="";;
			long-double) cf="--enable-long-double";;
		esac

		case "$i" in
			single | double)
				cf="$cf --enable-sse2 --enable-avx";;
		esac

		printf "Building for $i precision ($cf)"
		cd $BUILD_ROOT/$i/fftw-$PKG_VER
		./configure \
			--prefix=/usr \
			--sysconfdir=/etc \
			--mandir=/usr/share/man \
			--infodir=/usr/share/info \
			--enable-shared \
			--enable-threads \
			$cf
		make
	done
}

package () {
    for i in $precisions; do 
		cd $BUILD_ROOT/$i/fftw-$PKG_VER
        make DESTDIR=$PKG_DEST install
    done
}