Backout bug 563462, bug 675519, bug 674647, bug 341223 and bug 672980 to fix perma-orange.
authorMounir Lamouri <mounir.lamouri@gmail.com>
Tue, 09 Aug 2011 14:50:55 +0200
changeset 74118 d6e1fb56fc1a1549272e024fd1ee11ef5e5c2fd9
parent 74114 0adaae140642d5ea379185da71e9b2fd0a519176
child 74119 8d7c38e31bdc68f3ab8fa171512fc7962ffbf432
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
bugs563462, 675519, 674647, 341223, 672980
milestone8.0a1
Backout bug 563462, bug 675519, bug 674647, bug 341223 and bug 672980 to fix perma-orange.
browser/app/Makefile.in
build/autoconf/lto.m4
build/autoconf/mozconfig-find
build/autoconf/mozheader.m4
build/autoconf/moznbytetype.m4
build/autoconf/mozprog.m4
build/autoconf/nss.m4
build/macosx/mozconfig.leopard
config/autoconf.mk.in
config/system-headers
configure.in
js/src/config/system-headers
js/src/configure.in
xulrunner/app/Makefile.in
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -151,16 +151,20 @@ RCFLAGS += -DMOZ_PHOENIX
 ifdef DEBUG
 RCFLAGS += -DDEBUG
 endif
 RCFLAGS += -DFIREFOX_ICO=\"$(DIST)/branding/firefox-os2.ico\" -DDOCUMENT_ICO=\"$(DIST)/branding/document-os2.ico\"
 endif
 
 include $(topsrcdir)/config/rules.mk
 
+ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
+LIBS += -lphexlib
+endif
+
 ifeq ($(OS_ARCH),WINNT)
 #
 # Control the default heap size.
 # This is the heap returned by GetProcessHeap().
 # As we use the CRT heap, the default size is too large and wastes VM.
 #
 # The default heap size is 1MB on Win32.
 # The heap will grow if need be.
--- a/build/autoconf/lto.m4
+++ b/build/autoconf/lto.m4
@@ -1,11 +1,11 @@
 dnl check if the build is using lto. This is really primitive and only detects llvm based
 dnl compilers right now.
