--- comm-release.orig/mozilla/configure.in	2013-01-11 15:45:43 +0900
+++ comm-release/mozilla/configure.in	2013-01-11 16:39:37 +0900
@@ -4071,9 +4071,6 @@
                    [ #if JPEG_LIB_VERSION < $MOZJPEG
                      #error "Insufficient JPEG library version ($MOZJPEG required)."
                      #endif
-                     #ifndef JCS_EXTENSIONS
-                     #error "libjpeg-turbo JCS_EXTENSIONS required"
-                     #endif
                      ],
                    MOZ_NATIVE_JPEG=1,
                    AC_MSG_ERROR([Insufficient JPEG library version for --with-system-jpeg]))
--- comm-release.orig/mozilla/configure	2013-01-06 15:26:49 +0900
+++ comm-release/mozilla/configure	2013-01-11 16:39:41 +0900
@@ -15471,9 +15471,6 @@
  #if JPEG_LIB_VERSION < $MOZJPEG
                      #error "Insufficient JPEG library version ($MOZJPEG required)."
                      #endif
-                     #ifndef JCS_EXTENSIONS
-                     #error "libjpeg-turbo JCS_EXTENSIONS required"
-                     #endif
                      
 ; return 0; }
 EOF
--- comm-release.orig/mozilla/image/decoders/nsJPEGDecoder.cpp	2013-01-06 15:26:16 +0900
+++ comm-release/mozilla/image/decoders/nsJPEGDecoder.cpp	2013-01-11 16:38:38 +0900
@@ -23,11 +23,13 @@
 #include "iccjpeg.h"
 }
 
+#if defined(JCS_EXTENSIONS)
 #if defined(IS_BIG_ENDIAN)
 #define MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB JCS_EXT_XRGB
 #else
 #define MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB JCS_EXT_BGRX
 #endif
+#endif
 
 static void cmyk_convert_rgb(JSAMPROW row, JDIMENSION width);
 
@@ -324,14 +326,18 @@
       case JCS_GRAYSCALE:
       case JCS_RGB:
       case JCS_YCbCr:
+#if defined(JCS_EXT_COLORSPACE)
         // if we're not color managing we can decode directly to
         // MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB
         if (mCMSMode != eCMSMode_All) {
             mInfo.out_color_space = MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB;
             mInfo.out_color_components = 4;
         } else {
+#endif
             mInfo.out_color_space = JCS_RGB;
+#if defined(JCS_EXT_COLORSPACE)
         }
+#endif
         break;
       case JCS_CMYK:
       case JCS_YCCK:
@@ -544,6 +550,7 @@
       uint32_t *imageRow = ((uint32_t*)mImageData) +
                            (mInfo.output_scanline * mInfo.output_width);
 
+#if defined(JCS_EXT_COLORSPACE)
       if (mInfo.out_color_space == MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB) {
         /* Special case: scanline will be directly converted into packed ARGB */
         if (jpeg_read_scanlines(&mInfo, (JSAMPARRAY)&imageRow, 1) != 1) {
@@ -552,6 +559,7 @@
         }
         continue; /* all done for this row! */
       }
+#endif
 
       JSAMPROW sampleRow = (JSAMPROW)imageRow;
       if (mInfo.output_components == 3) {
