jpeg: rework jpeg-turbo simd support handling
authorPeter Korsgaard <peter@korsgaard.com>
Sun, 11 Dec 2016 15:52:17 +0000 (16:52 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 11 Dec 2016 17:21:53 +0000 (18:21 +0100)
In preperation for adding more architectures to the jpeg-turbo simd
handling, introduce a hidden BR2_PACKAGE_JPEG_SIMDS_SUPPORT symbol and use
that to enable simd support and default to jpeg-turbo, instead of open
coding it in both places.

While we are at it, reword the help text to be more useful.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/jpeg-turbo/jpeg-turbo.mk
package/jpeg/Config.in

index c3de04af7e97a56a58d84676e96d2c25b79294d3..e2b7e63b9aa7e74bca94fcd840edf9b9ea8f84e0 100644 (file)
@@ -15,7 +15,7 @@ JPEG_TURBO_DEPENDENCIES = host-pkgconf
 
 JPEG_TURBO_CONF_OPTS = --with-jpeg8
 
-ifeq ($(BR2_X86_CPU_HAS_MMX)$(BR2_ARM_CPU_HAS_NEON),y)
+ifeq ($(BR2_PACKAGE_JPEG_SIMD_SUPPORT),y)
 JPEG_TURBO_CONF_OPTS += --with-simd
 # x86 simd support needs nasm
 JPEG_TURBO_DEPENDENCIES += $(if $(BR2_X86_CPU_HAS_MMX),host-nasm)
index f337aeb9560fa0662d72f4baa5a058bfde72e75a..170e58c5d935210570b1d6800a6d95c3722f8c52 100644 (file)
@@ -3,13 +3,18 @@ config BR2_PACKAGE_JPEG
        help
          Select the desired JPEG library provider.
 
+# jpeg-turbo has simd support for some architectures
+config BR2_PACKAGE_JPEG_SIMD_SUPPORT
+       bool
+       default y if BR2_X86_CPU_HAS_MMX || BR2_ARM_CPU_HAS_NEON
+
 if BR2_PACKAGE_JPEG
 
 choice
        prompt "jpeg variant"
-       default BR2_PACKAGE_JPEG_TURBO if (BR2_X86_CPU_HAS_MMX || BR2_ARM_CPU_HAS_NEON)
+       default BR2_PACKAGE_JPEG_TURBO if BR2_PACKAGE_JPEG_SIMD_SUPPORT
        help
-         Select the older stable version, or the newer developer version
+         Select the normal libjpeg or libjpeg-turbo.
 
 config BR2_PACKAGE_LIBJPEG
        bool "jpeg"