package: add selection between libjpeg and jpeg-turbo
authorPeter Korsgaard <jacmet@sunsite.dk>
Thu, 13 Dec 2012 22:58:11 +0000 (23:58 +0100)
committerPeter Korsgaard <jacmet@sunsite.dk>
Thu, 13 Dec 2012 23:03:32 +0000 (00:03 +0100)
Introduce a virtual 'jpeg' package, which pulls in either libjpeg or
jpeg-turbo depending on a choice selection.

Rename jpeg package to libjpeg so we can reuse 'jpeg' for the virtual
package, making the change transparent to existing users and all the
packages using libjpeg.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/Config.in
package/jpeg-turbo/Config.in [deleted file]
package/jpeg/Config.in
package/jpeg/jpeg.mk
package/libjpeg/libjpeg.mk [new file with mode: 0644]

index 7358d93a1a0f43fd00ef2747f4565126da7b9fd5..cad1221c56284107743e662826877bd188f9b38e 100644 (file)
@@ -391,7 +391,6 @@ source "package/gtk2-engines/Config.in"
 source "package/gtk2-themes/Config.in"
 source "package/imlib2/Config.in"
 source "package/jpeg/Config.in"
-source "package/jpeg-turbo/Config.in"
 source "package/libart/Config.in"
 source "package/libdmtx/Config.in"
 source "package/libdrm/Config.in"
diff --git a/package/jpeg-turbo/Config.in b/package/jpeg-turbo/Config.in
deleted file mode 100644 (file)
index 19765b0..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-config BR2_PACKAGE_JPEG_TURBO
-       bool "jpeg-turbo"
-       help
-         Libjpeg-turbo is a derivative of libjpeg that uses SIMD
-         instructions (MMX, SSE2, NEON) to accelerate baseline JPEG
-         compression and decompression on x86, x86-64, and ARM
-         systems.
-
-         http://www.libjpeg-turbo.org
index 36d73c51c99475bc7ffba74cdf90d3f0158eae44..9508faf24dd70196c8f21cfd17f8860adae0b2dd 100644 (file)
@@ -1,6 +1,33 @@
 config BR2_PACKAGE_JPEG
+       bool "jpeg support"
+       help
+         Select the desired JPEG library provider.
+
+if BR2_PACKAGE_JPEG
+
+choice
+       prompt "jpeg variant"
+       default BR2_PACKAGE_JPEG_TURBO if (BR2_X86_CPU_HAS_MMX || BR2_ARM_CPU_HAS_NEON)
+       help
+         Select the older stable version, or the newer developer version
+
+config BR2_PACKAGE_LIBJPEG
        bool "jpeg"
        help
          The ubiquitous C library for manipulating JPEG images.
 
          http://www.ijg.org/
+
+config BR2_PACKAGE_JPEG_TURBO
+       bool "jpeg-turbo"
+       help
+         Libjpeg-turbo is a derivative of libjpeg that uses SIMD
+         instructions (MMX, SSE2, NEON) to accelerate baseline JPEG
+         compression and decompression on x86, x86-64, and ARM
+         systems.
+
+         http://www.libjpeg-turbo.org
+
+endchoice
+
+endif
index d7ef25a8ce849ab72a3ac39cea1d5a86a5ee23f5..9f40e6f78907de87aac6bddb759c9aae8a2202df 100644 (file)
@@ -1,18 +1,9 @@
 #############################################################
 #
-# jpeg (libraries needed by some apps)
+# jpeg
 #
 #############################################################
-JPEG_VERSION = 8d
-JPEG_SITE = http://www.ijg.org/files/
-JPEG_SOURCE = jpegsrc.v$(JPEG_VERSION).tar.gz
-JPEG_INSTALL_STAGING = YES
 
-define JPEG_REMOVE_USELESS_TOOLS
-       rm -f $(addprefix $(TARGET_DIR)/usr/bin/,cjpeg djpeg jpegtrans rdjpgcom wrjpgcom)
-endef
+jpeg: $(if $(BR2_PACKAGE_JPEG_TURBO),jpeg-turbo,libjpeg)
 
-JPEG_POST_INSTALL_TARGET_HOOKS += JPEG_REMOVE_USELESS_TOOLS
-
-$(eval $(autotools-package))
-$(eval $(host-autotools-package))
+host-jpeg: host-libjpeg
diff --git a/package/libjpeg/libjpeg.mk b/package/libjpeg/libjpeg.mk
new file mode 100644 (file)
index 0000000..0df2b3a
--- /dev/null
@@ -0,0 +1,19 @@
+#############################################################
+#
+# libjpeg (libraries needed by some apps)
+#
+#############################################################
+
+LIBJPEG_VERSION = 8d
+LIBJPEG_SITE = http://www.ijg.org/files/
+LIBJPEG_SOURCE = jpegsrc.v$(LIBJPEG_VERSION).tar.gz
+LIBJPEG_INSTALL_STAGING = YES
+
+define LIBJPEG_REMOVE_USELESS_TOOLS
+       rm -f $(addprefix $(TARGET_DIR)/usr/bin/,cjpeg djpeg jpegtrans rdjpgcom wrjpgcom)
+endef
+
+LIBJPEG_POST_INSTALL_TARGET_HOOKS += LIBJPEG_REMOVE_USELESS_TOOLS
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))