I think a comment should be left saying that this is inspired by the Arch Linux package for fftw: https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/fftw