-AC_DEFUN([MOZ_DOING_LTO],
+AC_DEFUN(MOZ_DOING_LTO,
 [
   cat > conftest.c <<EOF
                   int foo = 1;
 EOF
   $1=no
   if ${CC-cc} ${CFLAGS} -S conftest.c -o conftest.s >/dev/null 2>&1; then
     if grep '^target triple =' conftest.s; then
       $1=yes
--- a/build/autoconf/mozconfig-find
+++ b/build/autoconf/mozconfig-find
@@ -41,39 +41,27 @@
 #    command-line. The .mozconfig file is searched for in the 
 #    order:
 #       if $MOZCONFIG is set, use that.
 #       Otherwise, use $TOPSRCDIR/.mozconfig
 #       Otherwise, use $HOME/.mozconfig
 #
 topsrcdir=$1
 
-absolute_path() {
-  if uname -s | grep -q MINGW; then
-    regex='^\([A-Za-z]:\|\\\\\|\/\)'
-  else
-    regex='^\/'
-  fi
-
-  if echo $1 | grep -q $regex; then
-    echo $1
-  else
-    echo $topsrcdir/$1
-  fi
-}
-
-if [ -n "$MOZCONFIG" ]; then
-  MOZCONFIG=`absolute_path "$MOZCONFIG"`
-  if ! [ -f "$MOZCONFIG" ]; then
-    echo "Specified MOZCONFIG \"$MOZCONFIG\" does not exist!"
+for _config in "$MOZCONFIG" \
+               "$MOZ_MYCONFIG"
+do
+  if [ -n "$_config" ] && ! [ -f "$_config" ]; then
+    echo "Specified MOZCONFIG \"$_config\" does not exist!"
     exit 1
   fi
-fi
+done
 
 for _config in "$MOZCONFIG" \
+               "$MOZ_MYCONFIG" \
                "$topsrcdir/.mozconfig" \
                "$topsrcdir/mozconfig" \
                "$topsrcdir/mozconfig.sh" \
                "$topsrcdir/myconfig.sh" \
                "$HOME/.mozconfig" \
                "$HOME/.mozconfig.sh" \
                "$HOME/.mozmyconfig.sh"
 do
--- a/build/autoconf/mozheader.m4
+++ b/build/autoconf/mozheader.m4
@@ -32,17 +32,17 @@ dnl use your version of this file under 
 dnl decision by deleting the provisions above and replace them with the notice
 dnl and other provisions required by the GPL or the LGPL. If you do not delete
 dnl the provisions above, a recipient may use your version of this file under
 dnl the terms of any one of the MPL, the GPL or the LGPL.
 dnl
 dnl ***** END LICENSE BLOCK *****
 
 dnl MOZ_CHECK_HEADER(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-AC_DEFUN([MOZ_CHECK_HEADER],
+AC_DEFUN(MOZ_CHECK_HEADER,
 [ dnl Do the transliteration at runtime so arg 1 can be a shell variable.
   ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
   AC_MSG_CHECKING([for $1])
   AC_CACHE_VAL(ac_cv_header_$ac_safe,
  [ AC_TRY_COMPILE([#include <$1>], ,
                   eval "ac_cv_header_$ac_safe=yes",
                   eval "ac_cv_header_$ac_safe=no") ])
   if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
@@ -50,16 +50,16 @@ AC_DEFUN([MOZ_CHECK_HEADER],
     ifelse([$2], , :, [$2])
   else
     AC_MSG_RESULT(no)
     ifelse([$3], , , [$3])
   fi
 ])
 
 dnl MOZ_CHECK_HEADERS(HEADER-FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-AC_DEFUN([MOZ_CHECK_HEADERS],
+AC_DEFUN(MOZ_CHECK_HEADERS,
 [ for ac_hdr in $1
   do
     MOZ_CHECK_HEADER($ac_hdr,
                      [ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
                        AC_DEFINE_UNQUOTED($ac_tr_hdr) $2], $3)
   done
 ])
--- a/build/autoconf/moznbytetype.m4
+++ b/build/autoconf/moznbytetype.m4
@@ -44,17 +44,17 @@ dnl whose written form contains spaces s
 dnl enclosed by shell quotes.
 dnl
 dnl The cache variable moz_cv_n_byte_type_VARIABLE gets set to the
 dnl type, if found.
 dnl 
 dnl for example:
 dnl MOZ_N_BYTE_TYPE([JS_INT32_T], [4], [int long 'long long' short])
 dnl
-AC_DEFUN([MOZ_N_BYTE_TYPE],
+AC_DEFUN(MOZ_N_BYTE_TYPE,
 [
 dnl The simplest approach would simply be to run a program that says
 dnl   printf ("%d\n", sizeof ($type));
 dnl But that won't work when cross-compiling; this will.
 AC_CACHE_CHECK([for a $2-byte type], moz_cv_n_byte_type_$1, [
   moz_cv_n_byte_type_$1=
   for type in $3; do
     AC_TRY_COMPILE([],
@@ -78,17 +78,17 @@ dnl Check to see which of POSSIBLE-SIZES
 dnl define VARIABLE SIZE. If no size matches, exit the configure script with
 dnl an error message.
 dnl
 dnl The cache variable moz_cv_size_of_VARIABLE gets set to the size, if
 dnl found.
 dnl
 dnl for example:
 dnl MOZ_SIZE_OF_TYPE([JS_BYTES_PER_WORD], [void*], [4 8])
-AC_DEFUN([MOZ_SIZE_OF_TYPE],
+AC_DEFUN(MOZ_SIZE_OF_TYPE,
 [
 AC_CACHE_CHECK([for the size of $2], moz_cv_size_of_$1, [
   moz_cv_size_of_$1=
   for size in $3; do
     AC_TRY_COMPILE([],
                    [
                      int a[sizeof ($2) == $size ? 1 : -1];
                      return 0;
@@ -108,17 +108,17 @@ dnl Check to see which of POSSIBLE-ALIGN
 dnl If we find one, define VARIABLE ALIGNMENT. If no alignment matches, exit
 dnl the configure script with an error message.
 dnl
 dnl The cache variable moz_cv_align_of_VARIABLE gets set to the size, if
 dnl found.
 dnl
 dnl for example:
 dnl MOZ_ALIGN_OF_TYPE(JS_ALIGN_OF_POINTER, void*, 2 4 8 16)
-AC_DEFUN([MOZ_ALIGN_OF_TYPE],
+AC_DEFUN(MOZ_ALIGN_OF_TYPE,
 [
 AC_CACHE_CHECK([for the alignment of $2], moz_cv_align_of_$1, [
   moz_cv_align_of_$1=
   for align in $3; do
     AC_TRY_COMPILE([
                      #include <stddef.h>
                      struct aligner { char c; $2 a; };
                    ],
--- a/build/autoconf/mozprog.m4
+++ b/build/autoconf/mozprog.m4
@@ -31,40 +31,40 @@ dnl under the terms of either the GPL or
 dnl use your version of this file under the terms of the MPL, indicate your
 dnl decision by deleting the provisions above and replace them with the notice
 dnl and other provisions required by the GPL or the LGPL. If you do not delete
 dnl the provisions above, a recipient may use your version of this file under
 dnl the terms of any one of the MPL, the GPL or the LGPL.
 dnl
 dnl ***** END LICENSE BLOCK *****
 
-AC_DEFUN([MOZ_PROG_CHECKMSYS],
+AC_DEFUN(MOZ_PROG_CHECKMSYS,
 [AC_REQUIRE([AC_INIT_BINSH])dnl
 if test `uname -s | grep -c MINGW 2>/dev/null` != "0"; then
   msyshost=1
 fi
 ])
 
-AC_DEFUN([MOZ_PATH_PROG],
+AC_DEFUN(MOZ_PATH_PROG,
 [ AC_PATH_PROG($1,$2,$3,$4)
   if test "$msyshost"; then
     case "[$]$1" in
     /*)
       tmp_DIRNAME=`dirname "[$]$1"`
       tmp_BASENAME=`basename "[$]$1"`
       tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
       $1="$tmp_PWD/$tmp_BASENAME"
       if test -e "[$]$1.exe"; then
         $1="[$]$1.exe"
       fi
     esac
   fi
 ])
 
-AC_DEFUN([MOZ_PATH_PROGS],
+AC_DEFUN(MOZ_PATH_PROGS,
 [  AC_PATH_PROGS($1,$2,$3,$4)
   if test "$msyshost"; then
     case "[$]$1" in
     /*)
       tmp_DIRNAME=`dirname "[$]$1"`
       tmp_BASENAME=`basename "[$]$1"`
       tmp_PWD=`cd "$tmp_DIRNAME" && pwd -W`
       $1="$tmp_PWD/$tmp_BASENAME"
--- a/build/autoconf/nss.m4
+++ b/build/autoconf/nss.m4
@@ -1,16 +1,16 @@
 # -*- tab-width: 4; -*-
 # Configure paths for NSS
 # Public domain - Chris Seawood <cls@seawood.org> 2001-04-05
 # Based upon gtk.m4 (also PD) by Owen Taylor
 
 dnl AM_PATH_NSS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
 dnl Test for NSS, and define NSS_CFLAGS and NSS_LIBS
-AC_DEFUN([AM_PATH_NSS],
+AC_DEFUN(AM_PATH_NSS,
 [dnl
 
 AC_ARG_WITH(nss-prefix,
 	[  --with-nss-prefix=PFX   Prefix where NSS is installed],
 	nss_config_prefix="$withval",
 	nss_config_prefix="")
 
 AC_ARG_WITH(nss-exec-prefix,
deleted file mode 100644
--- a/build/macosx/mozconfig.leopard
+++ /dev/null
@@ -1,13 +0,0 @@
-if test -z "$CC" ; then
-   CC=gcc-4.2
-fi
-
-if test -z "$CXX" ; then
-   CXX=g++-4.2
-fi
-
-# We do 32 bit builds for leopard
-CC="$CC -arch i386"
-CXX="$CXX -arch i386"
-
-ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.5.sdk
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -526,16 +526,17 @@ MOZ_TOOLKIT_REGISTRY_CFLAGS = \
 	$(TK_CFLAGS)
 
 CAIRO_FT_CFLAGS		= @CAIRO_FT_CFLAGS@
 
 MOZ_TREE_FREETYPE		= @MOZ_TREE_FREETYPE@
 MOZ_ENABLE_CAIRO_FT	= @MOZ_ENABLE_CAIRO_FT@
 MOZ_ENABLE_GTK2		= @MOZ_ENABLE_GTK2@
 MOZ_ENABLE_QT		= @MOZ_ENABLE_QT@
+MOZ_ENABLE_PHOTON	= @MOZ_ENABLE_PHOTON@
 MOZ_ENABLE_XREMOTE	= @MOZ_ENABLE_XREMOTE@
 MOZ_ENABLE_DWRITE_FONT	= @MOZ_ENABLE_DWRITE_FONT@
 MOZ_ENABLE_D2D_SURFACE	= @MOZ_ENABLE_D2D_SURFACE@
 MOZ_ENABLE_D3D9_LAYER	= @MOZ_ENABLE_D3D9_LAYER@
 MOZ_ENABLE_D3D10_LAYER  = @MOZ_ENABLE_D3D10_LAYER@
 
 MOZ_GTK2_CFLAGS		= @MOZ_GTK2_CFLAGS@
 MOZ_GTK2_LIBS		= @MOZ_GTK2_LIBS@
--- a/config/system-headers
+++ b/config/system-headers
@@ -560,16 +560,24 @@ pango/pangoxft.h
 pango/pango-utils.h
 pascal.h
 Patches.h
 Path.h
 pcfs/pc_dir.h
 Pgenerr.h
 PGenErr.h
 Ph.h
+photon/Pg.h
+photon/PhProto.h
+photon/PhRender.h
+photon/PpProto.h
+photon/PtProgress.h
+photon/PtServer.h
+photon/PtWebClient.h
+photon/PxImage.h
 pk11func.h
 pk11pub.h
 pkcs11t.h
 PLStringFuncs.h
 PMApplication.h
 pmddim.h
 poll.h
 Polygon.h
--- a/configure.in
+++ b/configure.in
@@ -1355,16 +1355,18 @@ ncr)
 UNIX_SYSTEM_V)
     HOST_OS_ARCH=NEC
     ;;
 OSF1)
     ;;
 OS_2)
     HOST_OS_ARCH=OS2
     ;;
+QNX)
+    ;;
 SCO_SV)
     HOST_OS_ARCH=SCOOS
     ;;
 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
     HOST_OS_ARCH=SINIX
     ;;
 UnixWare)
     HOST_OS_ARCH=UNIXWARE
@@ -1443,16 +1445,24 @@ OSF1)
         ;;
     esac
     ;;
 OS_2)
     OS_ARCH=OS2
     OS_TARGET=OS2
     OS_RELEASE=`uname -v`
     ;;
+QNX)
+    if test "$OS_TARGET" != "NTO"; then
+        changequote(,)
+        OS_RELEASE=`uname -v | sed 's/^\([0-9]\)\([0-9]*\)$/\1.\2/'`
+        changequote([,])
+    fi
+    OS_TEST=x86
+    ;;
 SCO_SV)
     OS_ARCH=SCOOS
     OS_RELEASE=5.0
     ;;
 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
     OS_ARCH=SINIX
     OS_TEST=`uname -p`
     ;;
@@ -2484,16 +2494,47 @@ ia64*-hpux*)
     MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
     if test "$LIBRUNPATH"; then
 	DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
     fi
     MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
     MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
     ;;
 
+*-nto*) 
+	AC_DEFINE(NTO)	
+	AC_DEFINE(_QNX_SOURCE)
+	AC_DEFINE(_i386)
+	OS_TARGET=NTO
+	WARNINGS_AS_ERRORS=''
+	MOZ_OPTIMIZE_FLAGS="-O"
+	MOZ_DEBUG_FLAGS="-gstabs"
+	USE_PTHREADS=1
+	_PEDANTIC=
+	LIBS="$LIBS -lsocket -lstdc++"
+	_DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
+	_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h -D_POSIX_C_SOURCE=199506'
+	if test "$with_x" != "yes"
+	then
+		_PLATFORM_DEFAULT_TOOLKIT="photon"
+	    TK_CFLAGS='-I/usr/include/photon'
+		TK_LIBS='-lph'
+	fi
+	case "${target_cpu}" in
+	ppc*)
+	AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)	
+	;;
+	esac
+	case "${host_cpu}" in
+	i*86)
+	USE_ELF_DYNSTR_GC=1
+	;;
+	esac
+	;;
+
 *-openbsd*)
     if test "$SO_VERSION"; then
         DLL_SUFFIX=".so.$SO_VERSION"
     else
         DLL_SUFFIX=".so.1.0"
     fi
     MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib -Wl,-rpath-link,$(if $(X11BASE),$(X11BASE),/usr/X11R6)/lib'
     DSO_CFLAGS=''
@@ -2590,16 +2631,30 @@ alpha*-*-osf*)
 	AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
     fi
     if test -z "$GNU_CXX"; then
       COMPAQ_CXX=1
     fi
     AC_DEFINE(NEED_USLEEP_PROTOTYPE)
     ;;
 
+*-qnx*) 
+    DIRENT_INO=d_stat.st_ino
+    dnl Solves the problems the QNX compiler has with nsCOMPtr.h.
+    AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
+    AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
+    dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
+    AC_DEFINE(STDC_HEADERS)
+    if test "$no_x" = "yes"; then
+	    _PLATFORM_DEFAULT_TOOLKIT='photon'
+	    TK_CFLAGS='-I/usr/nto/include/photon'
+	    TK_LIBS='-lphoton -lphrender'
+    fi
+    ;;
+
 *-sco*) 
     AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
     AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
     CXXFLAGS="$CXXFLAGS -I/usr/include/CC"
     if test ! "$GNU_CC"; then
        DSO_LDOPTS='-G'
     fi
     ;;
@@ -4903,25 +4958,27 @@ MOZ_ARG_HEADER(Toolkit Options)
     dnl ========================================================
     dnl = Select the default toolkit
     dnl ========================================================
 	MOZ_ARG_ENABLE_STRING(default-toolkit,
 	[  --enable-default-toolkit=TK
                           Select default toolkit
                           Platform specific defaults:
                             Mac OS X - cairo-cocoa
+                            Neutrino/QNX - photon
                             OS/2 - cairo-os2
                             Win32 - cairo-windows
                             Gtk2 with DirectFB - cairo-gtk2-dfb
                             * - cairo-gtk2
                             * - cairo-qt],
     [ _DEFAULT_TOOLKIT=$enableval ],
     [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
 
-    if test "$_DEFAULT_TOOLKIT" = "cairo-windows" \
+    if test "$_DEFAULT_TOOLKIT" = "photon" \
+        -o "$_DEFAULT_TOOLKIT" = "cairo-windows" \
         -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
         -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-dfb" \
         -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
         -o "$_DEFAULT_TOOLKIT" = "cairo-qt" \
         -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
         -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa" \
         -o "$_DEFAULT_TOOLKIT" = "cairo-android"
     then
@@ -4932,16 +4989,20 @@ MOZ_ARG_HEADER(Toolkit Options)
         AC_MSG_ERROR([You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).])
     fi
 
 dnl ========================================================
 dnl = Enable the toolkit as needed                         =
 dnl ========================================================
 
 case "$MOZ_WIDGET_TOOLKIT" in
+photon)
+	MOZ_ENABLE_PHOTON=1
+	AC_DEFINE(MOZ_WIDGET_PHOTON)
+    ;;
 
 cairo-windows)
     MOZ_WIDGET_TOOLKIT=windows
     MOZ_WEBGL=1
     MOZ_PDF_PRINTING=1
     MOZ_INSTRUMENT_EVENT_LOOP=1
     ;;
 
@@ -5186,16 +5247,17 @@ incorrect])
     fi
 fi
 
 AC_SUBST(GTK_CONFIG)
 AC_SUBST(TK_CFLAGS)
 AC_SUBST(TK_LIBS)
 
 AC_SUBST(MOZ_ENABLE_GTK2)
+AC_SUBST(MOZ_ENABLE_PHOTON)
 AC_SUBST(MOZ_ENABLE_QT)
 AC_SUBST(MOZ_ENABLE_QTNETWORK)
 AC_SUBST(MOZ_ENABLE_QMSYSTEM2)
 AC_SUBST(MOZ_ENABLE_QTMOBILITY)
 AC_SUBST(MOZ_ENABLE_XREMOTE)
 AC_SUBST(MOZ_GTK2_CFLAGS)
 AC_SUBST(MOZ_GTK2_LIBS)
 AC_SUBST(MOZ_QT_CFLAGS)
@@ -7434,27 +7496,26 @@ else
         WIN32_CUSTOM_CRT_DIR="$_objdir_win/memory/jemalloc/crtsrc/build/$MOZ_CRT_CPU_ARCH"
         MOZ_MEMORY_LDFLAGS="-MANIFEST:NO -LIBPATH:\"$WIN32_CUSTOM_CRT_DIR\" -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt19 -DEFAULTLIB:mozcpp19"
       fi
     fi
     if test -z "$WIN32_OLD_STYLE_JEMALLOC"; then
       AC_MSG_RESULT([no])
       WIN32_NEW_STYLE_JEMALLOC=1
       AC_DEFINE(WIN32_NEW_STYLE_JEMALLOC)
-      WIN32_CRT_SRC_DIR=
       if test -z "$MOZ_DEBUG"; then
         WIN32_CRT_LIBS="msvcrt.lib msvcprt.lib"
       else
         WIN32_CRT_LIBS="msvcrtd.lib msvcprtd.lib"
       fi
       dnl Look for a broken crtdll.obj
       WIN32_CRTDLL_FULLPATH=`lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\.obj`
       lib -NOLOGO -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH
       if grep -q '__imp__\{0,1\}free' crtdll.obj; then
-        MOZ_MEMORY_LDFLAGS='-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
+        MOZ_MEMORY_LDFLAGS='-MANIFEST:NO -LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
       else
         MOZ_MEMORY_LDFLAGS='$(DIST)/../memory/jemalloc/jemalloc.lib'
       fi
       rm crtdll.obj
     fi
 
     dnl Also pass this to NSPR/NSS
     DLLFLAGS="$DLLFLAGS $MOZ_MEMORY_LDFLAGS"
--- a/js/src/config/system-headers
+++ b/js/src/config/system-headers
@@ -560,16 +560,24 @@ pango/pangoxft.h
 pango/pango-utils.h
 pascal.h
 Patches.h
 Path.h
 pcfs/pc_dir.h
 Pgenerr.h
 PGenErr.h
 Ph.h
+photon/Pg.h
+photon/PhProto.h
+photon/PhRender.h
+photon/PpProto.h
+photon/PtProgress.h
+photon/PtServer.h
+photon/PtWebClient.h
+photon/PxImage.h
 pk11func.h
 pk11pub.h
 pkcs11t.h
 PLStringFuncs.h
 PMApplication.h
 pmddim.h
 poll.h
 Polygon.h
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -1334,16 +1334,18 @@ ncr)
 UNIX_SYSTEM_V)
     HOST_OS_ARCH=NEC
     ;;
 OSF1)
     ;;
 OS_2)
     HOST_OS_ARCH=OS2
     ;;
+QNX)
+    ;;
 SCO_SV)
     HOST_OS_ARCH=SCOOS
     ;;
 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
     HOST_OS_ARCH=SINIX
     ;;
 UnixWare)
     HOST_OS_ARCH=UNIXWARE
@@ -1427,16 +1429,24 @@ OSF1)
         ;;
     esac
     ;;
 OS_2)
     OS_ARCH=OS2
     OS_TARGET=OS2
     OS_RELEASE=`uname -v`
     ;;
+QNX)
+    if test "$OS_TARGET" != "NTO"; then
+        changequote(,)
+        OS_RELEASE=`uname -v | sed 's/^\([0-9]\)\([0-9]*\)$/\1.\2/'`
+        changequote([,])
+    fi
+    OS_TEST=x86
+    ;;
 SCO_SV)
     OS_ARCH=SCOOS
     OS_RELEASE=5.0
     ;;
 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
     OS_ARCH=SINIX
     OS_TEST=`uname -p`
     ;;
@@ -2406,16 +2416,42 @@ ia64*-hpux*)
     MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
     if test "$LIBRUNPATH"; then
 	DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
     fi
     MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
     MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
     ;;
 
+*-nto*) 
+	AC_DEFINE(NTO)	
+	AC_DEFINE(_QNX_SOURCE)
+	AC_DEFINE(_i386)
+	OS_TARGET=NTO
+	WARNINGS_AS_ERRORS=''
+	MOZ_OPTIMIZE_FLAGS="-O"
+	MOZ_DEBUG_FLAGS="-gstabs"
+	USE_PTHREADS=1
+	_PEDANTIC=
+	LIBS="$LIBS -lsocket -lstdc++"
+	_DEFINES_CFLAGS='-include $(DEPTH)/js-confdefs.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
+	_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/js-confdefs.h -D_POSIX_C_SOURCE=199506'
+	if test "$with_x" != "yes"
+	then
+		_PLATFORM_DEFAULT_TOOLKIT="photon"
+	    TK_CFLAGS='-I/usr/include/photon'
+		TK_LIBS='-lph'
+	fi
+	case "${target_cpu}" in
+	ppc*)
+	AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)	
+	;;
+	esac
+	;;
+
 *-openbsd*)
     DLL_SUFFIX=".so.1.0"
     DSO_CFLAGS=''
     DSO_PIC_CFLAGS='-fPIC'
     DSO_LDOPTS='-shared -fPIC'
     if test "$LIBRUNPATH"; then
 	DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
     fi
@@ -2506,16 +2542,30 @@ alpha*-*-osf*)
 	AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
     fi
     if test -z "$GNU_CXX"; then
       COMPAQ_CXX=1
     fi
     AC_DEFINE(NEED_USLEEP_PROTOTYPE)
     ;;
 
+*-qnx*) 
+    DIRENT_INO=d_stat.st_ino
+    dnl Solves the problems the QNX compiler has with nsCOMPtr.h.
+    AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
+    AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
+    dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
+    AC_DEFINE(STDC_HEADERS)
+    if test "$no_x" = "yes"; then
+	    _PLATFORM_DEFAULT_TOOLKIT='photon'
+	    TK_CFLAGS='-I/usr/nto/include/photon'
+	    TK_LIBS='-lphoton -lphrender'
+    fi
+    ;;
+
 *-sco*) 
     AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
     AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
     CXXFLAGS="$CXXFLAGS -I/usr/include/CC"
     if test ! "$GNU_CC"; then
        DSO_LDOPTS='-G'
     fi
     ;;
--- a/xulrunner/app/Makefile.in
+++ b/xulrunner/app/Makefile.in
@@ -131,16 +131,20 @@ RCFLAGS += -DXULRUNNER_ICO=\"$(DIST)/bra
 endif
 
 LIBS += $(JEMALLOC_LIBS)
 
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += -DXULRUNNER_ICO=\"$(DIST)/branding/xulrunner.ico\" -DDOCUMENT_ICO=\"$(DIST)/branding/document.ico\"
 
+ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
+LIBS += -lphexlib
+endif
+
 ifeq ($(OS_ARCH),WINNT)
 #
 # Control the default heap size.
 # This is the heap returned by GetProcessHeap().
 # As we use the CRT heap, the default size is too large and wastes VM.
 #
 # The default heap size is 1MB on Win32.
 # The heap will grow if need be.