# HG changeset patch
# User t_mrc-ct@sourceforge.jp
# Date 1351693020 -32400
# Branch GECKO1704esr_2013030721_RELBRANCH
# Node ID 44ae40ca977dc4fb1442e6bb5a39dcfac8f48ea2
# Parent  271d083a032be49c5abf11f720a254edf9c821a9
minimal change to build (with v17 fix)

diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
@@ -1305,7 +1305,7 @@
 dnl ========================================================
 if test "$GNU_CC"; then
     # FIXME: Let us build with strict aliasing. bug 414641.
-    CFLAGS="$CFLAGS -fno-strict-aliasing"
+    CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions"
     MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
     MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
     DSO_LDOPTS='-shared'
@@ -4145,6 +4145,16 @@
 _SAVE_CFLAGS=$CFLAGS
 _SAVE_LDFLAGS=$LDFLAGS
 _SAVE_LIBS=$LIBS
+
+dnl === TenFourFox issue 51
+if test -z "$MOZ_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}/mozilla/jpeg-imageio $CFLAGS"
+        LDFLAGS="-L${JPEG_DIR} $LDFLAGS"
+        AC_CHECK_LIB(JPEG, _cg_jpeg_destroy_compress, [MOZ_NATIVE_JPEG=1 MOZ_JPEG_LIBS="-L/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ImageIO.framework/Resources -lJPEG" JPEG_CFLAGS="-I${topsrcdir}/mozilla/jpeg-imageio"], MOZ_NATIVE_JPEG=)
+else
+
 if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
     CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
     LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
@@ -4155,6 +4165,8 @@
     AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [MOZ_NATIVE_JPEG=1 MOZ_JPEG_LIBS="-ljpeg"], MOZ_NATIVE_JPEG=)
 fi
 
+fi
+
 if test "$MOZ_NATIVE_JPEG" = 1; then
     AC_TRY_COMPILE([ #include <stdio.h>
                      #include <sys/types.h>
@@ -4169,10 +4181,19 @@
 LDFLAGS=$_SAVE_LDFLAGS
 LIBS=$_SAVE_LIBS
 
+dnl === TenFourFox issue 51
+if test "$MOZ_NATIVE_JPEG" = 1 -a "${JPEG_DIR}" = "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ImageIO.framework/Resources"; then
+ MOZ_JPEG_CFLAGS="-I${topsrcdir}/mozilla/jpeg-imageio"
+ MOZ_JPEG_LIBS="-L${JPEG_DIR} ${MOZ_JPEG_LIBS}"
+else
+
 if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$MOZ_NATIVE_JPEG" = 1; then
     MOZ_JPEG_CFLAGS="-I${JPEG_DIR}/include"
     MOZ_JPEG_LIBS="-L${JPEG_DIR}/lib ${MOZ_JPEG_LIBS}"
 fi
+
+fi
+
 fi # SKIP_LIBRARY_CHECKS
 
 dnl system ZLIB support
@@ -5456,7 +5477,8 @@
 dnl = Debugging is OFF by default
 dnl ========================================================
 if test -z "$MOZ_DEBUG_FLAGS"; then
-  MOZ_DEBUG_FLAGS="-g"
+dnl There is no circumstance under which we build with regular symbols now.
+  MOZ_DEBUG_FLAGS="-gdwarf-2"
 fi
 
 MOZ_ARG_ENABLE_STRING(debug,
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
@@ -51,6 +51,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
@@ -499,6 +499,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,
