fftw: add compile precision option
authorGwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
Mon, 16 Mar 2015 16:31:20 +0000 (17:31 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 16 Mar 2015 18:44:02 +0000 (19:44 +0100)
fftw has options to select compile precision between single, long-double
and quad. These options are exclusives. This patch adds choice to select
precision option.

Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
[yann.morin.1998@free.fr: use --disable-XXX when not enabled; reword
 prompts (default is not 'none' but 'double')
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: guillaume william brs <guillaume.bressaix@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/fftw/Config.in
package/fftw/fftw.mk

index 36f849f12bce7591b0e7c8cbe54e3852acd4312c..4cefa28edff9c1cd1aad87f43b7fb05cdbf5abb1 100644 (file)
@@ -9,3 +9,44 @@ config BR2_PACKAGE_FFTW
          double precision.
 
          http://www.fftw.org
+
+if BR2_PACKAGE_FFTW
+
+choice
+       prompt "fftw precision"
+       default BR2_PACKAGE_FFTW_PRECISION_DOUBLE
+       help
+         Selects fftw precision
+
+config BR2_PACKAGE_FFTW_PRECISION_SINGLE
+       bool "single"
+       help
+         Compile fftw in single precision, i.e. use 'float' for floating
+         point type.
+
+config BR2_PACKAGE_FFTW_PRECISION_DOUBLE
+       bool "double"
+       help
+         Compile fftw in double precision (the default), i.e. use 'double'
+         for floating point type.
+
+config BR2_PACKAGE_FFTW_PRECISION_LONG_DOUBLE
+       bool "long double"
+       # long-double precision require long-double trigonometric routines
+       depends on !(BR2_TOOLCHAIN_BUILDROOT_UCLIBC && \
+               (BR2_arm || BR2_mips || BR2_mipsel))
+       help
+         Compile fftw in long double precision, i.e. use 'long double'
+         for floating point type.
+
+config BR2_PACKAGE_FFTW_PRECISION_QUAD
+       bool "quad"
+       # quad-precision needs to have a gcc with libquadmath
+       depends on (BR2_i386 || BR2_x86_64) && BR2_USE_WCHAR
+       help
+         Compile fftw in quadruple precision, i.e. use '__float128' for
+         floating point type.
+
+endchoice
+
+endif
index 3b302dff2a85d2b4c0b3555068cb402dfe15ea75..78d36e97d7759d0fbb12784b12d6473e3cc5b740 100644 (file)
@@ -10,4 +10,8 @@ FFTW_INSTALL_STAGING = YES
 FFTW_LICENSE = GPLv2+
 FFTW_LICENSE_FILES = COPYING
 
+FFTW_CONF_OPTS += $(if $(BR2_PACKAGE_FFTW_PRECISION_SINGLE),--enable,--disable)-single
+FFTW_CONF_OPTS += $(if $(BR2_PACKAGE_FFTW_PRECISION_LONG_DOUBLE),--enable,--disable)-long-double
+FFTW_CONF_OPTS += $(if $(BR2_PACKAGE_FFTW_PRECISION_QUAD),--enable,--disable)-quad-precision
+
 $(eval $(autotools-package))