]> granicus.if.org Git - libjpeg-turbo/commitdiff
Build: Don't allow jpeg-7+ emul. w/o arith coding
authorDRC <information@libjpeg-turbo.org>
Tue, 10 May 2016 01:00:46 +0000 (20:00 -0500)
committerDRC <information@libjpeg-turbo.org>
Tue, 10 May 2016 01:00:46 +0000 (20:00 -0500)
The jpeg-7/jpeg-8 APIs/ABIs require arithmetic coding, and the jpeg-8
API/ABI requires the memory source/destination manager, so this commit
causes the build system to ignore --with-arith-enc/--without-arith-enc
and --with-arith-dec/--without-arith-dec (and the equivalent CMake
variables-- WITH_ARITH_ENC and WITH_ARITH_DEC) when v7/v8 API/ABI
emulation is enabled.  Furthermore, the CMake build system now ignores
WITH_MEM_SRCDST whenever WITH_JPEG8 is specified (the autotools build
system already did that.)

CMakeLists.txt
configure.ac

index 1c4a46b700734a026f1f41d4d1a5e8eb0be31dcf..1ad29f06e6691b98455e4804ca837da7234e6f72 100644 (file)
@@ -34,8 +34,8 @@ endif()
 message(STATUS "VERSION = ${VERSION}, BUILD = ${BUILD}")
 
 option(WITH_SIMD "Include SIMD extensions" TRUE)
-option(WITH_ARITH_ENC "Include arithmetic encoding support" TRUE)
-option(WITH_ARITH_DEC "Include arithmetic decoding support" TRUE)
+option(WITH_ARITH_ENC "Include arithmetic encoding support when emulating the libjpeg v6b API/ABI" TRUE)
+option(WITH_ARITH_DEC "Include arithmetic decoding support when emulating the libjpeg v6b API/ABI" TRUE)
 option(WITH_JPEG7 "Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b)" FALSE)
 option(WITH_JPEG8 "Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b)" FALSE)
 option(WITH_MEM_SRCDST "Include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI" TRUE)
@@ -57,6 +57,14 @@ else()
   set(BITS_IN_JSAMPLE 8)
 endif()
 
+if(WITH_JPEG8 OR WITH_JPEG7)
+  set(WITH_ARITH_ENC 1)
+  set(WITH_ARITH_DEC 1)
+endif()
+if(WITH_JPEG8)
+  set(WITH_MEM_SRCDST 1)
+endif()
+
 if(WITH_ARITH_ENC)
   set(C_ARITH_CODING_SUPPORTED 1)
   message(STATUS "Arithmetic encoding support enabled")
index d6a3e33eeda55a00cd29fb7aa75ffc125a13e8f2..9b2c573cc2e2bb4b70417f9a9c393027005f8ae9 100644 (file)
@@ -279,10 +279,13 @@ AC_DEFINE_UNQUOTED([INLINE],[$ljt_cv_inline],[How to obtain function inlining.])
 AC_MSG_CHECKING([whether to include arithmetic encoding support])
 AC_ARG_WITH([arith-enc],
   AC_HELP_STRING([--without-arith-enc],
-    [Do not include arithmetic encoding support]))
+    [Do not include arithmetic encoding support when emulating the libjpeg v6b API/ABI]))
 if test "x$with_12bit" = "xyes"; then
   with_arith_enc=no
 fi
+if test "x${with_jpeg8}" = "xyes" -o "x${with_jpeg7}" = "xyes"; then
+  with_arith_enc=yes
+fi
 if test "x$with_arith_enc" = "xno"; then
   AC_MSG_RESULT(no)
   RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-enc"
@@ -295,10 +298,13 @@ AM_CONDITIONAL([WITH_ARITH_ENC], [test "x$with_arith_enc" != "xno"])
 AC_MSG_CHECKING([whether to include arithmetic decoding support])
 AC_ARG_WITH([arith-dec],
   AC_HELP_STRING([--without-arith-dec],
-    [Do not include arithmetic decoding support]))
+    [Do not include arithmetic decoding support when emulating the libjpeg v6b API/ABI]))
 if test "x$with_12bit" = "xyes"; then
   with_arith_dec=no
 fi
+if test "x${with_jpeg8}" = "xyes" -o "x${with_jpeg7}" = "xyes"; then
+  with_arith_dec=yes
+fi
 if test "x$with_arith_dec" = "xno"; then
   AC_MSG_RESULT(no)
   RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-dec"