package/fftw: break fftw-long-double into a dedicated package

fftw's library name depends on the precision option. Consequently,
it's possible to install multiple flavor on the same target.

This patch breaks fftw long double precision into a new package and:

- makes BR2_PACKAGE_FFTW_PRECISION_LONG_DOUBLE select
  BR2_PACKAGE_FFTW_LONG_DOUBLE to keep compatibility with packages
  that use BR2_PACKAGE_FFTW_PRECISION_LONG_DOUBLE. This option will be
  removed in a follow-up commit;

- makes fftw depend on fftw-long-double when this package is enabled.

Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
[Yann/Thomas:
 - Force --disable-long-double in FFTW_CONF_OPTS, just for the sake of
   clarity (fftw is no longer going to build the long double variant)
 - Use FFTW_LONG_DOUBLE_DL_SUBDIR to avoid downloading fftw multiple times
 - Minor reformatting tweaks in fftw-long-double.mk
 - Do not deprecate BR2_PACKAGE_FFTW_PRECISION_LONG_DOUBLE and instead
   make it select BR2_PACKAGE_FFTW_LONG_DOUBLE, so that packages using
   BR2_PACKAGE_FFTW_PRECISION_LONG_DOUBLE continue to work.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Tested-by:  "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Gwenhael Goavec-Merou 2019-01-21 14:50:57 +01:00 committed by Thomas Petazzoni
parent fca8b60f86
commit cab310b8fd
5 changed files with 38 additions and 1 deletions

View File

@ -40,6 +40,7 @@ config BR2_PACKAGE_FFTW_PRECISION_LONG_DOUBLE
# long-double precision require long-double trigonometric routines # long-double precision require long-double trigonometric routines
depends on !(BR2_TOOLCHAIN_BUILDROOT_UCLIBC && \ depends on !(BR2_TOOLCHAIN_BUILDROOT_UCLIBC && \
(BR2_arm || BR2_mips || BR2_mipsel)) (BR2_arm || BR2_mips || BR2_mipsel))
select BR2_PACKAGE_FFTW_LONG_DOUBLE
help help
Compile fftw in long double precision, i.e. use 'long double' Compile fftw in long double precision, i.e. use 'long double'
for floating point type. for floating point type.
@ -55,6 +56,7 @@ config BR2_PACKAGE_FFTW_PRECISION_QUAD
endchoice endchoice
source "package/fftw/fftw-single/Config.in" source "package/fftw/fftw-single/Config.in"
source "package/fftw/fftw-long-double/Config.in"
config BR2_PACKAGE_FFTW_FAST config BR2_PACKAGE_FFTW_FAST
bool "optimise for speed over accuracy" bool "optimise for speed over accuracy"

View File

@ -0,0 +1,8 @@
config BR2_PACKAGE_FFTW_LONG_DOUBLE
bool "fftw-long-double"
# long-double precision require long-double trigonometric routines
depends on !(BR2_TOOLCHAIN_USES_UCLIBC && \
(BR2_arm || BR2_mips || BR2_mipsel))
help
Compile fftw in long double precision, i.e. use 'long double'
for floating point type.

View File

@ -0,0 +1 @@
../fftw.hash

View File

@ -0,0 +1,22 @@
################################################################################
#
# fftw-long-double
#
################################################################################
FFTW_LONG_DOUBLE_VERSION = $(FFTW_VERSION)
FFTW_LONG_DOUBLE_SOURCE = fftw-$(FFTW_VERSION).tar.gz
FFTW_LONG_DOUBLE_SITE = $(FFTW_SITE)
FFTW_LONG_DOUBLE_DL_SUBDIR = fftw
FFTW_LONG_DOUBLE_INSTALL_STAGING = $(FFTW_INSTALL_STAGING)
FFTW_LONG_DOUBLE_LICENSE = $(FFTW_LICENSE)
FFTW_LONG_DOUBLE_LICENSE_FILES = $(FFTW_LICENSE_FILES)
FFTW_LONG_DOUBLE_CONF_ENV = $(FFTW_COMMON_CONF_ENV)
FFTW_LONG_DOUBLE_CONF_OPTS = \
$(FFTW_COMMON_CONF_OPTS) \
CFLAGS="$(FFTW_COMMON_CFLAGS)" \
--enable-long-double
$(eval $(autotools-package))

View File

@ -10,6 +10,10 @@ FFTW_INSTALL_STAGING = YES
FFTW_LICENSE = GPL-2.0+ FFTW_LICENSE = GPL-2.0+
FFTW_LICENSE_FILES = COPYING FFTW_LICENSE_FILES = COPYING
ifeq ($(BR2_PACKAGE_FFTW_LONG_DOUBLE),y)
FFTW_DEPENDENCIES += fftw-long-double
endif
ifeq ($(BR2_PACKAGE_FFTW_SINGLE),y) ifeq ($(BR2_PACKAGE_FFTW_SINGLE),y)
FFTW_DEPENDENCIES += fftw-single FFTW_DEPENDENCIES += fftw-single
endif endif
@ -44,7 +48,7 @@ FFTW_CONF_ENV = $(FFTW_COMMON_CONF_ENV)
FFTW_CONF_OPTS += \ FFTW_CONF_OPTS += \
$(FFTW_COMMON_CONF_OPTS) \ $(FFTW_COMMON_CONF_OPTS) \
--disable-single \ --disable-single \
$(if $(BR2_PACKAGE_FFTW_PRECISION_LONG_DOUBLE),--enable,--disable)-long-double \ --disable-long-double \
$(if $(BR2_PACKAGE_FFTW_PRECISION_QUAD),--enable,--disable)-quad-precision \ $(if $(BR2_PACKAGE_FFTW_PRECISION_QUAD),--enable,--disable)-quad-precision \
CFLAGS="$(FFTW_COMMON_CFLAGS)" CFLAGS="$(FFTW_COMMON_CFLAGS)"