# HG changeset patch
# User t_mrc-ct@sourceforge.jp
# Date 1331364423 -32400
# Branch GECKO10011_2012111513_RELBRANCH
# Node ID f277f4d17dad902aed5f22aada9806dca1d20513
# Parent  9ae24c75ca0a63cc9810d7ab7677a817e30fbe41
minimal change to build

diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
@@ -4303,6 +4303,17 @@
 _SAVE_CFLAGS=$CFLAGS
 _SAVE_LDFLAGS=$LDFLAGS
 _SAVE_LIBS=$LIBS
+
+dnl === TenFourFox issue 51
+if test -z "$SYSTEM_JPEG" -a "${JPEG_DIR}" = "yes"; then
+        echo "Using OS X native libjpeg"
+        JPEG_DIR="/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ImageIO.framework/Resources"
+        CFLAGS="-I${topsrcdir}/jpeg-imageio $CFLAGS"
+        LDFLAGS="-L${JPEG_DIR} $LDFLAGS"
+        AC_CHECK_LIB(JPEG, _cg_jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-L/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ImageIO.framework/Resources -lJPEG" JPEG_CFLAGS="-I${topsrcdir}/jpeg-imageio"], SYSTEM_JPEG=, $JPEG_LIBS, $JPEG_CFLAGS)
+        JPEG_DIR=
+else
+
 if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
     CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
     LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
@@ -4313,6 +4324,8 @@
     AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"], SYSTEM_JPEG=, $JPEG_LIBS)
 fi
 
+fi
+
 if test "$SYSTEM_JPEG" = 1; then
     LIBS="$JPEG_LIBS $LIBS"
     AC_TRY_COMPILE([ #include <stdio.h>
diff --git a/mailnews/compose/src/nsMsgAppleDouble.h b/mailnews/compose/src/nsMsgAppleDouble.h
--- a/mailnews/compose/src/nsMsgAppleDouble.h
+++ b/mailnews/compose/src/nsMsgAppleDouble.h
@@ -83,6 +83,15 @@
 	kDoneDataPortion 
 };
 
+/* FSIORefNum not named before 10.5 */
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
+#if __LP64__
+typedef int	FSIORefNum;
+#else
+typedef SInt16	FSIORefNum;
+#endif /* __LP64__ */
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED < 1050 */
+
 typedef struct _appledouble_encode_object 
 {
     char    fname[256];
diff --git a/mailnews/import/eudora/src/nsEudoraMac.cpp b/mailnews/import/eudora/src/nsEudoraMac.cpp
--- a/mailnews/import/eudora/src/nsEudoraMac.cpp
+++ b/mailnews/import/eudora/src/nsEudoraMac.cpp
@@ -537,6 +537,11 @@
   return( NS_ERROR_FAILURE);
 }
 
+// ResourceIndex not named before 10.5
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
+typedef SInt16	ResourceIndex;
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED < 1050 */
+
 // GetIndString isn't supported on 64-bit Mac OS X
 // This code is emulation for GetIndString.
 static StringPtr GetStringFromHandle(Handle aResource,
