Bug 648866 - Remove WinCE code from main build system + that of js/src/. r=ted
authorEd Morley <bmo@edmorley.co.uk>
Tue, 19 Apr 2011 14:11:40 +1000
changeset 68547 0b3b74b8f08761301587f61436540f5dcea69add
parent 68546 c5c1cac00a06b9030cafd3caa2f0ea0a9949e39c
child 68548 2b974a79020f0394a01a3acaa71a21c9666ee7ba
push id76
push userbzbarsky@mozilla.com
push dateTue, 05 Jul 2011 17:00:57 +0000
treeherdermozilla-beta@d3a2732c35f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs648866
milestone6.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 648866 - Remove WinCE code from main build system + that of js/src/. r=ted
Makefile.in
allmakefiles.sh
build/Makefile.in
build/binary-location.mk
build/package/wince/make_wince_cab.py
build/wince/shunt/Makefile.in
build/wince/shunt/environment.cpp
build/wince/shunt/include/direct.h
build/wince/shunt/include/environment.h
build/wince/shunt/include/errno.h
build/wince/shunt/include/fcntl.h
build/wince/shunt/include/io.h
build/wince/shunt/include/mbstring.h
build/wince/shunt/include/mozce_shunt.h
build/wince/shunt/include/process.h
build/wince/shunt/include/signal.h
build/wince/shunt/include/stdlib.h.in
build/wince/shunt/include/sys/Makefile.in
build/wince/shunt/include/sys/stat.h
build/wince/shunt/include/sys/types.h
build/wince/shunt/include/windows.h.in
build/wince/shunt/include/ymath.h.in
build/wince/shunt/memory.cpp
build/wince/shunt/mozce_shunt.def.in
build/wince/shunt/shunt.cpp
build/wince/shunt/time.cpp
build/wince/shunt/time_conversions.h
build/wince/tools/Makefile
build/wince/tools/Makefile.in
build/wince/tools/arm-wince-as.c
build/wince/tools/arm-wince-gcc.c
build/wince/tools/arm-wince-lib.c
build/wince/tools/arm-wince-link.c
build/wince/tools/arm-wince-res.c
build/wince/tools/linkargs.c
build/wince/tools/linkargs.h
build/wince/tools/toolspath.c
build/wince/tools/toolspath.h
config/autoconf.mk.in
config/config.mk
config/rules.mk
configure.in
js/src/config/autoconf.mk.in
js/src/config/config.mk
js/src/config/rules.mk
js/src/configure.in
--- a/Makefile.in
+++ b/Makefile.in
@@ -83,21 +83,16 @@ include $(topsrcdir)/config/config.mk
 
 GARBAGE_DIRS += dist _javagen _profile _tests staticlib
 DIST_GARBAGE = config.cache config.log config.status config-defs.h \
    config/autoconf.mk \
    unallmakefiles mozilla-config.h \
    netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
    $(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out
 
-ifdef WINCE
-check::
-	$(PYTHON) $(topsrcdir)/build/mobile/devicemanager-utils.py copy $(DIST)/bin
-endif
-
 default alldep all:: $(topsrcdir)/configure config.status
 	$(RM) -r $(DIST)/sdk
 	$(RM) -r $(DIST)/include
 	$(RM) -r $(DIST)/private
 	$(RM) -r $(DIST)/public
 	$(RM) -r $(DIST)/bin/components
 	$(RM) -r _tests
 
@@ -190,31 +185,16 @@ endif
 	$(NSINSTALL) -D $(DIST)/$(PKG_PATH)
 	cd $(DIST)/crashreporter-symbols && \
           zip -r9D "../$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip" .
 	cd $(DIST)/crashreporter-symbols && \
 	grep "sym" $(SYMBOL_INDEX_NAME) > $(SYMBOL_INDEX_NAME).tmp && \
 	  mv $(SYMBOL_INDEX_NAME).tmp $(SYMBOL_INDEX_NAME)
 	cd $(DIST)/crashreporter-symbols && \
           zip -r9D "../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" . -i "*.sym" -i "*.txt"
-else
-ifdef WINCE
-ifdef SYMBOLSTORE_PATH
-	echo building symbol store with symstore.exe
-	$(RM) -r $(DIST)/symbols
-	$(RM) "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
-	$(NSINSTALL) -D $(DIST)/symbols
-	$(SYMBOLSTORE_PATH) add -r -f "$(subst /,\,$(shell pwd -W))\*.PDB" \
-	  -s $(DIST)/symbols/ -t "$(MOZ_PKG_APPNAME)" -v "$(MOZ_PKG_VERSION)"
-	echo packing symbols
-	$(NSINSTALL) -D $(DIST)/$(PKG_PATH)
-	cd $(DIST)/symbols && \
-	  zip -r9D "../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" .
-endif # SYMBOLSTORE_PATH
-endif # WINCE
 endif # MOZ_CRASHREPORTER
 
 uploadsymbols:
 ifdef MOZ_CRASHREPORTER
 	$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh "$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip"
 endif
 
 # defined in package-name.mk
--- a/allmakefiles.sh
+++ b/allmakefiles.sh
@@ -70,27 +70,16 @@ config/mkdepend/Makefile
 config/nspr/Makefile
 config/doxygen.cfg
 config/expandlibs_config.py
 config/tests/src-simple/Makefile
 probes/Makefile
 extensions/Makefile
 "
 
-if [ "$WINCE" ]; then
-  add_makefiles "
-    build/wince/tools/Makefile
-    build/wince/shunt/Makefile
-    build/wince/shunt/include/windows.h
-    build/wince/shunt/include/ymath.h
-    build/wince/shunt/include/stdlib.h
-    build/wince/shunt/include/sys/Makefile
-  "
-fi
-
 if [ "$MOZ_MEMORY" -a "$LIBXUL_SDK" = "" ]; then
   add_makefiles "
     memory/jemalloc/Makefile
   "
 fi
 
 #
 # Application-specific makefiles
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -40,40 +40,24 @@ DEPTH		= ..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = build
 
-ifeq (,$(filter WINCE WINNT OS2,$(OS_ARCH)))
+ifeq (,$(filter WINNT OS2,$(OS_ARCH)))
 DIRS		= unix
 endif
 
 ifeq (WINNT,$(OS_ARCH))
 DIRS = win32
 endif
 
-ifdef WINCE
-# We need jemalloc built before the shunt
-ifdef MOZ_MEMORY
-DIRS += wince/tools \
-	$(DEPTH)/memory/jemalloc \
-	wince/shunt \
-	$(DEPTH)/memory/mozalloc \
-	$(NULL)
-else
-DIRS += wince/tools \
-	wince/shunt \
-	$(DEPTH)/memory/mozalloc \
-	$(NULL)
-endif
-endif
-
 DIRS += pgo
 
 ifeq (Android,$(OS_TARGET))
   DIRS += mobile/sutagent/android \
           mobile/sutagent/android/watcher \
           mobile/sutagent/android/ffxcp \
           mobile/sutagent/android/fencp \
           $(NULL)
--- a/build/binary-location.mk
+++ b/build/binary-location.mk
@@ -32,17 +32,17 @@
 # and other provisions required by the GPL or the LGPL. If you do not delete
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 # 
 # ***** END LICENSE BLOCK *****
 
 # finds the location of the browser and puts it in the variable $(browser_path)
 
-ifneq (,$(filter OS2 WINCE WINNT,$(OS_ARCH)))
+ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
 PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
 else
 PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
 endif
 
 TARGET_DIST = $(TARGET_DEPTH)/dist
 
 ifeq ($(MOZ_BUILD_APP),camino)
deleted file mode 100644
--- a/build/package/wince/make_wince_cab.py
+++ /dev/null
@@ -1,456 +0,0 @@
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is Mozilla build system.
-#
-# The Initial Developer of the Original Code is
-# Mozilla Foundation.
-# Portions created by the Initial Developer are Copyright (C) 2007
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#  John Wolfe <wolfe@lobo.us>
-#  Vladimir Vukicevic <vladimir@pobox.com>
-#  Alex Pakhotin <alexp@mozilla.com>
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-################################################################
-#
-# make_wince_cab.py --- Given a directory, walk it and make an
-#          installer based upon the contents of that directory
-#
-# Usage:
-#   python make_wince_cab.py [-setupdll] [-s] [-faststart] [CABWIZ_PATH] SOURCE_DIR PROGRAM_NAME CAB_FINAL_NAME
-#
-# Walk through the relative directory SOURCE_DIR, parsing filenames
-#   Checks for duplicate filenames and renames where needed
-#   Then builds a WinMobile INF file based upon results
-# 
-# Each directory in SOURCE_DIR may have a file named
-# 'install-exceptions', which lists files in SOURCE_DIR that
-# need not be placed into an installation CAB file. The
-# 'install-exceptions' file itself is always ignored.
-# 
-# Blank lines and '#' comments in the 'install-exceptions' file are
-# ignored.
-#
-# ARGS:
-#   -setupdll - Make a small additional CAB including Setup.dll.
-#               This is to add Fennec to the system list of installed applications
-#               available in Settings - System - Remove Programs.
-#
-#   -s - Don't pass /compress to cabwiz (generate CAB compatible with Windows CE)
-#
-#   -faststart - Add FastStart shortcut
-#
-#   CABWIZ_PATH - If specified, will use this cabwiz.exe executable.  Otherwise, will attempt
-#                 to find one using $VSINSTALLDIR.
-#
-#   SOURCE_DIR - sub-directory which contains the target program 
-#                NOTE: It is assumed that the application name is SOURCE_DIR.exe
-#                EXAMPLE: source_dir=fennec, there should be a fennec/fennec.exe application
-#
-#   PROGRAM_NAME - Name of the program to place inside the INF file
-#
-#   CAB_FINAL_NAME - actual final name for the produced CAB file
-#
-# EXAMPLE OF COMMAND LINE:
-#   python make_wince_cab.py /c/Program\ Files/Microsoft\ Visual\ Studio\ 9.0/SmartDevices/SDK/SDKTools/cabwiz.exe dist/fennec Fennec fennec-0.11.en-US.wince-arm.cab
-#
-# NOTE: In our example, "fennec" is the directory [source_name]
-#                       "fennec.exe" is the application [$(source_name).exe], and
-#                       "Fennec" is the shortcut name [program_name]
-################################################################
-
-import sys
-import os
-from os.path import join
-from subprocess import call, STDOUT
-import fnmatch
-import string
-import shutil
-
-CompressFlag = "/compress"
-FaststartFlag = 0
-MakeSetupDllCab = 0
-
-class FileEntry:
-    def __init__(self, dirpath, dircount, filename, filecount, actual_filename):
-        self.dirpath = dirpath
-        self.dircount = dircount
-        self.filename = filename
-        self.filecount = filecount
-        self.actual_filename = actual_filename
-
-
-class DirEntry:
-    def __init__(self, dirpath, dircount, filecount):
-        self.dirpath = dirpath
-        self.dircount = dircount
-        self.filecount = filecount
-
-# Ignore detritus left lying around by editing tools.
-ignored_patterns = ['*~', '.#*', '#*#', '*.orig', '*.rej']
-
-file_entry_count = 0
-file_entries = []
-
-fcount = 0
-fnames = {}
-
-directories = {}
-files_in_directory = []
-
-# Return the contents of FILENAME, a 'install-exceptions' file, as
-# a dictionary whose keys are exactly the list of filenames, along
-# with the basename of FILENAME itself.  If FILENAME does not exist,
-# return the empty dictionary.
-def read_exceptions(filename):
-    exceptions = set()
-    if os.path.exists(filename):
-        f = file(filename)
-        for line in f:
-            line = line.strip()
-            if line and line[0] != '#':
-                exceptions.add(line)
-        exceptions.add( os.path.basename(filename) )
-        f.close()
-    return exceptions
-
-
-# Sorts two items based first upon directory count (index of
-# directory in list of directories), then upon filename.  A way of
-# getting a list sorted into directories, and then alphabetically by
-# filename within each directory. 
-def sort_dircount_then_filename(item1, item2):
-    # First Compare dirpaths
-    if item1.dircount != item2.dircount:
-        return cmp(item1.dircount, item2.dircount)
-
-    # Next compare filenames
-    next_result = cmp(item1.filename, item2.filename)
-    if next_result != 0:
-        return next_result
-
-    # Lastly, compare filecounts
-    return cmp(item1.filecount, item2.filecount)
-
-    
-def handle_duplicate_filename(dirpath, filename, filecount):
-    if filecount == 1:
-        return filename
-    file_parts = os.path.splitext(filename)
-    new_filename = "%s_%d%s" % (file_parts[0], filecount, file_parts[1])
-    old_relative_filename = join(dirpath, filename)
-    new_relative_filename = join(dirpath, new_filename)
-    shutil.copyfile(old_relative_filename, new_relative_filename)
-    return new_filename
-
-def add_new_entry(dirpath, dircount, filename, filecount):
-    global file_entries
-    global file_entry_count
-    actual_filename = handle_duplicate_filename(dirpath, filename, filecount)
-    file_entries.append( FileEntry(dirpath, dircount, filename, filecount, actual_filename) )
-    file_entry_count += 1
-
-
-def walk_tree(start_dir, ignore):
-    global fcount
-    global fnames
-    global directories
-    global files_in_directory
-    
-    dircount = 0;
-    files_in_directory = [0]
-
-    for (dirpath, dirnames, filenames) in os.walk(start_dir):
-        exceptions = read_exceptions(join(dirpath, 'install-exceptions'))
-
-        dircount += 1
-        directories[dirpath] = DirEntry(dirpath, dircount, len(filenames))
-
-        if len(filenames) < 1:
-            print "WARNING: No files in directory [%s]" % dirpath
-
-        for filename in filenames:
-            if len(exceptions) > 0 and filename in exceptions:
-                continue
-            if any(fnmatch.fnmatch(filename, p) for p in ignore):
-                continue
-            filecount = 1
-            if filename in fnames:
-                filecount = fnames[filename] + 1
-            fnames[filename] = filecount
-
-            add_new_entry(dirpath, dircount, filename, filecount)
-
-
-def output_inf_file_header(f, program_name):
-    f.write("""; Duplicated Filenames ==> One of the two files
-;   needs renaming before packaging up the CAB
-;
-; Technique: Rename the second directory's file to XXXX_1 prior to starting the CABWIZ,
-;   then take care of the name in the File.xxxxx section
-
-[Version]
-Signature   = "$Windows NT$"        ; required as-is
-Provider    = "Mozilla"             ; maximum of 30 characters, full app name will be \"<Provider> <AppName>\"
-CESignature = "$Windows CE$"        ; required as-is
-
-[CEStrings]
-AppName     = "%s"              ; maximum of 40 characters, full app name will be \"<Provider> <AppName>\"\n""" % program_name)
-
-    f.write("InstallDir  = %CE1%\\%AppName%       ; Program Files\Fennec\n\n")
-
-
-def output_sourcedisksnames_section(f, dirs):
-    f.write("[SourceDisksNames]                  ; directory that holds the application's files\n")
-    for dir in dirs:
-        f.write("""%d = , "%s",,%s\n""" % (directories[dir].dircount, dir, dir))
-    f.write(" \n")
-
-
-def output_sourcedisksfiles_section(f):
-    f.write("[SourceDisksFiles]                  ; list of files to be included in .cab\n")
-    for entry in sorted(file_entries, sort_dircount_then_filename):
-        f.write("%s=%d\n" % (entry.actual_filename, entry.dircount))
-    f.write("\n")
-
-
-def output_defaultinstall_section(f, dirs):
-    copyfileslist = ""
-    copyfilesrawlist=[]
-    for dir in dirs:
-        if directories[dir].filecount < 1:
-            continue
-        copyfilesrawlist.append( "Files.%s" % '.'.join( dir.split('\\') ) )
-        prefix = ", "
-    copyfileslist = ','.join(copyfilesrawlist)
-
-    f.write("""[DefaultInstall]                    ; operations to be completed during install
-CopyFiles   = %s
-AddReg      = RegData
-CEShortcuts = Shortcuts
-\n""" % copyfileslist)
-
-
-def output_destinationdirs_section(f, dirs):
-    f.write("[DestinationDirs]                   ; default destination directories for each operation section\n")
-    for dir in dirs:
-        dir_split = dir.split('\\')
-        mod_dir_string = '.'.join(dir_split)
-        if len(dir_split) > 1:
-            dir_minus_top_level = '\\'.join(dir_split[1:])
-        else:
-            dir_minus_top_level = ""
-        if dir_minus_top_level:
-            dir_minus_top_level = "\\%s" % dir_minus_top_level
-        if directories[dir].filecount < 1:
-            f.write(";Files.%s = 0, %%InstallDir%%%s          ; NO FILES IN THIS DIRECTORY\n" % (mod_dir_string, dir_minus_top_level))
-        else:
-            f.write("Files.%s = 0, %%InstallDir%%%s\n" % (mod_dir_string, dir_minus_top_level))
-    f.write("Shortcuts   = 0, %CE11%             ; \Windows\Start Menu\Programs\n\n")
-
-
-def output_directory_sections(f, dirs):
-    for dir in dirs:
-        if directories[dir].filecount < 1:
-            f.write(";[Files.%s]\n;===NO FILES===\n" % '.'.join( dir.split('\\') ))
-        else:
-            f.write("[Files.%s]\n" % '.'.join( dir.split('\\') ))
-            for entry in file_entries:
-                if entry.dirpath == dir:
-                    f.write("\"%s\",%s\n" % (entry.filename, entry.actual_filename))
-        f.write("\n")
-
-
-def output_registry_section(f):
-    f.write("""[RegData]                           ; registry key list
-HKCU,Software\%AppName%,MajorVersion,0x00010001,1
-HKCU,Software\%AppName%,MinorVersion,0x00010001,0
-\n""")
-
-
-def output_shortcuts_section(f, app_name):
-    f.write("[Shortcuts]\n")
-    f.write("%%AppName%%,0,%s,%%CE11%%\n" % app_name)
-    if FaststartFlag:
-        f.write("%%AppName%%faststart,0,%sfaststart.exe,%%CE4%%\n" % os.path.splitext(app_name)[0]);
-
-
-def output_inf_file(program_name, app_name):
-    global files_in_directory
-    inf_name = "%s.inf" % program_name
-    f = open(inf_name, 'w')
-    output_inf_file_header(f, program_name)
-    dirs = sorted(directories)
-    output_sourcedisksnames_section(f, dirs)
-    output_sourcedisksfiles_section(f)
-    output_defaultinstall_section(f, dirs)
-    output_destinationdirs_section(f, dirs)
-    output_directory_sections(f, dirs)
-    output_registry_section(f)
-    output_shortcuts_section(f, app_name)
-    f.close()
-
-
-
-def output_setup_dll_inf_file(source_dir, program_name, app_name):
-    inf_name = "%s.inf" % program_name
-    f = open(inf_name, 'w')
-
-    f.write("""; Additional CAB to create Fennec entry in the installed programs list
-
-[Version]
-Signature   = "$Windows NT$"        ; required as-is
-Provider    = "Mozilla"             ; maximum of 30 characters, full app name will be \"<Provider> <AppName>\"
-CESignature = "$Windows CE$"        ; required as-is
-
-[CEStrings]
-AppName     = "%s"              ; maximum of 40 characters, full app name will be \"<Provider> <AppName>\"\n""" % program_name)
-
-    f.write("InstallDir  = %CE1%\\%AppName%       ; Program Files\Fennec\n\n")
-
-    f.write("[SourceDisksNames]                  ; directory that holds the application's files\n")
-    f.write('1 = , "%s",,%s\n\n' % (source_dir, source_dir))
-
-    f.write("[SourceDisksFiles]                  ; list of files to be included in .cab\n")
-    f.write("Setup.dll = 1\n\n")
-
-    f.write("""[DefaultInstall]                    ; operations to be completed during install
-CopyFiles   = Files.%s
-AddReg      = RegData
-CESetupDLL  = "Setup.dll"
-\n""" % program_name)
-
-    f.write("[DestinationDirs]                   ; default destination directories for each operation section\n")
-    f.write("Files.%s = 0, %%InstallDir%%\n\n" % program_name)
-
-    f.write("""[Files.%s]
-;No files to copy
-
-[RegData]
-;No registry entries
-""" % program_name)
-
-    f.close()
-
-
-def make_cab_file(cabwiz_path, program_name, cab_final_name):
-    make_cab_command = "\"%s\" %s %s.inf" % (cabwiz_path, CompressFlag, program_name)
-    print "INFORMATION: Executing command to make %s CAB file (only works on BASH)" % program_name
-    print "    [%s]" % make_cab_command
-    sys.stdout.flush()
-
-    success = call([cabwiz_path, "%s.inf" % program_name, CompressFlag],
-                   stdout=open("NUL:","w"), stderr=STDOUT)
-
-    if not os.path.isfile("%s.CAB" % program_name):
-        print """***************************************************************************
-ERROR: CAB FILE NOT CREATED.
-       You can try running the command by hand:
-       %s
- ---- 
- NOTE: If you see an error like this:
-       Error: File XXXXXXXXXX.inf contains DirIDs, which are not supported
- -- 
- this may mean that your PYTHON is outputting Windows files WITHOUT CR-LF
- line endings.  Please verify that your INF file has CR-LF line endings.
-***************************************************************************""" % make_cab_command
-        sys.exit(2)
-
-    print "INFORMATION: Executing command to move %s.CAB to %s" % (program_name, cab_final_name)
-    sys.stdout.flush()
-    shutil.move("%s.CAB" % program_name, cab_final_name)
-
-
-def purge_copied_files():
-    for entry in file_entries:
-        if entry.filename != entry.actual_filename:
-            new_relative_filename = join(entry.dirpath, entry.actual_filename)
-            os.remove(new_relative_filename)
-
-
-def main():
-    args = sys.argv
-    if len(args) < 4 or len(args) > 7:
-        print >> sys.stderr, "Usage: %s [-setupdll] [-s] [-faststart] [CABWIZ_PATH] SOURCE_DIR PROGRAM_NAME CAB_FINAL_NAME" % args[0]
-        print >> sys.stderr, "Example: %s /c/Program\ Files/Microsoft\ Visual\ Studio\ 9.0/ fennec Fennec fennec-0.11.en-US.wince-arm.cab" % args[0]
-        sys.exit(1)
-
-    args = args[1:]
-
-    if args[0] == "-setupdll":
-        global MakeSetupDllCab
-        MakeSetupDllCab = 1
-        args = args[1:]
-
-    if args[0] == "-s":
-        global CompressFlag
-        CompressFlag = ""
-        args = args[1:]
-
-    if args[0] == "-faststart":
-        global FaststartFlag
-        FaststartFlag = 1
-        args = args[1:]
-
-    cabwiz_path = None
-    if len(args) == 4:
-        cabwiz_path = args[0]
-        args = args[1:]
-    else:
-        if "VSINSTALLDIR" in os.environ:
-            cabwiz_path = os.path.join(os.environ["VSINSTALLDIR"], "SmartDevices", "SDK", "SDKTools", "cabwiz.exe")
-
-    source_dir = args[0]
-    program_name = args[1]
-    app_name = "%s.exe" % source_dir
-    cab_final_name = args[2]
-
-    if cabwiz_path is None or not os.path.isfile(cabwiz_path):
-        print """***************************************************************************
-ERROR: CABWIZ_PATH is not a valid file, or cabwiz couldn't be found!
-       EXITING...
-***************************************************************************"""
-        sys.exit(2)
-
-    if MakeSetupDllCab:
-        output_setup_dll_inf_file(source_dir, program_name, app_name)
-        sys.stdout.flush()
-        make_cab_file(cabwiz_path, program_name, cab_final_name)
-        os.remove("%s/setup.dll" % source_dir)
-    else:
-        walk_tree(source_dir, ignored_patterns)
-        sys.stdout.flush()
-        output_inf_file(program_name, app_name)
-        sys.stdout.flush()
-        make_cab_file(cabwiz_path, program_name, cab_final_name)
-        purge_copied_files()
-
-
-# run main if run directly
-if __name__ == "__main__":
-    main()
deleted file mode 100644
--- a/build/wince/shunt/Makefile.in
+++ /dev/null
@@ -1,103 +0,0 @@
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is Mozilla core build scripts.
-#
-# The Initial Developer of the Original Code is
-# Brad Lassey <blassey@mozilla.com>
-#
-# Portions created by the Initial Developer are Copyright (C) 2008
-# the Mozilla Foundation <http://www.mozilla.org/>. All Rights Reserved.
-#
-# Contributor(s): 
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH = ../../..
-topsrcdir = @top_srcdir@
-srcdir = @srcdir@
-VPATH = @srcdir@
-MODULE = shunt
-
-TOPSRCDIR = $(topsrcdir)
-OBJDIR = $(DEPTH)
-
-export NO_SHUNT = 1
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE = mozce_shunt
-LIBRARY_NAME = mozce_shunt
-FORCE_SHARED_LIB= 1
-DIST_INSTALL = 1
-
-EXPORTS_NAMESPACES = mozce_shunt
-EXPORTS_mozce_shunt = \
-  include/windows.h \
-  include/ymath.h \
-  include/stdlib.h \
-  include/direct.h \
-  include/errno.h \
-  include/fcntl.h \
-  include/io.h \
-  include/mbstring.h \
-  include/environment.h \
-  include/mozce_shunt.h \
-  include/process.h \
-  include/signal.h \
-  $(NULL)
-
-DIRS += include/sys
-
-ifdef MOZ_MEMORY
-CFLAGS += -DMOZ_MEMORY
-CXXFLAGS += -DMOZ_MEMORY
-EXPORTS_mozce_shunt += $(topsrcdir)/memory/jemalloc/jemalloc.h
-
-# We have to include the obj file directly, because we want to export
-# some of its symbols through our def file
-EXTRA_LIBS += $(OBJDIR)/memory/jemalloc/jemalloc.obj
-endif
-
-DEFFILE = mozce_shunt.def
-
-OS_LIBS = $(call EXPAND_LIBNAME, libcmt)
-
-CPPSRCS = \
-	shunt.cpp \
-	environment.cpp \
-	time.cpp \
-	memory.cpp \
-	$(NULL)
-
-DEFINES += -DMOZCE_SHUNT_EXPORTS -DIN_SHUNT
-
-include $(topsrcdir)/config/rules.mk
-
-mozce_shunt.def: mozce_shunt.def.in
-	$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $^ > $@
-
-.NOTPARALLEL:
-
deleted file mode 100644
--- a/build/wince/shunt/environment.cpp
+++ /dev/null
@@ -1,336 +0,0 @@
-/* -*- Mode: C;  c-basic-offset: 2; tab-width: 4; indent-tabs-mode: nil; -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is MOZCE Lib.
- *
- * The Initial Developer of the Original Code is Doug Turner <dougt@meer.net>.
- 
- * Portions created by the Initial Developer are Copyright (C) 2005
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  John Wolfe <wolfe@lobo.us>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/* environment.h and environment.cpp are also included by app update */
-
-// WINCE_SKIP_SHUNT_INCLUDE is used by app update to prevent including of
-// mozce_shunt.h when it includes environment.cpp
-#ifndef WINCE_SKIP_SHUNT_INCLUDE
-#include "include/mozce_shunt.h"
-#endif
-#include "include/environment.h"
-#include "time_conversions.h"
-#include <stdlib.h>
-#include "Windows.h"
-
-////////////////////////////////////////////////////////
-//  Environment Variable Stuff
-////////////////////////////////////////////////////////
-
-typedef struct env_entry env_entry;
-
-#define ENV_IS_STATIC 0
-#define ENV_FREE_KEY 1
-#define ENV_FREE_BOTH 2
-
-struct env_entry {
-  char *key;
-  char *value;
-  int flag;
-  env_entry *next;
-};
-
-static bool env_ready = false;
-static env_entry *env_head = NULL;
-
-static env_entry *
-env_find_key(const char *key)
-{
-  env_entry *entry = env_head;
-  while (entry) {
-    if (strcmp(entry->key, key) == 0)
-      return entry;
-
-    entry = entry->next;
-  }
-
-  return NULL;
-}
-
-static void
-putenv_internal(char *key, char *value, int flag)
-{
-  env_entry *entry = env_find_key(key);
-  if (entry) {
-    // get rid of old key/value; if flag is set, then
-    // they're static strings and we don't touch them
-    if (entry->flag == ENV_FREE_BOTH)
-      free (entry->value);
-    if (entry->flag == ENV_FREE_KEY)
-      free (entry->key);
-  } else {
-    entry = new env_entry;
-    entry->next = env_head;
-    env_head = entry;
-  }
-
-  entry->key = key;
-  entry->value = value;
-  entry->flag = flag;
-}
-
-static void
-init_initial_env() {
-  env_ready = true;
-
-  putenv_internal("NSS_DEFAULT_DB_TYPE", "sql", ENV_IS_STATIC);
-  putenv_internal("NSPR_FD_CACHE_SIZE_LOW", "10", ENV_IS_STATIC);
-  putenv_internal("NSPR_FD_CACHE_SIZE_HIGH", "30", ENV_IS_STATIC);
-  putenv_internal("XRE_PROFILE_NAME", "default", ENV_IS_STATIC);
-  putenv_internal("tmp", "/Temp", ENV_IS_STATIC);
-}
-
-void
-putenv_copy(const char *k, const char *v)
-{
-  if (!env_ready)
-    init_initial_env();
-
-  putenv_internal(strdup(k), strdup(v), ENV_FREE_BOTH);
-}
-
-int
-putenv(const char *envstr)
-{
-  if (!env_ready)
-    init_initial_env();
-
-  char *key = strdup(envstr);
-  char *value = strchr(key, '=');
-  if (!value) {
-    free(key);
-    return -1;
-  }
-
-  *value++ = '\0';
-
-  putenv_internal(key, value, ENV_FREE_KEY);
-
-  return 0;
-}
-
-char *
-getenv(const char* name)
-{
-  if (!env_ready)
-    init_initial_env();
-
-  env_entry *entry = env_find_key(name);
-  if (entry && entry->value[0] != 0) {
-    return entry->value;
-  }
-
-  return NULL;
-}
-
-char
-GetEnvironmentVariableW(const WCHAR* lpName,
-                        WCHAR* lpBuffer,
-                        unsigned long nSize)
-{
-  char key[256];
-  int rv = WideCharToMultiByte(CP_ACP, 0, lpName, -1, key, 255, NULL, NULL);
-  if (rv <= 0)
-    return 0;
-
-  key[rv] = 0;
-  
-  char* val = getenv(key);
-  
-  if (!val)
-    return 0;
-
-  // strlen(val)+1, let MBTWC convert the nul byte for us
-  return MultiByteToWideChar(CP_ACP, 0, val, strlen(val)+1, lpBuffer, nSize);
-}
-
-char
-SetEnvironmentVariableW(const WCHAR* name,
-                        const WCHAR* value)
-{
-  char key[256];
-  char val[256];
-  int rv;
-
-  rv = WideCharToMultiByte(CP_ACP, 0, name, -1, key, 255, NULL, NULL);
-  if (rv < 0)
-    return rv;
-
-  key[rv] = 0;
-  
-  rv = WideCharToMultiByte(CP_ACP, 0, value, -1, val, 255, NULL, NULL);
-  if (rv < 0)
-    return rv;
-
-  val[rv] = 0;
-
-  putenv_copy(key, val);
-  return 0;
-}
-
-
-unsigned int ExpandEnvironmentStringsW(const WCHAR* lpSrc,
-                                       WCHAR* lpDst,
-                                       unsigned int nSize)
-{
-  if ( NULL == lpDst )
-    return 0;
-
-  unsigned int size = 0;
-  unsigned int index = 0;
-  unsigned int origLen = wcslen(lpSrc);
-
-  const WCHAR *pIn = lpSrc;
-  WCHAR *pOut = lpDst;
-
-  while ( index < origLen ) {
-
-    if (*pIn != L'%') {  // Regular char, copy over
-      if ( size++ < nSize ) *pOut = *pIn, pOut++;
-      index++, pIn++;
-      continue;
-    }
-
-    // Have a starting '%' - look for matching '%'
-    int envlen = 0;
-    const WCHAR *pTmp = pIn + 1;
-    while ( *pTmp != L'%' && *pTmp != L' ' ) {
-      envlen++, pTmp++;
-      if ( origLen < index + envlen ) {    // Ran past end of original
-        while ( envlen-- ) {
-          if ( size++ < nSize ) *pOut = *pIn, pOut++;
-          index++, pIn++;
-        }
-        break;
-      }
-    }
-
-    if ( *pTmp == L' ' ) { // Need to append through space
-      while ( envlen-- ) {
-        if ( size++ < nSize ) *pOut = *pIn, pOut++;
-        index++, pIn++;
-      }
-      continue;
-    }
-
-    pIn++; // Move past original %
-    if ( 0 == envlen ) {  // Encountered a "%%" - mapping to "%"
-      if ( size++ < nSize ) *pOut = *pIn, pOut++;
-      index += 2, pIn++;
-    } else {
-      // Encountered a "%something%" - mapping "something"
-      char key[256];
-      int k = WideCharToMultiByte(CP_ACP, 0, pIn, envlen, key, 255, NULL, NULL);
-      key[k] = 0;
-      char *pC = getenv(key);
-      if ( NULL != pC ) {
-        int n = MultiByteToWideChar( CP_ACP, 0, pC, -1, pOut, nSize - size );
-        if ( n > 0 ) {
-          size += n - 1;  // Account for trailing zero
-          pOut += n - 1;
-        }
-      }
-      index += envlen + 2;
-      pIn = ++pTmp;
-    }
-  }
-
-  if ( size < nSize ) lpDst[size] = 0;
-  return size;
-}
-
-WCHAR *
-mozce_GetEnvironmentCL()
-{
-  env_entry *entry = env_head;
-  int len = 0;
-  while (entry) {
-    if (entry->flag == ENV_IS_STATIC) {
-      entry = entry->next;
-      continue;
-    }
-
-    len += strlen(entry->key);
-    len += strlen(entry->value);
-
-    // for each env var, 11 chars of " --environ:", 3 chars of '"="', and a null at the end
-    len += 11 + 3 + 1;
-
-    entry = entry->next;
-  }
-
-  if (len == 0) {
-    return wcsdup(L"");
-  }
-
-  wchar_t *env = (wchar_t*) malloc(sizeof(wchar_t) * (len+1));
-  if (!env)
-    return NULL;
-
-  entry = env_head;
-
-  int pos = 0;
-  while (entry) {
-    if (entry->flag == ENV_IS_STATIC) {
-      entry = entry->next;
-      continue;
-    }
-
-    if (strchr(entry->key, '"') || strchr(entry->value, '"')) {
-      // argh, we don't have a good way of encoding the ", so let's just
-      // ignore this var for now
-      RETAILMSG(1, (L"Skipping environment variable with quote marks in key or value! %S -> %s\r\n", entry->key, entry->value));
-      entry = entry->next;
-      continue;
-    }
-
-    wcscpy (env+pos, L" --environ:\"");
-    pos += 12;
-    pos += MultiByteToWideChar(CP_ACP, 0, entry->key, strlen(entry->key), env+pos, len-pos);
-    env[pos++] = '=';
-    pos += MultiByteToWideChar(CP_ACP, 0, entry->value, strlen(entry->value), env+pos, len-pos);
-    env[pos++] = '\"';
-
-    entry = entry->next;
-  } 
-
-  env[pos] = '\0';
-
-  return env;
-  
-}
deleted file mode 100644
deleted file mode 100644
--- a/build/wince/shunt/include/environment.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is MOZCE Lib.
- *
- * The Initial Developer of the Original Code is Doug Turner <dougt@meer.net>.
-
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Robert Strong <robert.bugzilla@gmail.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/* environment.h and environment.cpp are also included by app update */
-
-#ifndef MOZCE_ENVIRONMENT_H
-#define MOZCE_ENVIRONMENT_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Environment stuff */
-char* getenv(const char* inName);
-int putenv(const char *a);
-char SetEnvironmentVariableW(const wchar_t * name, const wchar_t * value );
-char GetEnvironmentVariableW(const wchar_t * lpName, wchar_t* lpBuffer, unsigned long nSize);
-
-unsigned int ExpandEnvironmentStringsW(const wchar_t* lpSrc,
-				       wchar_t* lpDst,
-				       unsigned int nSize);
-
-wchar_t* mozce_GetEnvironmentCL();
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif //MOZCE_ENVIRONMENT_H
deleted file mode 100644
--- a/build/wince/shunt/include/errno.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#define EPERM           1       /* Operation not permitted */
-#define ENOENT          2       /* No such file or directory */
-#define ESRCH           3       /* No such process */
-#define EINTR           4       /* Interrupted system call */
-#define EIO             5       /* Input/output error */
-#define ENXIO           6       /* Device not configured */
-#define E2BIG           7       /* Argument list too long */
-#define ENOEXEC         8       /* Exec format error */
-#define EBADF           9       /* Bad file descriptor */
-#define ECHILD          10      /* No child processes */
-#define EDEADLK         11      /* Resource deadlock avoided */
-#define ENOMEM          12      /* Cannot allocate memory */
-#define EACCES          13      /* Permission denied */
-#define EFAULT          14      /* Bad address */
-#define ENOTBLK         15      /* Block device required */
-#define EBUSY           16      /* Device busy */
-#define EEXIST          17      /* File exists */
-#define EXDEV           18      /* Cross-device link */
-#define ENODEV          19      /* Operation not supported by device */
-#define ENOTDIR         20      /* Not a directory */
-#define EISDIR          21      /* Is a directory */
-#define EINVAL          22      /* Invalid argument */
-#define ENFILE          23      /* Too many open files in system */
-#define EMFILE          24      /* Too many open files */
-#define ENOTTY          25      /* Inappropriate ioctl for device */
-#define ETXTBSY         26      /* Text file busy */
-#define EFBIG           27      /* File too large */
-#define ENOSPC          28      /* No space left on device */
-#define ESPIPE          29      /* Illegal seek */
-#define EROFS           30      /* Read-only file system */
-#define EMLINK          31      /* Too many links */
-#define EPIPE           32      /* Broken pipe */
-#define EDOM            33      /* Numerical argument out of domain */
-#define ERANGE          34      /* Result too large */
-#define EAGAIN          35      /* Resource temporarily unavailable */
-#define ENOTEMPTY       39      /* Directory not empty */
-
-
deleted file mode 100644
deleted file mode 100644
deleted file mode 100644
deleted file mode 100644
--- a/build/wince/shunt/include/mozce_shunt.h
+++ /dev/null
@@ -1,240 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is MOZCE Lib.
- *
- * The Initial Developer of the Original Code is Doug Turner <dougt@meer.net>.
-
- * Portions created by the Initial Developer are Copyright (C) 2005
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  John Wolfe <wolfe@lobo.us>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef MOZCE_SHUNT_H
-#define MOZCE_SHUNT_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _WCHAR_T_DEFINED
-typedef unsigned short wchar_t;
-#define _WCHAR_T_DEFINED
-#endif
-
-#ifdef __cplusplus
-}   //extern "C" 
-#endif
-
-#include "environment.h"
-
-#ifdef MOZ_MEMORY
-
-#ifdef __cplusplus
-
-// define these so we don't include <new> from either VC or
-// the CE5 SDK
-#define _NEW_
-#define _INC_NEW
-
-#ifndef __NOTHROW_T_DEFINED
-#define __NOTHROW_T_DEFINED
-namespace std {
-  struct nothrow_t {};
-  extern const nothrow_t nothrow;
-  struct bad_alloc {};
-};
-#endif
-
-// grab malloc and free prototypes
-#include "jemalloc.h"
-
-// mozalloc.h defines "normal" infallible operator new, but not
-// std::nothrow operator new, so we define that below.  This is inline
-// and exported from the shunt.
-inline void *operator new(size_t size, const std::nothrow_t&) throw() {
-  return malloc(size);
-}
-inline void *operator new[](size_t size, const std::nothrow_t&) throw() {
-  return malloc(size);
-}
-inline void operator delete(void* ptr, const std::nothrow_t&) throw() {
-  free(ptr);
-}
-inline void operator delete[](void* ptr, const std::nothrow_t&) throw() {
-  free(ptr);
-}
-
-// Placement new.  Just inline, not exported (which doesn't work for
-// some reason, but it's a noop in any case)
-inline void *operator new(size_t, void *p) {
-  return p;
-}
-inline void *operator new[](size_t, void *p) {
-  return p;
-}
-
-#ifndef IN_SHUNT
-// for Gecko, include infallible mozalloc allocators.  elsewhere, define
-// operator new() normally.
-// NB: this include guard needs to be kept in sync with the one in nscore.h
-#if defined(_MOZILLA_CONFIG_H_) && !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
-#  include "mozilla/mozalloc.h"
-#else
-
-inline void* operator new(size_t size) throw() {
-  return malloc(size);
-}
-inline void* operator new[](size_t size) throw() {
-  return malloc(size);
-}
-inline void operator delete(void* ptr) throw() {
-  free(ptr);
-}
-inline void operator delete[](void* ptr) throw() {
-  free(ptr);
-}
-
-#endif  // if defined(_MOZILLA_CONFIG_H_)
-#endif
-
-extern "C" {
-#endif
-
-#undef _strdup
-#undef strdup
-#undef _strndup
-#undef strndup
-#undef _wcsdup
-#undef wcsdup
-#undef _wcsndup
-#undef wcsndup
-
-char * __cdecl
-_strdup(const char*);
-
-wchar_t * __cdecl
-_wcsdup(const wchar_t *);
-
-char * __cdecl
-_strndup(const char *, unsigned int);
-
-wchar_t * __cdecl
-_wcsndup(const wchar_t *, unsigned int);
-  
-#ifdef __cplusplus
-}   //extern "C" 
-#endif
-
-#endif  // ifdef MOZ_MEMORY
-
-#define strdup  _strdup
-#define strndup _strndup
-#define wcsdup _wcsdup
-#define wcsndup _wcsndup
-
-
-#define strcmpi _stricmp
-#define stricmp _stricmp
-#define wgetcwd _wgetcwd
-#define vsnprintf _vsnprintf
-
-#define SHGetSpecialFolderPathW SHGetSpecialFolderPath
-#define SHGetPathFromIDListW    SHGetPathFromIDList
-#define FONTENUMPROCW           FONTENUMPROC
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* errno and family */
-extern int errno;
-char* strerror(int);
-
-/* abort */
-void abort(void);
-  
-/* Environment stuff */
-char* getenv(const char* inName);
-int putenv(const char *a);
-char SetEnvironmentVariableW(const wchar_t * name, const wchar_t * value );
-char GetEnvironmentVariableW(const wchar_t * lpName, wchar_t* lpBuffer, unsigned long nSize);
-  
-unsigned int ExpandEnvironmentStringsW(const wchar_t* lpSrc,
-				       wchar_t* lpDst,
-				       unsigned int nSize);
-
-/* File system stuff */
-wchar_t * _wgetcwd(wchar_t* dir, unsigned long size);
-wchar_t *_wfullpath(wchar_t *absPath, const wchar_t *relPath, unsigned long maxLength );
-int _unlink(const char *filename );
-int _wchdir(const wchar_t* path);
-  
-/* The time stuff should be defined here, but it can't be because it
-   is already defined in time.h.
-  
- size_t strftime(char *, size_t, const char *, const struct tm *)
- struct tm* localtime(const time_t* inTimeT)
- struct tm* mozce_gmtime_r(const time_t* inTimeT, struct tm* outRetval)
- struct tm* gmtime(const time_t* inTimeT)
- time_t mktime(struct tm* inTM)
- time_t time(time_t *)
- clock_t clock() 
-  
-*/
-
-struct tm;
-
-#ifndef _TIME_T_DEFINED
-typedef long time_t;
-#define _TIME_T_DEFINED
-#endif
-
-struct tm* gmtime_r(const time_t* inTimeT, struct tm* outRetval);
-struct tm* localtime_r(const time_t* inTimeT, struct tm* outRetval);
-
-/* Locale Stuff */
-  
-/* The locale stuff should be defined here, but it can't be because it
-   is already defined in locale.h.
-  
- struct lconv * localeconv(void)
-  
-*/
-
-
-wchar_t* mozce_GetEnvironmentCL();
-
-  /* square root of 1/2, missing from math.h */ 
-#define M_SQRT1_2  0.707106781186547524401
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif //MOZCE_SHUNT_H
deleted file mode 100644
--- a/build/wince/shunt/include/process.h
+++ /dev/null
@@ -1,3 +0,0 @@
-
-#define _beginthreadex(security, stack_size, start_proc, arg, flags, pid) \
-  CreateThread(security, stack_size ? stack_size : 65536L,(LPTHREAD_START_ROUTINE) start_proc, arg, flags | STACK_SIZE_PARAM_IS_A_RESERVATION, pid)
deleted file mode 100644
deleted file mode 100644
--- a/build/wince/shunt/include/stdlib.h.in
+++ /dev/null
@@ -1,88 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is MOZCE Lib.
- *
- * The Initial Developer of the Original Code is Brad Lassey <blassey@mozilla.com>.
-
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-
-#ifndef MOZCE_STDLIB_H
-#define MOZCE_STDLIB_H
-#ifdef MOZ_MEMORY
-
-#undef strdup
-#undef _strdup
-#undef wcsdup
-#undef _wcsdup
-#undef strndup
-#undef _strndup
-#undef wcsndup
-#undef _wcsndup
-
-#define free orig_free
-#define malloc orig_malloc
-#define calloc orig_calloc
-#define realloc orig_realloc
-#define _wcsdup orig_wcsdup
-#define _strdup orig_strup
-
-#endif
-
-#include "@WINCE_SDK_DIR@/Include/Armv4i/stdlib.h"
-
-#ifdef MOZ_MEMORY
-
-#undef free
-#undef malloc
-#undef calloc
-#undef realloc
-
-#undef strdup
-#undef _strdup
-#undef wcsdup
-#undef _wcsdup
-#undef strndup
-#undef _strndup
-#undef wcsndup
-#undef _wcsndup
-
-#define strdup _strdup
-#define strndup _strndup
-#define wcsdup _wcsdup
-#define wcsndup _wcsndup
-
-/* now include jemalloc.h to get the real malloc, free, etc. */
-#include "jemalloc.h"
-
-#endif
-
-#endif
deleted file mode 100644
--- a/build/wince/shunt/include/sys/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is Mozilla core build scripts.
-#
-# The Initial Developer of the Original Code is
-# Brad Lassey <blassey@mozilla.com>
-#
-# Portions created by the Initial Developer are Copyright (C) 2008
-# the Mozilla Foundation <http://www.mozilla.org/>. All Rights Reserved.
-#
-# Contributor(s): 
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH = ../../../../..
-topsrcdir = @top_srcdir@
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-include $(topsrcdir)/config/rules.mk
-
-export:: $(srcdir)/stat.h $(srcdir)/types.h
-	$(INSTALL) $^ $(DIST)/include/mozce_shunt/sys
-
deleted file mode 100644
deleted file mode 100644
deleted file mode 100644
--- a/build/wince/shunt/include/windows.h.in
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is MOZCE Lib.
- *
- * The Initial Developer of the Original Code is Doug Turner <dougt@meer.net>.
-
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  John Wolfe <wolfe@lobo.us>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-
-#ifndef MOZCE_WINDOWS_H
-#define MOZCE_WINDOWS_H
-
-// This is to work around the inconistancy of GetProcAddress between 
-// windows desktop and wince, see bug 464190
-
-#include "@WINCE_SDK_DIR@/Include/Armv4i/windows.h"
-#ifdef GetProcAddress
-#undef GetProcAddress
-#endif
-#define GetProcAddress GetProcAddressA
-#endif
deleted file mode 100644
--- a/build/wince/shunt/include/ymath.h.in
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is MOZCE Lib.
- *
- * The Initial Developer of the Original Code is Doug Turner <dougt@meer.net>.
-
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  John Wolfe <wolfe@lobo.us>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-
-#ifndef MOZCE_YMATH_H
-#define MOZCE_YMATH_H
-
-// This is to work around _FNan not being defined on wince, see bug 464180
-
-#include "@WINCE_SDK_DIR@/Include/Armv4i/ymath.h"
-#define _FMAX	    ((1 << (15 - _FOFF)) - 1)
-#define _FOFF	    7
-#define _FSIGN    0x8000
-#define INIT(w0)  {w0, 0}
-static const _Dconst _FNanWinCE = {INIT((_FMAX << _FOFF)
-  | (1 << (_FOFF - 1)))};
-#define _FNan _FNanWinCE
-#endif
deleted file mode 100644
--- a/build/wince/shunt/memory.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C;  c-basic-offset: 2; tab-width: 4; indent-tabs-mode: nil; -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is MOZCE Lib.
- *
- * The Initial Developer of the Original Code is Doug Turner <dougt@meer.net>.
- 
- * Portions created by the Initial Developer are Copyright (C) 2005
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  John Wolfe <wolfe@lobo.us>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "include/mozce_shunt.h"
-#include <stdlib.h>
-
-#ifdef MOZ_MEMORY
-
-// declare the nothrow object
-const std::nothrow_t std::nothrow;
-
-char*
-_strndup(const char *src, size_t len) {
-  char* dst = (char*)malloc(len + 1);
-  if(dst)
-    strncpy(dst, src, len + 1);
-  return dst;
-}
-
-
-char*
-_strdup(const char *src) {
-  size_t len = strlen(src);
-  return _strndup(src, len );
-}
-
-wchar_t * 
-_wcsndup(const wchar_t *src, size_t len) {
-  wchar_t* dst = (wchar_t*)malloc(sizeof(wchar_t) * (len + 1));
-  if(dst)
-    wcsncpy(dst, src, len + 1);
-  return dst;
-}
-
-wchar_t * 
-_wcsdup(const wchar_t *src) {
-  size_t len = wcslen(src);
-  return _wcsndup(src, len);
-}
-#endif
-
deleted file mode 100644
--- a/build/wince/shunt/mozce_shunt.def.in
+++ /dev/null
@@ -1,54 +0,0 @@
-LIBRARY mozce_shunt.dll
-EXPORTS
-ExpandEnvironmentStringsW
-GetEnvironmentVariableW
-SetEnvironmentVariableW
-_unlink
-_wfullpath
-_wgetcwd
-_wchdir
-abort
-clock
-errno
-gmtime
-gmtime_r
-localeconv
-localtime
-localtime_r
-mktime
-mozce_GetEnvironmentCL
-putenv
-getenv
-strerror
-strftime
-time
-
-#ifdef MOZ_MEMORY
-;; std::nothrow object
-?nothrow@std@@3Unothrow_t@1@B
-;; operator new
-??2@YAPAXI@Z
-;; operator new nothrow
-??2@YAPAXIABUnothrow_t@std@@@Z
-;; operator delete
-??3@YAXPAX@Z
-;; operator new[]
-??_U@YAPAXI@Z
-;; operator new[] nothrow
-??_U@YAPAXIABUnothrow_t@std@@@Z
-;; operator delete[]
-??_V@YAXPAX@Z
-malloc
-valloc
-calloc
-realloc
-free
-posix_memalign
-memalign
-malloc_usable_size
-jemalloc_stats
-_strdup
-_wcsdup
-_strndup
-_wcsndup
-#endif
deleted file mode 100644
--- a/build/wince/shunt/shunt.cpp
+++ /dev/null
@@ -1,271 +0,0 @@
-/* -*- Mode: C;  c-basic-offset: 2; tab-width: 4; indent-tabs-mode: nil; -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is MOZCE Lib.
- *
- * The Initial Developer of the Original Code is Doug Turner <dougt@meer.net>.
- 
- * Portions created by the Initial Developer are Copyright (C) 2005
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  John Wolfe <wolfe@lobo.us>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
- 
-#include "include/mozce_shunt.h"
-#include "time_conversions.h"
-#include <stdlib.h>
-#include "Windows.h"
-
-// from environment.cpp
-void putenv_copy(const char *k, const char *v);
-
-////////////////////////////////////////////////////////
-//  special folder stuff
-////////////////////////////////////////////////////////
-
-typedef struct MOZCE_SHUNT_SPECIAL_FOLDER_INFO
-{
-  int   nFolder;
-  char *folderEnvName;
-} MozceShuntSpecialFolderInfo;
-
-// TAKEN DIRECTLY FROM MICROSOFT SHELLAPI.H HEADER FILE 
-// supported SHGetSpecialFolderPath nFolder ids
-#define CSIDL_DESKTOP            0x0000
-#define CSIDL_PROGRAMS           0x0002      // \Windows\Start Menu\Programs
-#define CSIDL_PERSONAL           0x0005
-#define CSIDL_WINDOWS            0x0024      // \Windows
-#define CSIDL_PROGRAM_FILES      0x0026      // \Program Files
-
-#define CSIDL_APPDATA            0x001A      // NOT IN SHELLAPI.H header file
-#define CSIDL_PROFILE            0x0028      // NOT IN SHELLAPI.H header file
-
-MozceShuntSpecialFolderInfo mozceSpecialFoldersToEnvVars[] = {
-  { CSIDL_APPDATA,  "APPDATA" },
-  { CSIDL_PROGRAM_FILES, "ProgramFiles" },
-  { CSIDL_WINDOWS,  "windir" },
-
-  //  { CSIDL_PROFILE,  "HOMEPATH" },     // No return on WinMobile 6 Pro
-  //  { CSIDL_PROFILE,  "USERPROFILE" },  // No return on WinMobile 6 Pro
-  //  { int, "ALLUSERSPROFILE" },         // Only one profile on WinCE
-  //  { int, "CommonProgramFiles" },
-  //  { int, "COMPUTERNAME" },
-  //  { int, "HOMEDRIVE" },
-  //  { int, "SystemDrive" },
-  //  { int, "SystemRoot" },
-  //  { int, "TEMP" },
-
-  { NULL, NULL }
-};
-
-static void InitializeSpecialFolderEnvVars()
-{
-  MozceShuntSpecialFolderInfo *p = mozceSpecialFoldersToEnvVars;
-  while ( p && p->nFolder && p->folderEnvName ) {
-    WCHAR wPath[MAX_PATH];
-    char  cPath[MAX_PATH];
-    if ( SHGetSpecialFolderPath(NULL, wPath, p->nFolder, FALSE) )
-      if ( 0 != WideCharToMultiByte(CP_ACP, 0, wPath, -1, cPath, MAX_PATH, 0, 0) )
-        putenv_copy(p->folderEnvName, cPath);
-    p++;
-  }
-}
-
-////////////////////////////////////////////////////////
-//  errno
-////////////////////////////////////////////////////////
-
-char* strerror(int inErrno)
-{
-  return "Unknown Error";
-}
-
-int errno = 0;
-
-
-////////////////////////////////////////////////////////
-//  File System Stuff
-////////////////////////////////////////////////////////
-
-wchar_t * _wgetcwd(wchar_t * dir, unsigned long size)
-{
-  wchar_t tmp[MAX_PATH] = {0};
-  GetEnvironmentVariableW(L"CWD", tmp, size);
-  if (tmp && tmp[0]) {
-    if (wcslen(tmp) > size)
-      return 0;
-    if (!dir) {
-      dir = (wchar_t*)malloc(sizeof(wchar_t) * (wcslen(tmp) + 2));
-      if (!dir)
-        return 0;
-    }
-    wcscpy(dir, tmp);
-  } else {
-    unsigned long i;
-    if (!dir) {
-      dir = (wchar_t*)malloc(sizeof(wchar_t) * (MAX_PATH + 1));
-      if (!dir)
-        return 0;
-    }
-    if (!GetModuleFileNameW(GetModuleHandle (NULL), dir, MAX_PATH))
-      return 0;
-    for (i = wcslen(dir); i && dir[i] != '\\'; i--) {}
-    dir[i + 1] = '\0';
-    SetEnvironmentVariableW(L"CWD", dir);
-  }
-  size_t len = wcslen(dir);
-  if (dir[len - 1] != '\\' && (len + 2) < size) {
-    dir[len] = '\\';
-    dir[len + 1] = '\0';
-  }
-  return dir;
-}
-
-wchar_t *_wfullpath( wchar_t *absPath, const wchar_t *relPath, unsigned long maxLength )
-{
-  if(absPath == NULL){
-    absPath = (wchar_t *)malloc(maxLength*sizeof(wchar_t));
-  }
-  wchar_t cwd[MAX_PATH];
-  if (NULL == _wgetcwd( cwd, MAX_PATH))
-    return NULL;
-
-  unsigned long len = wcslen(cwd);
-  if(!(cwd[len-1] == TCHAR('/') || cwd[len-1] == TCHAR('\\'))&& len< maxLength){
-    cwd[len] = TCHAR('\\');
-    cwd[++len] = TCHAR('\0');
-  }
-  if(len+wcslen(relPath) < maxLength){
-#if (_WIN32_WCE > 300)
-    if ( 0 < CeGetCanonicalPathName(relPath[0] == L'\\'? relPath : 
-                                                         wcscat(cwd,relPath), 
-                                    absPath, maxLength, 0))
-      return absPath;
-#else
-    #error Need CeGetCanonicalPathName to build.
-    // NO ACTUAL CeGetCanonicalPathName function in earlier versions of WinCE
-#endif
-  }
-  return NULL;
-}
-
-int _wchdir(const WCHAR* path) {
-  return SetEnvironmentVariableW(L"CWD", path);
-}
-
-int _unlink(const char *filename)
-{
-  wchar_t wname[MAX_PATH];
-  
-  MultiByteToWideChar(CP_ACP,
-                      0,
-                      filename,
-                      strlen(filename)+1,
-                      wname,
-                      MAX_PATH );
-  return DeleteFileW(wname)?0:-1;
-}
-
-void abort(void)
-{
-#if defined(DEBUG)
-  DebugBreak();
-#endif
-  TerminateProcess((HANDLE) GetCurrentProcessId(), 3);
-}
-
-////////////////////////////////////////////////////////
-//  Locale Stuff
-////////////////////////////////////////////////////////
-
-#define localeconv __not_supported_on_device_localeconv
-#include <locale.h>
-#undef localeconv
-
-extern "C" {
-  struct lconv * localeconv(void);
-}
-
-static struct lconv s_locale_conv =
-  {
-    ".",   /* decimal_point */
-    ",",   /* thousands_sep */
-    "333", /* grouping */
-    "$",   /* int_curr_symbol */
-    "$",   /* currency_symbol */
-    "",    /* mon_decimal_point */
-    "",    /* mon_thousands_sep */
-    "",    /* mon_grouping */
-    "+",   /* positive_sign */
-    "-",   /* negative_sign */
-    '2',   /* int_frac_digits */
-    '2',   /* frac_digits */
-    1,     /* p_cs_precedes */
-    1,     /* p_sep_by_space */
-    1,     /* n_cs_precedes */
-    1,     /* n_sep_by_space */
-    1,     /* p_sign_posn */
-    1,     /* n_sign_posn */
-  };
-
-struct lconv * localeconv(void)
-{
-  return &s_locale_conv;
-}
-
-
-////////////////////////////////////////////////////////
-//  DllMain
-////////////////////////////////////////////////////////
-
-BOOL WINAPI DllMain(HANDLE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
-{
-  // Perform actions based on the reason for calling.
-  switch( fdwReason ) 
-  { 
-    case DLL_PROCESS_ATTACH:
-      // Initialize once for each new process.
-      // Return FALSE to fail DLL load.
-      InitializeSpecialFolderEnvVars();
-      break;
-
-    case DLL_THREAD_ATTACH:
-      // Do thread-specific initialization.
-      break;
-
-    case DLL_THREAD_DETACH:
-      // Do thread-specific cleanup.
-      break;
-
-    case DLL_PROCESS_DETACH:
-      // Perform any necessary cleanup.
-      break;
-  }
-  return TRUE;  // Successful DLL_PROCESS_ATTACH.
-}
deleted file mode 100644
--- a/build/wince/shunt/time.cpp
+++ /dev/null
@@ -1,229 +0,0 @@
-/* -*- Mode: C;  c-basic-offset: 2; tab-width: 4; indent-tabs-mode: nil; -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is MOZCE Lib.
- *
- * The Initial Developer of the Original Code is Doug Turner <dougt@meer.net>.
- 
- * Portions created by the Initial Developer are Copyright (C) 2005
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  John Wolfe <wolfe@lobo.us>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
- 
-#include "include/mozce_shunt.h"
-#include "time_conversions.h"
-#include <stdlib.h>
-#include <Windows.h>
-#include <altcecrt.h>
-
-////////////////////////////////////////////////////////
-//  Time Stuff
-////////////////////////////////////////////////////////
-
-// This is the kind of crap that makes me hate microsoft.  defined in their system headers, but not implemented anywhere.
-#define strftime __not_supported_on_device_strftime
-#define localtime __not_supported_on_device_localtime
-#define mktime __not_supported_on_device_mktime
-#define gmtime __not_supported_on_device_gmtime
-#define time __not_supported_on_device_time
-#define clock __not_supported_on_device_clock
-#include <time.h>
-#undef strftime
-#undef localtime
-#undef mktime
-#undef gmtime
-#undef time
-#undef clock
-
-extern "C" {
-  size_t strftime(char *, size_t, const char *, const struct tm *);
-  struct tm* localtime(const time_t* inTimeT);
-  time_t mktime(struct tm* inTM);
-  struct tm* gmtime(const time_t* inTimeT);
-  time_t time(time_t *);
-  clock_t clock();
-}
-
-static const int sDaysOfYear[12] = {
-  0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
-};
-static struct tm tmStorage;
-
-size_t strftime(char *out, size_t maxsize, const char *pat, const struct tm *time)
-{
-  size_t ret = 0;
-  size_t wpatlen = MultiByteToWideChar(CP_ACP, 0, pat, -1, 0, 0);
-  if (wpatlen) {
-    wchar_t* wpat = (wchar_t*)calloc(wpatlen, sizeof(wchar_t));
-    if (wpat) {
-      wchar_t* tmpBuf = (wchar_t*)calloc(maxsize, sizeof(wchar_t));
-      if (tmpBuf) {
-        if (MultiByteToWideChar(CP_ACP, 0, pat, -1, wpat, wpatlen)) {
-          if (wcsftime(tmpBuf, maxsize, wpat, time))
-            ret = ::WideCharToMultiByte(CP_ACP, 0, tmpBuf, -1, out, maxsize, 0, 0);
-        }
-        free(tmpBuf);
-      }
-      free(wpat);
-    }
-  }
-  return ret;
-}
-
-struct tm* gmtime_r(const time_t* inTimeT, struct tm* outRetval)
-{
-  struct tm* retval = NULL;
-  
-  if(NULL != inTimeT) {
-    SYSTEMTIME winGMTime;
-    
-    time_t_2_SYSTEMTIME(winGMTime, *inTimeT);
-    
-    outRetval->tm_sec = (int)winGMTime.wSecond;
-    outRetval->tm_min = (int)winGMTime.wMinute;
-    outRetval->tm_hour = (int)winGMTime.wHour;
-    outRetval->tm_mday = (int)winGMTime.wDay;
-    outRetval->tm_mon = (int)(winGMTime.wMonth - 1);
-    outRetval->tm_year = (int)(winGMTime.wYear - 1900);
-    outRetval->tm_wday = (int)winGMTime.wDayOfWeek;
-    outRetval->tm_isdst = -1;
-    
-    outRetval->tm_yday = (int)winGMTime.wDay + sDaysOfYear[outRetval->tm_mon];
-    if(0 == (winGMTime.wYear & 3)) {
-      if(2 < winGMTime.wMonth) {
-        if(0 == winGMTime.wYear % 100) {
-          if(0 == winGMTime.wYear % 400) {
-            outRetval->tm_yday++;
-          }
-        }else {
-          outRetval->tm_yday++;
-        }
-      }
-    }
-    retval = outRetval;
-  }
-  return retval;
-}
-
-struct tm* localtime_r(const time_t* inTimeT,struct tm* outRetval)
-{
-  struct tm* retval = NULL;
-  
-  if(NULL != inTimeT && NULL != outRetval) {
-    SYSTEMTIME winLocalTime;
-    
-    time_t_2_LOCALSYSTEMTIME(winLocalTime, *inTimeT);
-    
-    outRetval->tm_sec = (int)winLocalTime.wSecond;
-    outRetval->tm_min = (int)winLocalTime.wMinute;
-    outRetval->tm_hour = (int)winLocalTime.wHour;
-    outRetval->tm_mday = (int)winLocalTime.wDay;
-    outRetval->tm_mon = (int)(winLocalTime.wMonth - 1);
-    outRetval->tm_year = (int)(winLocalTime.wYear - 1900);
-    outRetval->tm_wday = (int)winLocalTime.wDayOfWeek;
-    outRetval->tm_isdst = -1;
-    
-    outRetval->tm_yday = (int)winLocalTime.wDay + sDaysOfYear[outRetval->tm_mon];
-    if(0 == (winLocalTime.wYear & 3)) {
-      if(2 < winLocalTime.wMonth) {
-        if(0 == winLocalTime.wYear % 100) {
-          if(0 == winLocalTime.wYear % 400) {
-            outRetval->tm_yday++;
-          }
-        } else {
-          outRetval->tm_yday++;
-        }
-      }
-    }
-    retval = outRetval;
-  }
-  return retval;
-}
-
-
-struct tm* localtime(const time_t* inTimeT)
-{
-  return localtime_r(inTimeT, &tmStorage);
-}
-
-struct tm* gmtime(const time_t* inTimeT)
-{
-  return gmtime_r(inTimeT, &tmStorage);
-}
-
-
-time_t mktime(struct tm* inTM)
-{
-  time_t retval = (time_t)-1;
-  
-  if(NULL != inTM) {
-    SYSTEMTIME winTime;
-    struct tm* gmTime = NULL;
-    
-    memset(&winTime, 0, sizeof(winTime));
-    
-    /*
-     * Ignore tm_wday and tm_yday.
-     * We likely have some problems with dst.
-     */
-    winTime.wSecond = inTM->tm_sec;
-    winTime.wMinute = inTM->tm_min;
-    winTime.wHour = inTM->tm_hour;
-    winTime.wDay = inTM->tm_mday;
-    winTime.wMonth = inTM->tm_mon + 1;
-    winTime.wYear = inTM->tm_year + 1900;
-    
-    /*
-     * First get our time_t.
-     */
-    SYSTEMTIME_2_time_t(retval, winTime);
-    
-    /*
-     * Now overwrite the struct passed in with what we believe it should be.
-     */
-    gmTime = gmtime_r(&retval, inTM);
-  }
-  return retval;
-}
-
-time_t time(time_t *)
-{
-  time_t retval;
-  SYSTEMTIME winTime;
-  ::GetSystemTime(&winTime);
-  SYSTEMTIME_2_time_t(retval, winTime);
-  return retval;
-}
-
-clock_t clock() 
-{
-  return -1;
-}
-
deleted file mode 100644
--- a/build/wince/shunt/time_conversions.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code, released
- * Jan 28, 2003.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2003
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Garrett Arch Blythe, 28-January-2003
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#if !defined(__time_conversions_h)
-#define __time_conversions_h
-
-
-#define TIME_BEGIN_MACRO do {
-#define TIME_END_MACRO } while(0);
-
-/*
- * FILETIME has an epoch of 1601.
- * Precomputed the 1970 epoch so we do not have to below.
- */
-#define FILETIME_1970 116444736000000000i64
-
-/*
- * Marco to support add/sub/mul/div on a FILETIME level.
- */
-#define FILETIME_ARITH(outFileTime, inFileTime, inOperation, inValue) \
-    TIME_BEGIN_MACRO \
-        ULARGE_INTEGER buffer1; \
-        \
-        buffer1.LowPart = inFileTime.dwLowDateTime; \
-        buffer1.HighPart = inFileTime.dwHighDateTime; \
-        buffer1.QuadPart = buffer1.QuadPart inOperation inValue; \
-        outFileTime.dwLowDateTime = buffer1.LowPart; \
-        outFileTime.dwHighDateTime = buffer1.HighPart; \
-    TIME_END_MACRO
-
-/*
- * FILETIME is in 100 nanosecond units.
- * Provide macros for conversion to other second units.
- */
-#define FILETIME_2_MICROSECONDS(outTime, inFileTime) \
-    TIME_BEGIN_MACRO \
-        ULARGE_INTEGER buffer2; \
-        \
-        buffer2.LowPart = inFileTime.dwLowDateTime; \
-        buffer2.HighPart = inFileTime.dwHighDateTime; \
-        outTime = buffer2.QuadPart / 10i64; \
-    TIME_END_MACRO
-#define FILETIME_2_MILLISECONDS(outTime, inFileTime) \
-    TIME_BEGIN_MACRO \
-        ULARGE_INTEGER buffer3; \
-        \
-        buffer3.LowPart = inFileTime.dwLowDateTime; \
-        buffer3.HighPart = inFileTime.dwHighDateTime; \
-        outTime = buffer3.QuadPart / 10000i64; \
-    TIME_END_MACRO
-#define FILETIME_2_SECONDS(outTime, inFileTime) \
-    TIME_BEGIN_MACRO \
-        ULARGE_INTEGER buffer4; \
-        \
-        buffer4.LowPart = inFileTime.dwLowDateTime; \
-        buffer4.HighPart = inFileTime.dwHighDateTime; \
-        outTime = buffer4.QuadPart / 10000000i64; \
-    TIME_END_MACRO
-#define SECONDS_2_FILETIME(outFileTime, inTime) \
-    TIME_BEGIN_MACRO \
-        ULARGE_INTEGER buffer5; \
-        \
-        buffer5.QuadPart = (ULONGLONG)inTime * 10000000i64; \
-        outFileTime.dwLowDateTime = buffer5.LowPart; \
-        outFileTime.dwHighDateTime = buffer5.HighPart; \
-    TIME_END_MACRO
-
-/*
- * Conversions from FILETIME 1601 epoch time to LIBC 1970 time.epoch.
- */
-#define FILETIME_2_time_t(outTimeT, inFileTime) \
-    TIME_BEGIN_MACRO \
-        FILETIME result6; \
-        ULONGLONG conversion6; \
-        \
-        FILETIME_ARITH(result6, inFileTime, -, FILETIME_1970); \
-        FILETIME_2_SECONDS(conversion6, result6); \
-        outTimeT = (time_t)conversion6; \
-    TIME_END_MACRO
-#define time_t_2_FILETIME(outFileTime, inTimeT) \
-    TIME_BEGIN_MACRO \
-        FILETIME conversion7; \
-        \
-        SECONDS_2_FILETIME(conversion7, inTimeT); \
-        FILETIME_ARITH(outFileTime, conversion7, +, FILETIME_1970); \
-    TIME_END_MACRO
-
-
-/*
- * Sometimes SYSTEMTIME needs to be handled as well.
- */
-#define SYSTEMTIME_2_time_t(outTimeT, inSystemTime) \
-    TIME_BEGIN_MACRO \
-        FILETIME result8; \
-        \
-        SystemTimeToFileTime(&inSystemTime, &result8); \
-        FILETIME_2_time_t(outTimeT, result8); \
-    TIME_END_MACRO
-#define time_t_2_SYSTEMTIME(outSystemTime, inTimeT) \
-    TIME_BEGIN_MACRO \
-        FILETIME conversion9; \
-        \
-        time_t_2_FILETIME(conversion9, inTimeT); \
-        FileTimeToSystemTime(&conversion9, &outSystemTime); \
-    TIME_END_MACRO
-#define time_t_2_LOCALSYSTEMTIME(outSystemTime, inTimeT) \
-    TIME_BEGIN_MACRO \
-        FILETIME conversion10; \
-        FILETIME localConversion10; \
-        \
-        time_t_2_FILETIME(conversion10, inTimeT); \
-        FileTimeToLocalFileTime(&conversion10, &localConversion10); \
-        FileTimeToSystemTime(&localConversion10, &outSystemTime); \
-    TIME_END_MACRO
-
-
-
-#endif /* __time_conversions_h */
-
deleted file mode 100644
--- a/build/wince/tools/Makefile
+++ /dev/null
@@ -1,145 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is Mozilla CE Shunt Library.
-#
-# The Initial Developer of the Original Code is Mozilla Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2008
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#	John Wolfe (wolfe@lobo.us)
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either of the GNU General Public License Version 2 or later (the "GPL"),
-# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-# this file is used directly during configure as well as included from Makefile.in
-
-DEVENV_FLAG=-
-
-CC=cl -O2
-
-MOZCE_DEVENV=vs$(MOZ_MSVCVERSION)
-
-MOZCE_TOOLS_DIR=$(TOPSRCDIR)/build/wince/tools
-
-ifdef MOZCE_NOT_CONFIGURE
-MOZCE_TOOLS_BIN_DIR=$(OBJDIR)/build/wince/tools
-else
-# if we're building the tools in configure, we want them to go directly to the sdk 
-# so they get rebuilt once we have a full environment
-MOZCE_TOOLS_BIN_DIR=$(OBJDIR)/dist/sdk/bin
-endif
-
-BUILD_SWITCH=$(DEVENV_FLAG)Build
-REBUILD_SWITCH=$(DEVENV_FLAG)Rebuild
-CLEAN_SWITCH=$(DEVENV_FLAG)clean
-
-ifeq ($(VCINSTALLDIR),)
-$(error Environment variable VCINSTALLDIR not set! Are you using MozillaBuild?)
-endif
-
-ifeq ($(WINCE_SDK_DIR),)
-$(error Environment variable WINCE_SDK_DIR not set! It must be passed to make if not running from configure)
-endif
-
-ifeq ($(MOZ_MSVCVERSION),)
-$(error Environment variable MOZ_MSVCVERSION not set! Are you using MozillaBuild?)
-endif
-
-CFLAGS += \
-  -DVC_PATH='"$(subst \,\\,$(VCINSTALLDIR))\\"' \
-  -DWM_SDK_PATH='"$(subst \,\\,$(WINCE_SDK_DIR))\\"' \
-  -DMOZCE_DEVENV='"$(MOZCE_DEVENV)"' \
-  -DTOPSRCDIR='"$(TOPSRCDIR)"' \
-  $(NULL)
-
-ifneq ($(WINDOWSSDKDIR),)
-CFLAGS += -DWIN_SDK_PATH='"$(subst \,\\,$(WINDOWSSDKDIR))"'
-else
-ifeq ($(SDKDIR),)
-$(error Environment variable WINDOWSSDKDIR not set! Are you using MozillaBuild?)
-else
-CFLAGS += -DWIN_SDK_PATH='"$(subst \,\\,$(SDKDIR))"'
-endif
-endif
-
-ifdef VPATH
-CFLAGS	+= -DSHUNT_INC='"$(OBJDIR)/dist/include/mozce_shunt"'
-CFLAGS	+= -DSHUNT_LIB='"$(OBJDIR)/dist/lib"'
-CFLAGS	+= -DJEMALLOC_LIB='"$(OBJDIR)/dist/lib/jemalloc.lib"'
-endif
-CFLAGS += -DEBUG -Zi
-
-SDK_TOOLS = $(MOZCE_TOOLS_BIN_DIR)/$(target)-as.exe \
-            $(MOZCE_TOOLS_BIN_DIR)/$(target)-gcc.exe \
-            $(MOZCE_TOOLS_BIN_DIR)/$(target)-lib.exe \
-            $(MOZCE_TOOLS_BIN_DIR)/$(target)-link.exe \
-            $(MOZCE_TOOLS_BIN_DIR)/$(target)-res.exe 
-
-all: libs export
-
-libs: $(SDK_TOOLS)
-
-clean: clobber
-
-
-clobber:
-	rm $(MOZCE_TOOLS_BIN_DIR)/*.exe  
-
-$(MOZCE_TOOLS_BIN_DIR)/linkargs.obj:	$(MOZCE_TOOLS_DIR)/linkargs.c $(MOZCE_TOOLS_DIR)/toolspath.h $(MOZCE_TOOLS_DIR)/Makefile
-	mkdir -p $(MOZCE_TOOLS_BIN_DIR);
-	$(CC) $(CFLAGS) -c -Fo$(MOZCE_TOOLS_BIN_DIR)/linkargs.obj $(MOZCE_TOOLS_DIR)/linkargs.c
-
-$(MOZCE_TOOLS_BIN_DIR)/toolspath.obj:	$(MOZCE_TOOLS_DIR)/toolspath.c $(MOZCE_TOOLS_DIR)/toolspath.h $(MOZCE_TOOLS_DIR)/Makefile
-	mkdir -p $(MOZCE_TOOLS_BIN_DIR);
-	$(CC) $(CFLAGS) -c -Fo$(MOZCE_TOOLS_BIN_DIR)/toolspath.obj $(MOZCE_TOOLS_DIR)/toolspath.c
-
-$(MOZCE_TOOLS_BIN_DIR)/$(target)-as.exe:	$(MOZCE_TOOLS_DIR)/arm-wince-as.c $(MOZCE_TOOLS_DIR)/toolspath.h $(MOZCE_TOOLS_DIR)/Makefile $(MOZCE_TOOLS_BIN_DIR)/toolspath.obj
-	mkdir -p $(MOZCE_TOOLS_BIN_DIR);
-	$(CC) $(CFLAGS) -Fo$(MOZCE_TOOLS_BIN_DIR) -Fe$@ $(MOZCE_TOOLS_DIR)/arm-wince-as.c -link $(MOZCE_TOOLS_BIN_DIR)/toolspath.obj
-
-$(MOZCE_TOOLS_BIN_DIR)/$(target)-gcc.exe:	$(MOZCE_TOOLS_DIR)/arm-wince-gcc.c $(MOZCE_TOOLS_DIR)/toolspath.h $(MOZCE_TOOLS_DIR)/Makefile $(MOZCE_TOOLS_BIN_DIR)/linkargs.obj $(MOZCE_TOOLS_BIN_DIR)/toolspath.obj
-	mkdir -p $(MOZCE_TOOLS_BIN_DIR);
-	$(CC) $(CFLAGS) -Fo$(MOZCE_TOOLS_BIN_DIR) -Fe$@ $(MOZCE_TOOLS_DIR)/arm-wince-gcc.c -link $(MOZCE_TOOLS_BIN_DIR)/linkargs.obj $(MOZCE_TOOLS_BIN_DIR)/toolspath.obj
-
-$(MOZCE_TOOLS_BIN_DIR)/$(target)-lib.exe:	$(MOZCE_TOOLS_DIR)/arm-wince-lib.c $(MOZCE_TOOLS_DIR)/toolspath.h $(MOZCE_TOOLS_DIR)/Makefile $(MOZCE_TOOLS_BIN_DIR)/toolspath.obj
-	mkdir -p $(MOZCE_TOOLS_BIN_DIR);
-	$(CC) $(CFLAGS) -Fo$(MOZCE_TOOLS_BIN_DIR) -Fe$@ $(MOZCE_TOOLS_DIR)/arm-wince-lib.c -link $(MOZCE_TOOLS_BIN_DIR)/toolspath.obj
-
-$(MOZCE_TOOLS_BIN_DIR)/$(target)-link.exe:	$(MOZCE_TOOLS_DIR)/arm-wince-link.c $(MOZCE_TOOLS_DIR)/toolspath.h $(MOZCE_TOOLS_DIR)/Makefile $(MOZCE_TOOLS_BIN_DIR)/linkargs.obj $(MOZCE_TOOLS_BIN_DIR)/toolspath.obj
-	mkdir -p $(MOZCE_TOOLS_BIN_DIR);
-	$(CC) $(CFLAGS) -Fo$(MOZCE_TOOLS_BIN_DIR) -Fe$@ $(MOZCE_TOOLS_DIR)/arm-wince-link.c -link $(MOZCE_TOOLS_BIN_DIR)/linkargs.obj $(MOZCE_TOOLS_BIN_DIR)/toolspath.obj
-
-$(MOZCE_TOOLS_BIN_DIR)/$(target)-res.exe:	$(MOZCE_TOOLS_DIR)/arm-wince-res.c $(MOZCE_TOOLS_DIR)/toolspath.h $(MOZCE_TOOLS_DIR)/Makefile $(MOZCE_TOOLS_BIN_DIR)/toolspath.obj
-	mkdir -p $(MOZCE_TOOLS_BIN_DIR);
-	$(CC) $(CFLAGS) -Fo$(MOZCE_TOOLS_BIN_DIR) -Fe$@ $(MOZCE_TOOLS_DIR)/arm-wince-res.c -link $(MOZCE_TOOLS_BIN_DIR)/toolspath.obj
-
-
-export:: $(SDK_TOOLS)
-ifdef MOZCE_NOT_CONFIGURE
-	mkdir -p $(OBJDIR)/dist/sdk/bin
-	cp $^ $(OBJDIR)/dist/sdk/bin
-endif
deleted file mode 100644
--- a/build/wince/tools/Makefile.in
+++ /dev/null
@@ -1,62 +0,0 @@
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is Mozilla core build scripts.
-#
-# The Initial Developer of the Original Code is
-# Brad Lassey <blassey@mozilla.com>
-#
-# Portions created by the Initial Developer are Copyright (C) 2005
-# the Mozilla Foundation <http://www.mozilla.org/>. All Rights Reserved.
-#
-# Contributor(s): 
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH = ../../..
-topsrcdir = @top_srcdir@
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-
-TOPSRCDIR = $(topsrcdir)
-OBJDIR = $(shell cd $(DEPTH); pwd -W)
-CFLAGS += -DHAVE_SHUNT
-MOZCE_NOT_CONFIGURE=1
-include $(DEPTH)/config/autoconf.mk
-
-ifdef MOZ_MEMORY
-CFLAGS += -DMOZ_MEMORY
-endif
-
-include $(topsrcdir)/build/wince/tools/Makefile
-
-export::
-
-tools::
-
-check::
-
-.NOTPARALLEL:
deleted file mode 100644
--- a/build/wince/tools/arm-wince-as.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "toolspath.h"
-
-int 
-main(int argc, char **argv)
-{  
-  char* args[1000];
-  int i = 0;
-  
-  args[i++] = ASM_PATH;
-
-  // armasm.exe requires a space between -I and the path. See bug 508721
-  args[i++] = "-I \"" WCE_INC "\""; 
-
-  i += argpath_conv(&argv[1], &args[i]);
-
-  return run(args);
-}
deleted file mode 100644
--- a/build/wince/tools/arm-wince-gcc.c
+++ /dev/null
@@ -1,93 +0,0 @@
-#include "toolspath.h"
-#include "linkargs.h"
-
-int
-main(int argc, char **argv)
-{
-  int startOfArgvs;
-  int i = 0;
-  int j = 0;
-  int link = 0;
-  int s = 0;
-  int k = 0;
-
-  char* args[1000];
-  char  outputFileArg[1000];
-
-  args[i++] = CL_PATH;
-
-#ifdef HAVE_SHUNT   // simple test to see if we're in configure or not
-  if(!getenv("NO_SHUNT")) {
-    args[i++] = "/I\"" SHUNT_INC "\"";
-    args[i++] = "/FI\"mozce_shunt.h\"";
-  }
-#endif
-#ifdef MOZ_MEMORY
-  args[i++] = "/DMOZ_MEMORY";
-#endif
-  args[i++] = "/I\"" ATL_INC "\"";
-  args[i++] = "/DMOZCE_STATIC_BUILD";
-  args[i++] = "/DUNICODE";
-  args[i++] = "/D_UNICODE_";
-  args[i++] = "/DARM";
-  args[i++] = "/D_ARM_";
-  args[i++] = "/DWINCE";
-  args[i++] = "/D_WIN32_WCE=0x502";
-  args[i++] = "/DUNDER_CE";
-//  args[i++] = "/DWIN32_PLATFORM_WFSP";
-  args[i++] = "/DWIN32_PLATFORM_PSPC";
-//  args[i++] = "/DPOCKETPC2003_UI_MODEL";
-  args[i++] = "/D_WINDOWS";
-  args[i++] = "/DNO_ERRNO";
-  args[i++] = "/D_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA";
-
-  args[i++] = "/GS-";                  // disable security checks
-  args[i++] = "/GR-";                  // disable C++ RTTI
-
-  startOfArgvs = i;
-
-  i += argpath_conv(&argv[1], &args[i]);
-
-  // if /Fe is passed, then link
-  //
-  // if -o is passed, then blank out this argument, and place a "/Fo"
-  // before the next argument
-  while(argv[j])
-    {
-      if (strncmp(argv[j], "-o", 2) == 0)
-	{
-	  printf("%s is -o\n",argv[j]);
-
-
-	  link = strstr(args[startOfArgvs+j], ".obj") ? 0:1;
-
-
-	  // If we are outputting a .OBJ file, then we are
-	  // NOT linking, and we need to do some fancy
-	  // footwork to output "/FoFILENAME" as an argument
-	  args[startOfArgvs+j-1] = "";
-	  strcpy(outputFileArg, ( strstr(args[startOfArgvs+j], ".exe") )?"/Fe":"/Fo");
-	  strcat(outputFileArg, args[startOfArgvs+j]);
-	  args[startOfArgvs+j] = outputFileArg;
-	}
-      if (strcmp(argv[j], "-link") ||
-	  strcmp(argv[j], "-LINK") ||
-	  strcmp(argv[j], "/link") ||
-	  strcmp(argv[j], "/LINK")) 
-	link = 1;
-	  
-      checkLinkArgs(&k, &s, &i, &j, args, argv);
-      j++;
-    }
-
-  if (link)
-    {
-      args[i++] = "/link";
-      addLinkArgs(k, s, &i, &j, args, argv);
-    }
-
-  args[i] = NULL;
-
-  //  dumpargs(args);
-  return run(args);
-}
deleted file mode 100644
--- a/build/wince/tools/arm-wince-lib.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "toolspath.h"
-
-
-int 
-main(int argc, char **argv)
-{
-  char* args[1000];
-  int i = 0;
-
-  args[i++] = LIB_PATH;
-
-  argpath_conv(&argv[1], &args[i]);
-
-  return run(args);
-
-}
deleted file mode 100644
--- a/build/wince/tools/arm-wince-link.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "toolspath.h"
-#include "linkargs.h"
-
-int
-main(int argc, char **argv)
-{
-  int iRetVal;
-  char* args[1000];
-  int i = 0;
-  int j = 0;
-  int k = 0;
-  int s = 0;
-
-  // if -DLL is not passed, then change the entry to 'main'
-  while(argv[j]) {
-    checkLinkArgs(&k, &s, &i, &j, args, argv);
-    j++;
-  }
-  args[i++] = LINK_PATH;
-  addLinkArgs(k, s, &i, &j, args, argv);
-
-  argpath_conv(&argv[1], &args[i]);
-
-  return run(args);
-}
-
deleted file mode 100644
--- a/build/wince/tools/arm-wince-res.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "toolspath.h"
-
-int
-main(int argc, char **argv)
-{
-  int iRetVal;
-  char* args[1000];
-  int i = 0;
-  int j = 0;
-  int k = 0;
-  int s = 0;
-  args[i++] = RC_PATH;
-  args[i++] = "/I\"" WCE_RC_INC "\"";
-  args[i++] = "/I\"" WM_SDK_INC "\"";
-
-  argpath_conv(&argv[1], &args[i]);
-
-  //dumpargs(args);
-
-  return run(args);
-}
deleted file mode 100644
--- a/build/wince/tools/linkargs.c
+++ /dev/null
@@ -1,56 +0,0 @@
-#include "toolspath.h"
-#include "linkargs.h"
-
-void checkLinkArgs(int* k, int* s, int* i, int* j, char** args, char** argv) {
-      if (strncmp(argv[*j], "-DLL", 4) == 0 ||
-	  strncmp(argv[*j], "/DLL", 4) == 0) {
-	*k = 1;
-      }
-      if (strncmp(argv[*j], "-entry", 6) == 0 ||
-	  strncmp(argv[*j], "/entry", 6) == 0 ||
-	  strncmp(argv[*j], "-ENTRY", 6) == 0 ||
-	  strncmp(argv[*j], "/ENTRY",6 ) == 0) {
-	*k = 1;
-      }
-      if (strncmp(argv[*j], "-subsystem:", 11) == 0 ||
-	  strncmp(argv[*j], "/subsystem:", 11) == 0 ||
-	  strncmp(argv[*j], "-SUBSYSTEM:", 11) == 0 ||
-	  strncmp(argv[*j], "/SUBSYSTEM:", 11) == 0) {
-	*s = 1;
-      }
-}
-
-void addLinkArgs(int k, int s, int *i, int *j, char** args, char** argv) {
-  args[(*i)++] = "/LIBPATH:\"" WCE_LIB "\"";
-  args[(*i)++] = "/LIBPATH:\"" WCE_CRT "\"";
-  args[(*i)++] = "/LIBPATH:\"" ATL_LIB "\"";
-  args[(*i)++] = "/NODEFAULTLIB";
-
-  args[(*i)++] = "/MAP";
-  args[(*i)++] = "/MAPINFO:EXPORTS";
-
-  if (getenv("LOCK_DLLS") != NULL) {
-    // lock our dlls in memory
-    args[(*i)++] = "/SECTION:.text,\!P";
-    args[(*i)++] = "/SECTION:.rdata,\!P";
-  }
-
-#ifdef HAVE_SHUNT   // simple test to see if we're in configure or not
-  if(getenv("NO_SHUNT") == NULL) {
-    args[(*i)++] = "/LIBPATH:\"" SHUNT_LIB "\"";
-    args[(*i)++] = "mozce_shunt.lib";
-  }
-#endif
-
-  args[(*i)++] = "corelibc.lib";
-  args[(*i)++] = "coredll.lib";
-  args[(*i)++] = "ceshell.lib";
-  args[(*i)++] = "mmtimer.lib";
-
-  if (k==0)
-    args[(*i)++] = "/ENTRY:mainACRTStartup";
-
-  if (s==0){
-    args[(*i)++] = "/subsystem:\"WINDOWSCE,5.02\"";
-  }
-}
deleted file mode 100644
--- a/build/wince/tools/linkargs.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef LINKARGS_H
-#define LINKARGS_H
-
-void checkLinkArgs(int* k, int* s, int* i, int* j, char** args, char** argv);
-void addLinkArgs(int k, int s, int *i, int *j, char** args, char** argv);
-
-#endif
deleted file mode 100644
--- a/build/wince/tools/toolspath.c
+++ /dev/null
@@ -1,252 +0,0 @@
-#include "toolspath.h"
-int argpath_conv(char **args_in, char **args_out)
-{
-  int i = 0;
-
-  while (args_in[i])
-  {
-    char *offset;
-
-    args_out[i] = args_in[i];
-
-    if (args_in[i])
-    {
-      // First, look for the case of "Fo" and "Fe" options
-      if ( (args_out[i][0] == '-' || args_out[i][0] == '/') &&
-           (args_out[i][1] == 'F') && ((args_out[i][2] == 'o') || (args_out[i][2] == 'e')) &&
-           (args_out[i][3] == '/') && (strlen(args_out[i]) > 5) ) {
-
-        strcpy(noleak_buffers[next_buffer], args_in[i]);
-
-        noleak_buffers[next_buffer][0] = '/';
-        noleak_buffers[next_buffer][3] = noleak_buffers[next_buffer][4];
-        noleak_buffers[next_buffer][4] = ':';
-
-        args_out[i] = noleak_buffers[next_buffer];
-
-        next_buffer++;
-      }
-      else if ((args_out[i][0] == '/') && (args_out[i][2] == '/'))
-      {
-        // Assume this is a pathname, and adjust accordingly
-        //printf("ARGS_IN: PATHNAME ASSUMED: %s\n", args_in[i]);
-
-        strcpy(noleak_buffers[next_buffer], args_in[i]);
-
-        noleak_buffers[next_buffer][0] = noleak_buffers[next_buffer][1];
-        noleak_buffers[next_buffer][1] = ':';
-
-        args_out[i] = noleak_buffers[next_buffer];
-        //printf("ARGS_OUT: PATHNAME MODIFIED TO BE: %s\n", args_out[i]);
-
-        next_buffer++;
-      }
-      else if ((args_out[i][0] == '\\') && (args_out[i][2] == '\\'))
-      {
-        // Assume this is a pathname, and adjust accordingly
-        //printf("ARGS_IN: PATHNAME ASSUMED: %s\n", args_in[i]);
-
-        strcpy(noleak_buffers[next_buffer], args_in[i]);
-
-        noleak_buffers[next_buffer][0] = noleak_buffers[next_buffer][1];
-        noleak_buffers[next_buffer][1] = ':';
-
-        args_out[i] = noleak_buffers[next_buffer];
-        //printf("ARGS_OUT: PATHNAME MODIFIED TO BE: %s\n", args_out[i]);
-
-        next_buffer++;
-      }
-      else if ((args_out[i][0] == '\\') && (args_out[i][1] == '\\') &&
-               (args_out[i][3] == '\\') && (args_out[i][4] == '\\'))
-      {
-        // Assume this is a pathname, and adjust accordingly
-        //printf("ARGS_IN: PATHNAME ASSUMED: %s\n", args_in[i]);
-
-        noleak_buffers[next_buffer][0] = args_in[i][2];
-        noleak_buffers[next_buffer][1] = ':';
-        noleak_buffers[next_buffer][2] = '\0';
-
-        strcpy(noleak_buffers[next_buffer], &args_in[i][3]);
-
-        args_out[i] = noleak_buffers[next_buffer];
-        //printf("ARGS_OUT: PATHNAME MODIFIED TO BE: %s\n", args_out[i]);
-
-        next_buffer++;
-      }
-      else if ( strstr(args_out[i], "OUT:") || strstr(args_out[i], "DEF:") )
-      {
-        // Deal with -OUT:/c/....
-        //
-        // NOTE: THERE IS A BUG IN THIS IMPLEMENTATION IF 
-        //       THERE IS A SPACE IN THE TOPSRCDIR PATH.
-        //
-        // Should really check for spaces, then double-quote
-        // the path if any space is found.
-        // -- wolfe@lobo.us  25-Aug-08
-        if ((args_out[i][5] == '/') && (args_out[i][7] == '/'))
-        {
-          // Assume this is a pathname, and adjust accordingly
-          //printf("ARGS_IN: PATHNAME ASSUMED: %s\n", args_in[i]);
-
-          strcpy(noleak_buffers[next_buffer], args_in[i]);
-
-          noleak_buffers[next_buffer][5] = noleak_buffers[next_buffer][6];
-          noleak_buffers[next_buffer][6] = ':';
-
-          args_out[i] = noleak_buffers[next_buffer];
-          //printf("ARGS_OUT: PATHNAME MODIFIED TO BE: %s\n", args_out[i]);
-        }
-        // Deal with -OUT:"/c/...."
-        else if ((args_out[i][6] == '/') && (args_out[i][8] == '/'))
-        {
-          // Assume this is a pathname, and adjust accordingly
-          //printf("ARGS_IN: PATHNAME ASSUMED: %s\n", args_in[i]);
-
-          strcpy(noleak_buffers[next_buffer], args_in[i]);
-
-          noleak_buffers[next_buffer][6] = noleak_buffers[next_buffer][7];
-          noleak_buffers[next_buffer][7] = ':';
-
-          args_out[i] = noleak_buffers[next_buffer];
-          //printf("ARGS_OUT: PATHNAME MODIFIED TO BE: %s\n", args_out[i]);
-        }
-
-        next_buffer++;
-      }
-      else
-      {
-        char *offset = strstr(args_out[i], "/cygdrive/");
-
-        if (offset) {
-
-          strcpy(offset, offset+9);
-          offset[0] = offset[1];
-          offset[1] = ':';
-          offset[2] = '/';
-        }
-
-        if ( (args_out[i][0] == '-' || args_out[i][0] == '/') &&
-             (args_out[i][1] == 'D'))
-        {
-
-          offset = strstr(args_out[i]+2, "=");
-          if (offset)
-          {
-            char* equalsChar = offset;
-
-            if (equalsChar[1] == '"')
-            {
-              *equalsChar = '\0';
-
-              strcpy(noleak_buffers[next_buffer], args_out[i]);
-
-              *equalsChar = '=';
-
-              strcat(noleak_buffers[next_buffer], "=\\\"");
-              strcat(noleak_buffers[next_buffer], equalsChar+1);
-              strcat(noleak_buffers[next_buffer], "\\\"");
-
-              args_out[i] = noleak_buffers[next_buffer];
-
-              next_buffer++;
-            }
-          }
-        }
-      }
-
-      if (next_buffer > MAX_NOLEAK_BUFFERS) {
-        printf("OOPS - next_buffer > MAX_NOLEAK_BUFFERS\n");
-        exit(-1);
-      }
-    }
-    i++;
-  }
-  args_out[i] = NULL;
-  return i;
-}
-
-void dumpargs(char** args)
-{
- int i = 0;
-
- if (args[0] == NULL)
-   printf(":: first element is null!\n");
-
- while(args[i])
-   printf("%s ", args[i++]);
-
- printf("\n");
- fflush(stdout);
- fflush(stderr);
-}
-
-
-DWORD run(char** args)
-{
-
- DWORD exitCode;
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
-
- char theCmdLine[1024*32] = {'\0'};
-
- int totalLen = 0;
- int i, j;
-
-
- // Clear any link env variable that might get us tangled up
- _putenv("LINK=");
- _putenv("LIBPATH=");
- _putenv("CC=");
-
- _putenv("INCLUDE=" SHUNT_INC ";" WM_SDK_INC ";" WCE_INC);
- _putenv("LIB=" WCE_LIB ";" WCE_CRT);
-
- i = strlen(args[0]);
- for (j=0; j<i; j++)
- {
-   if (args[0][j] == '/')
-     args[0][j] = '\\';
- }
-
- for (j=0; args[j]; j++)
- {
-   int len = strlen(args[j]);
-   strcat(&theCmdLine[totalLen], args[j]);
-   totalLen += len;
-
-   strcat(&theCmdLine[totalLen], " ");
-   totalLen++;
- }
-
- ZeroMemory( &si, sizeof(si) );
- si.cb = sizeof(si);
- ZeroMemory( &pi, sizeof(pi));
-
- // See bug 508721.
- // lpApplicationName (first parameter) when provided conflicts with
- // the first token in the lpCommandLine (second parameter).
- // So we pass the whole command line including the EXE in lpCommandLine.
- // See http://support.microsoft.com/kb/175986 for more info.
- CreateProcess(NULL,
-               theCmdLine,
-               NULL,
-               NULL,
-               0,
-               0,
-               NULL,
-               NULL,
-               &si,              // Pointer to STARTUPINFO structure.
-               &pi);
-
-
- // Wait until child process exits.
- WaitForSingleObject( pi.hProcess, INFINITE );
- GetExitCodeProcess(pi.hProcess, &exitCode);
- // Close process and thread handles.
- CloseHandle( pi.hProcess );
- CloseHandle( pi.hThread );
-
- return exitCode;
-}
-
deleted file mode 100644
--- a/build/wince/tools/toolspath.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef TOOLPATH_H
-#define TOOLPATH_H
-
-#include <windows.h>
-#include <stdio.h>
-#include <process.h>
-
-#define WCE_BIN    VC_PATH "ce\\bin\\x86_arm\\"
-#define WCE_RC_BIN WIN_SDK_PATH  "bin\\"
-#define WCE_CRT    VC_PATH "ce\\lib\\armv4i"
-#define WM_SDK_INC    WM_SDK_PATH "Include/Armv4i"
-#define WCE_LIB    WM_SDK_PATH "Lib/Armv4i"
-#define WCE_RC_INC  VC_PATH "ce\\atlmfc\\include"
-#define WCE_INC  VC_PATH "ce\\include"
-#define ATL_INC  VC_PATH "ce\\atlmfc\\include"
-#define ATL_LIB  VC_PATH "ce\\atlmfc\\lib\\armv4i"
-
-#ifndef SHUNT_LIB
-#define SHUNT_LIB ""
-#endif
-
-#ifndef SHUNT_INC
-#define SHUNT_INC TOPSRCDIR "/build/wince/shunt/include/"
-#endif
-
-#define ASM_PATH  "\"" WCE_BIN "armasm.exe\""
-#define CL_PATH   "\"" WCE_BIN "cl.exe\""
-#define LIB_PATH  "\"" WCE_BIN "lib.exe\""
-#define LINK_PATH "\"" WCE_BIN "link.exe\""
-#define RC_PATH   "\"" WCE_RC_BIN "rc.exe\""
-
-#define MAX_NOLEAK_BUFFERS 1000
-char noleak_buffers[MAX_NOLEAK_BUFFERS][1024];
-static int next_buffer = 0;
-int argpath_conv(char **args_in, char **args_out);
-void dumpargs(char** args);
-DWORD run(char** args);
-
-#endif
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -650,20 +650,16 @@ DLLFLAGS = @DLLFLAGS@
 endif
 endif
 
 # Codesighs tools option, enables win32 mapfiles.
 MOZ_MAPINFO	= @MOZ_MAPINFO@
 
 MOZ_PHOENIX	= @MOZ_PHOENIX@
 MOZ_XULRUNNER	= @MOZ_XULRUNNER@
-WINCE		= @WINCE@
-WINCE_SDK_DIR   = @WINCE_SDK_DIR@
-
-WINCE_WINDOWS_MOBILE = @WINCE_WINDOWS_MOBILE@
 
 MOZ_DISTRIBUTION_ID = @MOZ_DISTRIBUTION_ID@
 
 MOZ_PLATFORM_MAEMO = @MOZ_PLATFORM_MAEMO@
 MOZ_PLATFORM_MAEMO_CFLAGS	= @MOZ_PLATFORM_MAEMO_CFLAGS@
 MOZ_PLATFORM_MAEMO_LIBS 	= @MOZ_PLATFORM_MAEMO_LIBS@
 MOZ_MAEMO_LIBLOCATION 	= @MOZ_MAEMO_LIBLOCATION@
 
@@ -707,19 +703,19 @@ ANDROID_SDK       = @ANDROID_SDK@
 ANDROID_PLATFORM_TOOLS = @ANDROID_PLATFORM_TOOLS@
 ANDROID_VERSION   = @ANDROID_VERSION@
 
 ANDROID_PACKAGE_NAME = @ANDROID_PACKAGE_NAME@
 
 JS_SHARED_LIBRARY = @JS_SHARED_LIBRARY@
 
 # We only want to do the pymake sanity on Windows, other os's can cope
-ifeq (,$(filter-out WINNT WINCE,$(HOST_OS_ARCH)))
+ifeq ($(HOST_OS_ARCH),WINNT)
 # Ensure invariants between GNU Make and pymake
 # Checked here since we want the sane error in a file that
 # actually can be found regardless of path-style.
 ifeq (_:,$(.PYMAKE)_$(findstring :,$(srcdir)))
 $(error Windows-style srcdir being used with GNU make. Did you mean to run $(topsrcdir)/build/pymake/make.py instead? [see-also: https://developer.mozilla.org/en/Gmake_vs._Pymake])
 endif
 ifeq (1_a,$(.PYMAKE)_$(firstword a$(subst /, ,$(srcdir))))
 $(error MSYS-style srcdir being used with Pymake. Did you mean to run GNU Make instead? [see-also: https://developer.mozilla.org/en/Gmake_vs._Pymake])
 endif
-endif # Windows
+endif # WINNT
--- a/config/config.mk
+++ b/config/config.mk
@@ -142,17 +142,17 @@ OS_CONFIG	:= $(OS_ARCH)$(OS_RELEASE)
 FINAL_LINK_LIBS = $(DEPTH)/config/final-link-libs
 FINAL_LINK_COMPS = $(DEPTH)/config/final-link-comps
 FINAL_LINK_COMP_NAMES = $(DEPTH)/config/final-link-comp-names
 
 MOZ_UNICHARUTIL_LIBS = $(LIBXUL_DIST)/lib/$(LIB_PREFIX)unicharutil_s.$(LIB_SUFFIX)
 MOZ_WIDGET_SUPPORT_LIBS    = $(DIST)/lib/$(LIB_PREFIX)widgetsupport_s.$(LIB_SUFFIX)
 
 ifdef MOZ_MEMORY
-ifneq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
+ifneq ($(OS_ARCH),WINNT)
 JEMALLOC_LIBS = $(MKSHLIB_FORCE_ALL) $(call EXPAND_MOZLIBNAME,jemalloc) $(MKSHLIB_UNFORCE_ALL)
 # If we are linking jemalloc into a program, we want the jemalloc symbols
 # to be exported
 ifneq (,$(SIMPLE_PROGRAMS)$(PROGRAM))
 JEMALLOC_LIBS += $(MOZ_JEMALLOC_STANDALONE_GLUE_LDOPTS)
 endif
 endif
 endif
@@ -393,17 +393,17 @@ ifndef JS_SHARED_LIBRARY
 DEFINES += -DSTATIC_EXPORTABLE_JS_API
 endif
 endif
 endif
 
 # Force _all_ exported methods to be |_declspec(dllexport)| when we're
 # building them into the executable.
 
-ifeq (,$(filter-out WINNT WINCE OS2, $(OS_ARCH)))
+ifeq (,$(filter-out WINNT OS2, $(OS_ARCH)))
 ifdef BUILD_STATIC_LIBS
 DEFINES += \
         -D_IMPL_NS_GFX \
         -D_IMPL_NS_MSG_BASE \
         -D_IMPL_NS_WIDGET \
         $(NULL)
 endif
 endif
@@ -584,23 +584,21 @@ endif
 #
 # Override defaults
 
 # We need to know where to find the libraries we
 # put on the link line for binaries, and should
 # we link statically or dynamic?  Assuming dynamic for now.
 
 ifneq (WINNT_,$(OS_ARCH)_$(GNU_CC))
-ifneq (,$(filter-out WINCE,$(OS_ARCH)))
 LIBS_DIR	= -L$(DIST)/bin -L$(DIST)/lib
 ifdef LIBXUL_SDK
 LIBS_DIR	+= -L$(LIBXUL_SDK)/bin -L$(LIBXUL_SDK)/lib
 endif
 endif
-endif
 
 # Default location of include files
 IDL_DIR		= $(DIST)/idl
 
 XPIDL_FLAGS = -I$(srcdir) -I$(IDL_DIR)
 ifdef LIBXUL_SDK
 XPIDL_FLAGS += -I$(LIBXUL_SDK)/idl
 endif
@@ -800,27 +798,23 @@ MERGE_FILE = $(firstword \
   $(wildcard $(LOCALE_MERGEDIR)/$(subst /locales,,$(relativesrcdir))/$(1)) \
   $(wildcard $(LOCALE_SRCDIR)/$(1)) \
   $(srcdir)/en-US/$(1) )
 else
 MERGE_FILE = $(LOCALE_SRCDIR)/$(1)
 endif
 MERGE_FILES = $(foreach f,$(1),$(call MERGE_FILE,$(f)))
 
-ifdef WINCE
-RUN_TEST_PROGRAM = $(PYTHON) $(topsrcdir)/build/mobile/devicemanager-run-test.py
-else
 ifeq (OS2,$(OS_ARCH))
 RUN_TEST_PROGRAM = $(topsrcdir)/build/os2/test_os2.cmd "$(DIST)"
 else
 ifneq (WINNT,$(OS_ARCH))
 RUN_TEST_PROGRAM = $(DIST)/bin/run-mozilla.sh
 endif # ! WINNT
 endif # ! OS2
-endif # ! WINCE
 
 #
 # Java macros
 #
 
 # Make sure any compiled classes work with at least JVM 1.4
 JAVAC_FLAGS += -source 1.4
 
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -77,17 +77,17 @@ endif
 
 # ELOG prints out failed command when building silently (gmake -s).
 ifneq (,$(findstring s, $(filter-out --%, $(MAKEFLAGS))))
   ELOG := $(EXEC) sh $(BUILD_TOOLS)/print-failed-commands.sh
 else
   ELOG :=
 endif
 
-ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
+ifeq ($(OS_ARCH),WINNT)
 _VPATH_SRCS = $(abspath $<)
 else
 _VPATH_SRCS = $<
 endif
 
 # Add $(DIST)/lib to VPATH so that -lfoo dependencies are followed
 VPATH += $(DIST)/lib
 ifdef LIBXUL_SDK
@@ -241,17 +241,17 @@ endif
 ifdef LIBRARY
 ifneq (_1,$(FORCE_SHARED_LIB)_$(BUILD_STATIC_LIBS))
 ifdef MKSHLIB
 
 ifdef LIB_IS_C_ONLY
 MKSHLIB			= $(MKCSHLIB)
 endif
 
-ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
+ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
 IMPORT_LIBRARY		:= $(LIB_PREFIX)$(SHARED_LIBRARY_NAME).$(IMPORT_LIB_SUFFIX)
 endif
 
 ifeq (OS2,$(OS_ARCH))
 ifdef SHORT_LIBNAME
 SHARED_LIBRARY_NAME	:= $(SHORT_LIBNAME)
 endif
 endif
@@ -297,17 +297,17 @@ ifndef FORCE_STATIC_LIB
 LIBRARY			:= $(NULL)
 endif
 endif
 
 ifdef JAVA_LIBRARY_NAME
 JAVA_LIBRARY := $(JAVA_LIBRARY_NAME).jar
 endif
 
-ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
+ifeq ($(OS_ARCH),WINNT)
 ifndef GNU_CC
 
 #
 # Unless we're building SIMPLE_PROGRAMS, all C++ files share a PDB file per
 # directory. For parallel builds, this PDB file is shared and locked by
 # MSPDBSRV.EXE, starting with MSVC8 SP1. If you're using MSVC 7.1 or MSVC8
 # without SP1, don't do parallel builds.
 #
@@ -352,17 +352,17 @@ endif # ENABLE_CXX_EXCEPTIONS
 endif # WINNT
 
 ifeq ($(SOLARIS_SUNPRO_CXX),1)
 ifeq (86,$(findstring 86,$(OS_TEST)))
 OS_LDFLAGS += -M $(topsrcdir)/config/solaris_ia32.map
 endif # x86
 endif # Solaris Sun Studio C++
 
-ifeq (,$(filter-out WINNT WINCE,$(HOST_OS_ARCH)))
+ifeq ($(HOST_OS_ARCH),WINNT)
 HOST_PDBFILE=$(basename $(@F)).pdb
 endif
 
 # Don't build SIMPLE_PROGRAMS during the MOZ_PROFILE_GENERATE pass
 ifdef MOZ_PROFILE_GENERATE
 SIMPLE_PROGRAMS :=
 endif
 
@@ -661,32 +661,22 @@ IFLAGS1 = -m 644
 IFLAGS2 = -m 755
 endif
 
 ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
 OUTOPTION = -Fo# eol
 else
 OUTOPTION = -o # eol
 endif # WINNT && !GNU_CC
-ifneq (,$(filter WINCE,$(OS_ARCH)))
-OUTOPTION = -Fo# eol
-endif
-
-ifeq ($(OS_ARCH), WINCE)
-OUTOPTION = -Fo# eol
-HOST_OUTOPTION = -Fo# eol
-else
 
 ifeq (,$(CROSS_COMPILE))
 HOST_OUTOPTION = $(OUTOPTION)
 else
 HOST_OUTOPTION = -o # eol
 endif
-
-endif
 ################################################################################
 
 # SUBMAKEFILES: List of Makefiles for next level down.
 #   This is used to update or create the Makefiles before invoking them.
 SUBMAKEFILES += $(addsuffix /Makefile, $(DIRS) $(TOOL_DIRS) $(PARALLEL_DIRS))
 
 # The root makefile doesn't want to do a plain export/libs, because
 # of the tiers and because of libxul. Suppress the default rules in favor
@@ -860,17 +850,17 @@ ifdef SHARED_LIBRARY
 ifdef IS_COMPONENT
 	$(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET)/components
 	$(ELF_DYNSTR_GC) $(FINAL_TARGET)/components/$(SHARED_LIBRARY)
 ifndef NO_COMPONENTS_MANIFEST
 	@$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_TARGET)/chrome.manifest "manifest components/components.manifest"
 	@$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_TARGET)/components/components.manifest "binary-component $(SHARED_LIBRARY)"
 endif
 else # ! IS_COMPONENT
-ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
+ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
 	$(INSTALL) $(IFLAGS2) $(IMPORT_LIBRARY) $(DIST)/lib
 else
 	$(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(DIST)/lib
 endif
 	$(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET)
 endif # IS_COMPONENT
 endif # SHARED_LIBRARY
 ifdef PROGRAM
@@ -960,19 +950,16 @@ alltags:
 	find $(topsrcdir) -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' -o -name '*.idl' \) -print | $(TAG_PROGRAM)
 
 #
 # PROGRAM = Foo
 # creates OBJS, links with LIBS to create Foo
 #
 $(PROGRAM): $(PROGOBJS) $(LIBS_DEPS) $(EXTRA_DEPS) $(EXE_DEF_FILE) $(RESFILE) $(GLOBAL_DEPS)
 	@$(RM) $@.manifest
-ifeq (WINCE,$(OS_ARCH))
-	$(EXPAND_LD) -NOLOGO -OUT:$@ $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
-else
 ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
 	$(EXPAND_LD) -NOLOGO -OUT:$@ -PDB:$(LINK_PDBFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
 ifdef MSMANIFEST_TOOL
 	@if test -f $@.manifest; then \
 		if test -f "$(srcdir)/$@.manifest"; then \
 			echo "Embedding manifest from $(srcdir)/$@.manifest and $@.manifest"; \
 			mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" $@.manifest -OUTPUTRESOURCE:$@\;1; \
 		else \
@@ -992,29 +979,25 @@ endif
 else # !WINNT || GNU_CC
 ifeq ($(CPP_PROG_LINK),1)
 	$(EXPAND_CCC) -o $@ $(CXXFLAGS) $(WRAP_MALLOC_CFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) $(WRAP_MALLOC_LIB) $(EXE_DEF_FILE)
 	@$(call CHECK_STDCXX,$@)
 else # ! CPP_PROG_LINK
 	$(EXPAND_CC) -o $@ $(CFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) $(EXE_DEF_FILE)
 endif # CPP_PROG_LINK
 endif # WINNT && !GNU_CC
-endif # WINCE
 
 ifdef ENABLE_STRIP
 	$(STRIP) $@
 endif
 ifdef MOZ_POST_PROGRAM_COMMAND
 	$(MOZ_POST_PROGRAM_COMMAND) $@
 endif
 
 $(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
-ifeq (WINCE,$(OS_ARCH))
-	$(HOST_LD) -NOLOGO -OUT:$@ $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
-else
 ifeq (_WINNT,$(GNU_CC)_$(HOST_OS_ARCH))
 	$(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 ifdef MSMANIFEST_TOOL
 	@if test -f $@.manifest; then \
 		if test -f "$(srcdir)/$@.manifest"; then \
 			echo "Embedding manifest from $(srcdir)/$@.manifest and $@.manifest"; \
 			mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" $@.manifest -OUTPUTRESOURCE:$@\;1; \
 		else \
@@ -1028,69 +1011,60 @@ ifdef MSMANIFEST_TOOL
 endif	# MSVC with manifest tool
 else
 ifeq ($(HOST_CPP_PROG_LINK),1)
 	$(HOST_CXX) -o $@ $(HOST_CXXFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 else
 	$(HOST_CC) -o $@ $(HOST_CFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 endif # HOST_CPP_PROG_LINK
 endif
-endif
 
 #
 # This is an attempt to support generation of multiple binaries
 # in one directory, it assumes everything to compile Foo is in
 # Foo.o (from either Foo.c or Foo.cpp).
 #
 # SIMPLE_PROGRAMS = Foo Bar
 # creates Foo.o Bar.o, links with LIBS to create Foo, Bar.
 #
 $(SIMPLE_PROGRAMS): %$(BIN_SUFFIX): %.$(OBJ_SUFFIX) $(LIBS_DEPS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
-ifeq (WINCE,$(OS_ARCH))
-	$(EXPAND_LD) -nologo  -entry:mainACRTStartup -out:$@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
-else
 ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
 	$(EXPAND_LD) -nologo -out:$@ -pdb:$(LINK_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
 ifdef MSMANIFEST_TOOL
 	@if test -f $@.manifest; then \
 		mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
 		rm -f $@.manifest; \
 	fi
 endif	# MSVC with manifest tool
 else
 ifeq ($(CPP_PROG_LINK),1)
 	$(EXPAND_CCC) $(WRAP_MALLOC_CFLAGS) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(BIN_FLAGS)
 	@$(call CHECK_STDCXX,$@)
 else
 	$(EXPAND_CC) $(WRAP_MALLOC_CFLAGS) $(CFLAGS) $(OUTOPTION)$@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(BIN_FLAGS)
 endif # CPP_PROG_LINK
 endif # WINNT && !GNU_CC
-endif # WINCE
 
 ifdef ENABLE_STRIP
 	$(STRIP) $@
 endif
 ifdef MOZ_POST_PROGRAM_COMMAND
 	$(MOZ_POST_PROGRAM_COMMAND) $@
 endif
 
 $(HOST_SIMPLE_PROGRAMS): host_%$(HOST_BIN_SUFFIX): host_%.$(OBJ_SUFFIX) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
-ifeq (WINCE,$(OS_ARCH))
-	$(HOST_LD) -NOLOGO -OUT:$@ $(WIN32_EXE_LDFLAGS) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
-else
 ifeq (WINNT_,$(HOST_OS_ARCH)_$(GNU_CC))
 	$(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 else
 ifneq (,$(HOST_CPPSRCS)$(USE_HOST_CXX))
 	$(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_CXXFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 else
 	$(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_CFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 endif
 endif
-endif
 
 #
 # Purify target.  Solaris/sparc only to start.
 # Purify does not recognize "egcs" or "c++" so we go with 
 # "gcc" and "g++" for now.
 #
 pure:	$(PROGRAM)
 ifeq ($(CPP_PROG_LINK),1)
@@ -1119,17 +1093,17 @@ endif
 $(filter %.$(LIB_SUFFIX),$(LIBRARY)): $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS_DEPS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
 	$(RM) $(LIBRARY)
 	$(EXPAND_AR) $(AR_FLAGS) $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS)
 	$(RANLIB) $@
 
 $(filter-out %.$(LIB_SUFFIX),$(LIBRARY)): $(filter %.$(LIB_SUFFIX),$(LIBRARY)) $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS_DEPS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
 	$(EXPAND_LIBS_GEN) $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS) > $@
 
-ifeq (,$(filter-out WINNT WINCE, $(OS_ARCH)))
+ifeq ($(OS_ARCH),WINNT)
 $(IMPORT_LIBRARY): $(SHARED_LIBRARY)
 endif
 
 ifeq ($(OS_ARCH),OS2)
 $(DEF_FILE): $(OBJS) $(SHARED_LIBRARY_LIBS)
 	$(RM) $@
 	echo LIBRARY $(SHARED_LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@
 	echo PROTMODE >> $@
@@ -1377,29 +1351,29 @@ endif
 
 %: s.%
 
 %: SCCS/s.%
 
 ###############################################################################
 # Java rules
 ###############################################################################
-ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
+ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
 SEP := ;
 else
 SEP := :
 endif
 
 EMPTY :=
 SPACE := $(EMPTY) $(EMPTY)
 
 # MSYS has its own special path form, but javac expects the source and class
 # paths to be in the DOS form (i.e. e:/builds/...).  This function does the
 # appropriate conversion on Windows, but is a noop on other systems.
-ifeq (,$(filter-out WINNT WINCE, $(HOST_OS_ARCH)))
+ifeq ($(HOST_OS_ARCH),WINNT)
 #  We use 'pwd -W' to get DOS form of the path.  However, since the given path
 #  could be a file or a non-existent path, we cannot call 'pwd -W' directly
 #  on the path.  Instead, we extract the root path (i.e. "c:/"), call 'pwd -W'
 #  on it, then merge with the rest of the path.
 root-path = $(shell echo $(1) | sed -e "s|\(/[^/]*\)/\?\(.*\)|\1|")
 non-root-path = $(shell echo $(1) | sed -e "s|\(/[^/]*\)/\?\(.*\)|\2|")
 normalizepath = $(foreach p,$(1),$(if $(filter /%,$(1)),$(patsubst %/,%,$(shell cd $(call root-path,$(1)) && pwd -W))/$(call non-root-path,$(1)),$(1)))
 else
--- a/configure.in
+++ b/configure.in
@@ -352,57 +352,16 @@ dnl Set CROSS_COMPILE in the environment
 dnl to use the cross-compile setup for now
 dnl ========================================================
 
 dnl AR_FLAGS set here so HOST_AR_FLAGS can be set correctly (see bug 538269)
 AR_FLAGS='cr $@'
 
 if test "$COMPILE_ENVIRONMENT"; then
 
-dnl Do some special WinCE toolchain stuff
-case "$target" in
-*wince|*winmo)
-
-    MOZ_ARG_WITH_STRING(wince-sdk,
-    [  --with-wince-sdk=WINCE_SDK_DIR
-                          The path to the Windows CE SDK],
-    WINCE_SDK_DIR=$withval)
-
-    AC_DEFINE(WINCE)
-    
-    export WINCE=1
-
-    echo -----------------------------------------------------------------------------
-    echo Building Windows CE Shunt Library and Tool Chain
-    echo Using SDK in:
-    echo $WINCE_SDK_DIR
-
-    ac_exeext=.exe
-
-    _pwd=`pwd -W`
-    _topsrcdirwin=`cd \`dirname $0\`; pwd -W`
-    make WINCE_SDK_DIR="$WINCE_SDK_DIR" \
-         TOPSRCDIR="$_topsrcdirwin" OBJDIR="$_pwd" target="$target" \
-         -C $srcdir/build/wince/tools
-
-    CC="$_pwd/dist/sdk/bin/$target-gcc.exe"
-    CXX="$_pwd/dist/sdk/bin/$target-gcc.exe"
-    CPP="$_pwd/dist/sdk/bin/$target-gcc.exe -E -nologo"
-    CXXCPP="$_pwd/dist/sdk/bin/$target-gcc.exe -TP -E -nologo"
-    LD="$_pwd/dist/sdk/bin/$target-link.exe"
-    AR="$_pwd/dist/sdk/bin/$target-lib.exe"
-    AS="$_pwd/dist/sdk/bin/$target-as.exe"
-    RC="$_pwd/dist/sdk/bin/$target-res.exe"
-
-
-    echo -----------------------------------------------------------------------------
-
-    ;;
-esac
-
 if test -n "$CROSS_COMPILE" -a "$target" != "$host"; then
     echo "cross compiling from $host to $target"
     cross_compiling=yes
 
     _SAVE_CC="$CC"
     _SAVE_CFLAGS="$CFLAGS"
     _SAVE_LDFLAGS="$LDFLAGS"
 
@@ -562,29 +521,22 @@ if test "$GCC" = yes; then
 fi
 
 if test "$GXX" = yes; then
    if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
      INTEL_CXX=1
    fi
 fi
 
+dnl ========================================================
 dnl Special win32 checks
 dnl ========================================================
-case "$target" in
-*-wince|*-winmo)
-    WINVER=500
-    WINSDK_TARGETVER=502
-    ;;
-*)
-    WINVER=502
-    dnl Target the Windows 7 SDK by default
-    WINSDK_TARGETVER=601
-    ;;
-esac
+WINVER=502
+dnl Target the Windows 7 SDK by default
+WINSDK_TARGETVER=601
 
 MOZ_ARG_WITH_STRING(windows-version,
 [  --with-windows-version=WINSDK_TARGETVER
                           Highest Windows version to target using this SDK
                               502: Windows Server 2003
                               600: Windows Vista
                               601: Windows 7],
   WINSDK_TARGETVER=$withval)
@@ -603,17 +555,17 @@ esac
 if test -n "$COMPILE_ENVIRONMENT"; then
 if test "$MOZ_WINSDK_TARGETVER" -lt "06000000"; then
     # We can't build parental controls either
     MOZ_DISABLE_PARENTAL_CONTROLS=1
 fi
 fi
 
 case "$target" in
-*-mingw*|*-wince|*-winmo)
+*-mingw*)
     if test "$GCC" != "yes"; then
         # Check to see if we are really running in a msvc environemnt
         _WIN32_MSVC=1
         AC_CHECK_PROGS(MIDL, midl)
 
         # Make sure compilers are valid
         CFLAGS="$CFLAGS -TC -nologo"
         CXXFLAGS="$CXXFLAGS -TP -nologo"
@@ -926,25 +878,19 @@ AC_PROG_CXXCPP
 
 if test -n "$_WIN32_MSVC"; then
     SKIP_PATH_CHECKS=1
     SKIP_COMPILER_CHECKS=1
     SKIP_LIBRARY_CHECKS=1
 
     # Since we're skipping compiler and library checks, hard-code
     # some facts here.
-    case "$target" in
-    *-wince|*-winmo)
-        ;;
-    *)
-        AC_DEFINE(HAVE_IO_H)
-        AC_DEFINE(HAVE_SETBUF)
-        AC_DEFINE(HAVE_ISATTY)
-        ;;
-    esac
+    AC_DEFINE(HAVE_IO_H)
+    AC_DEFINE(HAVE_SETBUF)
+    AC_DEFINE(HAVE_ISATTY)
 fi
 
 fi # COMPILE_ENVIRONMENT
 
 AC_SUBST(MIDL_FLAGS)
 AC_SUBST(_MSC_VER)
 
 AC_SUBST(GNU_AS)
@@ -1269,18 +1215,16 @@ if test -n "$CROSS_COMPILE"; then
     OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
     OS_RELEASE=
     case "${target_os}" in
         linux*)       OS_ARCH=Linux OS_TARGET=Linux ;;
         kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
         gnu*)         OS_ARCH=GNU ;;
         solaris*)     OS_ARCH=SunOS OS_RELEASE=5 ;;
         mingw*)       OS_ARCH=WINNT ;;
-        wince*)       OS_ARCH=WINCE ;;
-        winmo*)       OS_ARCH=WINCE ;;
         darwin*)      OS_ARCH=Darwin OS_TARGET=Darwin ;;
     esac
     case "${target}" in
         arm-android-eabi) OS_ARCH=Linux OS_TARGET=Android ;;
     esac
 else
     OS_TARGET=`uname -s`
     OS_ARCH=`uname -s | sed -e 's|/|_|g'`
@@ -1474,29 +1418,16 @@ SCO_SV)
 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
     OS_ARCH=SINIX
     OS_TEST=`uname -p`
     ;;
 UnixWare)
     OS_ARCH=UNIXWARE
     OS_RELEASE=`uname -v`
     ;;
-WINCE)
-    OS_ARCH=WINCE
-    case "${target_os}" in
-    *winmo)
-        OS_TARGET=WINMO
-        WINCE_WINDOWS_MOBILE=1
-        AC_DEFINE(WINCE_WINDOWS_MOBILE)
-        ;;
-    *)
-        OS_TARGET=WINCE
-        ;;
-    esac
-    ;;
 Darwin)
     case "${target_cpu}" in
     powerpc*)
         OS_TEST=ppc
         ;;
     i*86*)
         OS_TEST=i386 
         ;;
@@ -1918,17 +1849,17 @@ dnl ====================================
 if test -n "$MOZ_PROFILING"; then
     AC_DEFINE(MOZ_PROFILING)
 fi
 
 dnl ========================================================
 dnl System overrides of the defaults for host
 dnl ========================================================
 case "$host" in
-*mingw*|*wince|*winmo)
+*mingw*)
     if test -n "$_WIN32_MSVC"; then
         HOST_AR=lib
         HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
         HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
         HOST_RANLIB='echo ranlib'
     else
         HOST_CFLAGS="$HOST_CFLAGS -mwindows"
     fi
@@ -2277,115 +2208,16 @@ ia64*-hpux*)
     	USE_ELF_DYNSTR_GC=1
     ;;
     mips*)
         MOZ_DEBUG_FLAGS="-g" # We want inlining
     ;;
     esac
     ;;
 
-*-wince*|*-winmo*)
-    TARGET_COMPILER_ABI=msvc
-    _PLATFORM_DEFAULT_TOOLKIT=cairo-windows
-    MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W`
-    MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
-    AR_LIST="$AR -list"
-    AR_EXTRACT=
-    AR_DELETE="$AR d"
-    AR_FLAGS='-OUT:"$@"'
-    MOZ_MEMORY=1
-    NSS_DISABLE_DBM=1
-    MOZ_OGG=
-    ac_configure_args="$ac_configure_args --enable-win32-target=WINCE"
-
-    if test "$AS_BIN"; then
-        AS="$AS_BIN"
-    fi
-    DSO_CFLAGS=
-    DSO_PIC_CFLAGS=
-    DLL_SUFFIX=.dll
-    BIN_SUFFIX='.exe'
-    if test -z "$RC"; then 
-        RC=rc.exe  
-    fi
-    # certain versions of cygwin's makedepend barf on the 
-    # #include <string> vs -I./dist/include/string issue so don't use it
-    SYSTEM_MAKEDEPEND=
-
-    HOST_CC=cl
-    HOST_CXX=cl
-    HOST_LD=link
-    HOST_AR='lib'
-    HOST_AR_FLAGS='-OUT:$@'
-    HOST_RANLIB='echo ranlib'
-    HOST_CFLAGS="$HOST_CFLAGS -D_X86_"
-        
-        
-    WARNINGS_AS_ERRORS='-WX'
-    MOZ_OPTIMIZE_FLAGS='-Ox'
-    AR_FLAGS='-NOLOGO -OUT:"$@"'
-    ASM_SUFFIX=asm
-    CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
-    CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
-    DLL_PREFIX=
-    DOXYGEN=:
-    DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE
-    DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
-    GARBAGE=
-    IMPORT_LIB_SUFFIX=lib
-    dnl Need to force-link against mozalloc because it's used in the shunt
-    LIBS="$LIBS \$(LIBXUL_DIST)/lib/mozalloc.lib"
-    LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
-    LIB_PREFIX=
-    LIB_SUFFIX=lib 
-    MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
-    MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
-    MKSHLIB_FORCE_ALL=
-    MKSHLIB_UNFORCE_ALL=
-    MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
-    MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
-    MOZ_DEBUG_FLAGS='-Zi'
-    MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
-    MOZ_FIX_LINK_PATHS=
-    OBJ_SUFFIX=obj
-    RANLIB='echo not_ranlib'
-    STRIP='echo not_strip'
-    TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"'
-    UNZIP=unzip
-    XARGS=xargs
-    XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
-    ZIP=zip
-    MOZ_TREE_FREETYPE=1
-
-    AC_DEFINE(HAVE_SNPRINTF)
-    AC_DEFINE(_WINDOWS)
-    AC_DEFINE(WIN32)
-    AC_DEFINE(XP_WIN)
-    AC_DEFINE(XP_WIN32)
-    AC_DEFINE(HW_THREADS)
-    AC_DEFINE(STDC_HEADERS)
-    AC_DEFINE(NEW_H, <new>)
-    AC_DEFINE(WIN32_LEAN_AND_MEAN)
-    AC_DEFINE(HAVE_LOCALTIME_R)
-
-    TARGET_MD_ARCH=win32
-    _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
-    BIN_SUFFIX='.exe'
-    MOZ_USER_DIR="Mozilla"
-
-    MOZ_GFX_OPTIMIZE_MOBILE=1
-
-    # Sanity check for WINCE_WINDOWS_MOBILE
-    # XXX disabled until we can fix the mobile tinderbox
-    ##if test "$WINCE_WINDOWS_MOBILE"; then
-    ##   MOZ_CHECK_HEADER(tpcshell.h, [],
-    ##        AC_MSG_ERROR([Can't find tpcshell.h in your SDK; are you sure you don't need --disable-windows-mobile-components?]))
-    ##fi
-;;
-
 *-mingw*)
     DSO_CFLAGS=
     DSO_PIC_CFLAGS=
     DLL_SUFFIX=.dll
     RC=rc.exe
     # certain versions of cygwin's makedepend barf on the 
     # #include <string> vs -I./dist/include/string issue so don't use it
     SYSTEM_MAKEDEPEND=
@@ -2892,17 +2724,17 @@ if test -z "$MKSHLIB_FORCE_ALL" -o -z "$
 fi
 case "$target" in
 *-os2*)
     NO_LD_ARCHIVE_FLAGS=
     ;;
 *-aix4.3*|*-aix5*)
     NO_LD_ARCHIVE_FLAGS=
     ;;
-*-mingw*|*-wince|*-winmo)
+*-mingw*)
     if test -z "$GNU_CC"; then
         NO_LD_ARCHIVE_FLAGS=
     fi
     ;;
 esac
 AC_SUBST(NO_LD_ARCHIVE_FLAGS)
 
 dnl ========================================================
@@ -2926,17 +2758,17 @@ case "$target" in
         fi
         ;;
     *-nto*) 
         MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
         ;;
     *-darwin*)
         MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
         ;;
-    *-mingw*|*-wince|*-winmo)
+    *-mingw*)
         if test -n "$GNU_CC"; then
            MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
         fi
         ;;
 esac
 
 if test -z "$COMPILE_ENVIRONMENT"; then
     SKIP_COMPILER_CHECKS=1
@@ -3878,17 +3710,17 @@ AC_CACHE_CHECK(
         )]
     )
 
 if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
     AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
 fi
 
 case $target_os in
-    darwin*|mingw*|os2*|wince*|winmo*)
+    darwin*|mingw*|os2*)
         ;;
     *)
     
 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
     AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
         AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
 _SAVE_LIBS=$LIBS
 LIBS="$LIBS $_ICONV_LIBS"
@@ -4618,20 +4450,17 @@ if test -n "$MOZ_NATIVE_NSPR"; then
     AC_TRY_COMPILE([#include "prtypes.h"],
                 [#ifndef PR_STATIC_ASSERT
                  #error PR_STATIC_ASSERT not defined or requires including prlog.h
                  #endif],
                 [MOZ_NATIVE_NSPR=1],
                 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT or including prtypes.h does not provide it]))
     CFLAGS=$_SAVE_CFLAGS
 else
-    if test "$OS_ARCH" = "WINCE"; then
-        NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
-        NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
-    elif test "$OS_ARCH" = "WINNT"; then
+    if test "$OS_ARCH" = "WINNT"; then
         NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
         if test -n "$GNU_CC"; then
             NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
         else
             NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
         fi
     else
         NSPR_CFLAGS='`$(LIBXUL_DIST)/sdk/bin/nspr-config --prefix='${LIBXUL_DIST}' --includedir='${LIBXUL_DIST}'/include/nspr --cflags`'
@@ -4695,17 +4524,17 @@ else
    NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
    NSS_DEP_LIBS="\
         \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
         \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)smime$NSS_VERSION\$(DLL_SUFFIX) \
         \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)ssl$NSS_VERSION\$(DLL_SUFFIX) \
         \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nss$NSS_VERSION\$(DLL_SUFFIX) \
         \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nssutil$NSS_VERSION\$(DLL_SUFFIX)"
 
-   if test -z "$GNU_CC" -a "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
+   if test -z "$GNU_CC" -a "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "OS2"; then
        NSS_LIBS="\
         \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
         \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)smime$NSS_VERSION.\$(LIB_SUFFIX) \
         \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)ssl$NSS_VERSION.\$(LIB_SUFFIX) \
         \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nss$NSS_VERSION.\$(LIB_SUFFIX) \
         \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nssutil$NSS_VERSION.\$(LIB_SUFFIX)"
    else
        NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION"
@@ -4994,17 +4823,17 @@ NECKO_COOKIES=1
 NECKO_DISK_CACHE=1
 NECKO_PROTOCOLS_DEFAULT="about data file ftp http res viewsource wyciwyg"
 USE_ARM_KUSER=
 BUILD_CTYPES=1
 XPC_IDISPATCH_SUPPORT=
 
 
 case "${target}" in
-*android*|*darwin*|*wince*|*winmo*)
+*android*|*darwin*)
     ACCESSIBILITY=
     ;;
 *)
     ACCESSIBILITY=1
     ;;
 esac
 
 case "$target_os" in
@@ -5147,17 +4976,17 @@ MOZ_ARG_HEADER(Toolkit Options)
     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/WinCE - cairo-windows
+                            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" = "photon" \
         -o "$_DEFAULT_TOOLKIT" = "cairo-windows" \
@@ -5184,21 +5013,16 @@ case "$MOZ_WIDGET_TOOLKIT" in
 photon)
 	MOZ_ENABLE_PHOTON=1
 	AC_DEFINE(MOZ_WIDGET_PHOTON)
     ;;
 
 cairo-windows)
     MOZ_WIDGET_TOOLKIT=windows
     MOZ_WEBGL=1
-    case "${target}" in
-    *-wince*)
-        NS_PRINTING=
-        ;;
-    esac
     MOZ_PDF_PRINTING=1
     ;;
 
 cairo-gtk2|cairo-gtk2-x11)
     MOZ_WIDGET_TOOLKIT=gtk2
     MOZ_ENABLE_GTK2=1
     MOZ_ENABLE_XREMOTE=1
     MOZ_WEBGL=1
@@ -6570,17 +6394,17 @@ if test -n "$MOZ_TREE_FREETYPE"; then
    AC_DEFINE(HAVE_FT_LOAD_SFNT_TABLE)
    AC_SUBST(CAIRO_FT_CFLAGS)
 fi
 
 dnl ========================================================
 dnl Installer
 dnl ========================================================
 case "$target_os" in
-    aix*|solaris*|linux*|mingw*|os2*|wince*|winmo*)
+    aix*|solaris*|linux*|mingw*|os2*)
         MOZ_INSTALLER=1
         ;;
 esac
 
 MOZ_ARG_DISABLE_BOOL(installer,
 [  --disable-installer     Disable building of installer],
     MOZ_INSTALLER=,
     MOZ_INSTALLER=1)
@@ -7506,27 +7330,16 @@ else
     WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd -W`
     _objdir_win=`pwd -W`
     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"
     dnl Also pass this to NSPR/NSS
     DLLFLAGS="$DLLFLAGS $MOZ_MEMORY_LDFLAGS"
     export DLLFLAGS
     ;;
-  *-*wince)
-    AC_DEFINE(MOZ_MEMORY_WINCE)
-    AC_DEFINE(MOZ_MEMORY_WINDOWS)
-    if test -z "$WINCE_WINDOWS_MOBILE"; then
-      AC_DEFINE(MOZ_MEMORY_WINCE6)
-    fi
-    ;;
-  *-*winmo)
-    AC_DEFINE(MOZ_MEMORY_WINCE)
-    AC_DEFINE(MOZ_MEMORY_WINDOWS)
-    ;;
   *-android*)
     AC_DEFINE(MOZ_MEMORY_LINUX)
     AC_DEFINE(MOZ_MEMORY_ANDROID)
     _WRAP_MALLOC=1
     export WRAP_MALLOC_LIB="-L$_objdir/dist/lib -lmozalloc -lmozutils"
     WRAP_MALLOC_CFLAGS="-Wl,--wrap=dlopen -Wl,--wrap=dlclose -Wl,--wrap=dlerror -Wl,--wrap=dlsym -Wl,--wrap=dladdr"
     ;;
   *)
@@ -8596,29 +8409,23 @@ if test "$MOZ_TREE_CAIRO"; then
         ;;
       cocoa)
         QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
         QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
         QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
         ;;
       windows)
         WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
-        if test -z "$WINCE"; then
-            WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
-            if test "$MOZ_WINSDK_TARGETVER" -ge "06010000"; then
-                WIN32_DWRITE_FONT_FEATURE="#define CAIRO_HAS_DWRITE_FONT 1"
-                WIN32_D2D_SURFACE_FEATURE="#define CAIRO_HAS_D2D_SURFACE 1"
-                MOZ_ENABLE_D2D_SURFACE=1
-                MOZ_ENABLE_DWRITE_FONT=1
-            else
-                WIN32_DWRITE_FONT_FEATURE=
-                WIN32_D2D_SURFACE_FEATURE=
-            fi
+        WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
+        if test "$MOZ_WINSDK_TARGETVER" -ge "06010000"; then
+            WIN32_DWRITE_FONT_FEATURE="#define CAIRO_HAS_DWRITE_FONT 1"
+            WIN32_D2D_SURFACE_FEATURE="#define CAIRO_HAS_D2D_SURFACE 1"
+            MOZ_ENABLE_D2D_SURFACE=1
+            MOZ_ENABLE_DWRITE_FONT=1
         else
-            WIN32_FONT_FEATURE=
             WIN32_DWRITE_FONT_FEATURE=
             WIN32_D2D_SURFACE_FEATURE=
         fi
 
         MOZ_CHECK_HEADER(d3d9.h, MOZ_ENABLE_D3D9_LAYER=1)
 
         dnl D3D10 Layers depend on D2D Surfaces.
         if test -n "$WIN32_D2D_SURFACE_FEATURE"; then
@@ -8822,18 +8629,17 @@ MOZ_ARG_DISABLE_BOOL(necko-wifi,
 if test "$OS_ARCH" = "OS2"; then
   dnl OS/2 implementation of Necko-WiFi support will be added in bug 506566
   NECKO_WIFI=
 fi
 if test "$NECKO_WIFI" -a \
         "$OS_ARCH" != "Linux" -a \
         "$OS_ARCH" != "Darwin" -a \
         "$OS_ARCH" != "SunOS" -a \
-        "$OS_ARCH" != "WINNT" -a \
-        "$OS_ARCH" != "WINCE"; then
+        "$OS_ARCH" != "WINNT"; then
   AC_MSG_ERROR([Necko WiFi scanning not supported on your platform, use --disable-necko-wifi])
 fi
 
 if test -z "$SKIP_LIBRARY_CHECKS" -a "$NECKO_WIFI" -a "$OS_ARCH" = "Linux"
 then
   MOZ_CHECK_HEADER([iwlib.h])
   if test "$ac_cv_header_iwlib_h" != "yes"; then
     AC_MSG_ERROR([Can't find header iwlib.h for Necko WiFi scanning (might be in package libiw-dev (Ubuntu) or wireless-tools-devel (Fedora) or libiw-devel (openSUSE)); use --disable-necko-wifi to disable])
@@ -8861,22 +8667,17 @@ dnl
 dnl Build jsctypes on the platforms we can, unless it's explicitly disabled.
 dnl
 MOZ_ARG_DISABLE_BOOL(ctypes,
 [  --disable-ctypes        Disable js-ctypes],
     BUILD_CTYPES=,
     BUILD_CTYPES=1)
 AC_SUBST(BUILD_CTYPES)
 if test "$BUILD_CTYPES"; then
-  if test "$OS_ARCH" = "WINCE" -a `echo $OS_TEST | grep -ic arm` = 1; then
-    # Disable ctypes for arm/wince.
-    BUILD_CTYPES=
-  else
     AC_DEFINE(BUILD_CTYPES)
-  fi
 fi
 
 dnl NECKO_ configuration options are not global
 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"
 
 dnl Only build Mork if it's required
 AC_SUBST(MOZ_MORK)
 if test "$MOZ_MORK"; then
@@ -9044,20 +8845,16 @@ AC_SUBST(MOZILLA_OFFICIAL)
 dnl win32 options
 AC_SUBST(MOZ_MAPINFO)
 AC_SUBST(MOZ_BROWSE_INFO)
 AC_SUBST(MOZ_TOOLS_DIR)
 AC_SUBST(WIN32_REDIST_DIR)
 AC_SUBST(PYTHON)
 AC_SUBST(MAKENSISU)
 
-AC_SUBST(WINCE)
-AC_SUBST(WINCE_SDK_DIR)
-AC_SUBST(WINCE_WINDOWS_MOBILE)
-
 dnl Echo the CFLAGS to remove extra whitespace.
 CFLAGS=`echo \
 	$_WARNINGS_CFLAGS \
 	$CFLAGS`
 
 CXXFLAGS=`echo \
 	$_MOZ_RTTI_FLAGS \
 	$_MOZ_EXCEPTIONS_FLAGS \
@@ -9271,17 +9068,17 @@ if test "$USE_FC_FREETYPE"; then
 fi
 
 dnl Set various defines and substitutions
 dnl ========================================================
 
 if test "$OS_ARCH" = "Darwin"; then
   AC_DEFINE(XP_UNIX)
   AC_DEFINE(UNIX_ASYNC_DNS)
-elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
+elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2"; then
   AC_DEFINE(XP_UNIX)
   AC_DEFINE(UNIX_ASYNC_DNS)
 fi
 
 if test "$MOZ_DEBUG"; then
     AC_DEFINE(MOZ_REFLOW_PERF)
     AC_DEFINE(MOZ_REFLOW_PERF_DSP)
 fi
@@ -9494,17 +9291,17 @@ if test -z "$MOZ_NATIVE_NSPR"; then
     fi
     AC_OUTPUT_SUBDIRS(nsprpub)
     ac_configure_args="$_SUBDIR_CONFIG_ARGS"
 fi
 
 if test -z "$MOZ_NATIVE_NSPR"; then
     # Hack to deal with the fact that we use NSPR_CFLAGS everywhere
     AC_MSG_WARN([Recreating autoconf.mk with updated nspr-config output])
-    if test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "WINCE"; then
+    if test "$OS_ARCH" != "WINNT"; then
        NSPR_LIBS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --libdir=$LIBXUL_DIST/lib --libs`
        $PERL -pi.bak -e "s '^NSPR_LIBS\\s*=.*'NSPR_LIBS = $NSPR_LIBS'" config/autoconf.mk
        NSPR_CFLAGS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --includedir=$LIBXUL_DIST/include/nspr --cflags`
        $PERL -pi.bak -e "s '^NSPR_CFLAGS\\s*=.*'NSPR_CFLAGS = $NSPR_CFLAGS'" config/autoconf.mk
     fi
     rm -f config/autoconf.mk.bak
 fi
 
--- a/js/src/config/autoconf.mk.in
+++ b/js/src/config/autoconf.mk.in
@@ -316,19 +316,16 @@ MOZ_BROWSE_INFO	= @MOZ_BROWSE_INFO@
 MOZ_TOOLS_DIR	= @MOZ_TOOLS_DIR@
 MOZ_QUANTIFY	= @MOZ_QUANTIFY@
 MSMANIFEST_TOOL = @MSMANIFEST_TOOL@
 MOZ_MEMORY_LDFLAGS = @MOZ_MEMORY_LDFLAGS@
 
 # Codesighs tools option, enables win32 mapfiles.
 MOZ_MAPINFO	= @MOZ_MAPINFO@
 
-WINCE		= @WINCE@
-WINCE_WINDOWS_MOBILE = @WINCE_WINDOWS_MOBILE@
-
 QEMU_CANT_RUN_JS_SHELL = @QEMU_CANT_RUN_JS_SHELL@
 
 MACOS_SDK_DIR	= @MACOS_SDK_DIR@
 NEXT_ROOT	= @NEXT_ROOT@
 GCC_VERSION	= @GCC_VERSION@
 XCODEBUILD_VERSION= @XCODEBUILD_VERSION@
 HAS_XCODE_2_1	= @HAS_XCODE_2_1@
 UNIVERSAL_BINARY= @UNIVERSAL_BINARY@
@@ -341,19 +338,19 @@ ENABLE_TRACEJIT = @ENABLE_TRACEJIT@
 ENABLE_METHODJIT = @ENABLE_METHODJIT@
 NANOJIT_ARCH = @NANOJIT_ARCH@
 HAVE_ARM_SIMD= @HAVE_ARM_SIMD@
 
 JS_SHARED_LIBRARY = @JS_SHARED_LIBRARY@
 HAVE_LINUX_PERF_EVENT_H = @HAVE_LINUX_PERF_EVENT_H@
 
 # We only want to do the pymake sanity on Windows, other os's can cope
-ifeq (,$(filter-out WINNT WINCE,$(HOST_OS_ARCH)))
+ifeq ($(HOST_OS_ARCH),WINNT)
 # Ensure invariants between GNU Make and pymake
 # Checked here since we want the sane error in a file that
 # actually can be found regardless of path-style.
 ifeq (_:,$(.PYMAKE)_$(findstring :,$(srcdir)))
 $(error Windows-style srcdir being used with GNU make. Did you mean to run $(topsrcdir)/build/pymake/make.py instead? [see-also: https://developer.mozilla.org/en/Gmake_vs._Pymake])
 endif
 ifeq (1_a,$(.PYMAKE)_$(firstword a$(subst /, ,$(srcdir))))
 $(error MSYS-style srcdir being used with Pymake. Did you mean to run GNU Make instead? [see-also: https://developer.mozilla.org/en/Gmake_vs._Pymake])
 endif
-endif # Windows
+endif # WINNT
--- a/js/src/config/config.mk
+++ b/js/src/config/config.mk
@@ -142,17 +142,17 @@ OS_CONFIG	:= $(OS_ARCH)$(OS_RELEASE)
 FINAL_LINK_LIBS = $(DEPTH)/config/final-link-libs
 FINAL_LINK_COMPS = $(DEPTH)/config/final-link-comps
 FINAL_LINK_COMP_NAMES = $(DEPTH)/config/final-link-comp-names
 
 MOZ_UNICHARUTIL_LIBS = $(LIBXUL_DIST)/lib/$(LIB_PREFIX)unicharutil_s.$(LIB_SUFFIX)
 MOZ_WIDGET_SUPPORT_LIBS    = $(DIST)/lib/$(LIB_PREFIX)widgetsupport_s.$(LIB_SUFFIX)
 
 ifdef MOZ_MEMORY
-ifneq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
+ifneq ($(OS_ARCH),WINNT)
 JEMALLOC_LIBS = $(MKSHLIB_FORCE_ALL) $(call EXPAND_MOZLIBNAME,jemalloc) $(MKSHLIB_UNFORCE_ALL)
 # If we are linking jemalloc into a program, we want the jemalloc symbols
 # to be exported
 ifneq (,$(SIMPLE_PROGRAMS)$(PROGRAM))
 JEMALLOC_LIBS += $(MOZ_JEMALLOC_STANDALONE_GLUE_LDOPTS)
 endif
 endif
 endif
@@ -393,17 +393,17 @@ ifndef JS_SHARED_LIBRARY
 DEFINES += -DSTATIC_EXPORTABLE_JS_API
 endif
 endif
 endif
 
 # Force _all_ exported methods to be |_declspec(dllexport)| when we're
 # building them into the executable.
 
-ifeq (,$(filter-out WINNT WINCE OS2, $(OS_ARCH)))
+ifeq (,$(filter-out WINNT OS2, $(OS_ARCH)))
 ifdef BUILD_STATIC_LIBS
 DEFINES += \
         -D_IMPL_NS_GFX \
         -D_IMPL_NS_MSG_BASE \
         -D_IMPL_NS_WIDGET \
         $(NULL)
 endif
 endif
@@ -584,23 +584,21 @@ endif
 #
 # Override defaults
 
 # We need to know where to find the libraries we
 # put on the link line for binaries, and should
 # we link statically or dynamic?  Assuming dynamic for now.
 
 ifneq (WINNT_,$(OS_ARCH)_$(GNU_CC))
-ifneq (,$(filter-out WINCE,$(OS_ARCH)))
 LIBS_DIR	= -L$(DIST)/bin -L$(DIST)/lib
 ifdef LIBXUL_SDK
 LIBS_DIR	+= -L$(LIBXUL_SDK)/bin -L$(LIBXUL_SDK)/lib
 endif
 endif
-endif
 
 # Default location of include files
 IDL_DIR		= $(DIST)/idl
 
 XPIDL_FLAGS = -I$(srcdir) -I$(IDL_DIR)
 ifdef LIBXUL_SDK
 XPIDL_FLAGS += -I$(LIBXUL_SDK)/idl
 endif
@@ -800,27 +798,23 @@ MERGE_FILE = $(firstword \
   $(wildcard $(LOCALE_MERGEDIR)/$(subst /locales,,$(relativesrcdir))/$(1)) \
   $(wildcard $(LOCALE_SRCDIR)/$(1)) \
   $(srcdir)/en-US/$(1) )
 else
 MERGE_FILE = $(LOCALE_SRCDIR)/$(1)
 endif
 MERGE_FILES = $(foreach f,$(1),$(call MERGE_FILE,$(f)))
 
-ifdef WINCE
-RUN_TEST_PROGRAM = $(PYTHON) $(topsrcdir)/build/mobile/devicemanager-run-test.py
-else
 ifeq (OS2,$(OS_ARCH))
 RUN_TEST_PROGRAM = $(topsrcdir)/build/os2/test_os2.cmd "$(DIST)"
 else
 ifneq (WINNT,$(OS_ARCH))
 RUN_TEST_PROGRAM = $(DIST)/bin/run-mozilla.sh
 endif # ! WINNT
 endif # ! OS2
-endif # ! WINCE
 
 #
 # Java macros
 #
 
 # Make sure any compiled classes work with at least JVM 1.4
 JAVAC_FLAGS += -source 1.4
 
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -77,17 +77,17 @@ endif
 
 # ELOG prints out failed command when building silently (gmake -s).
 ifneq (,$(findstring s, $(filter-out --%, $(MAKEFLAGS))))
   ELOG := $(EXEC) sh $(BUILD_TOOLS)/print-failed-commands.sh
 else
   ELOG :=
 endif
 
-ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
+ifeq ($(OS_ARCH),WINNT)
 _VPATH_SRCS = $(abspath $<)
 else
 _VPATH_SRCS = $<
 endif
 
 # Add $(DIST)/lib to VPATH so that -lfoo dependencies are followed
 VPATH += $(DIST)/lib
 ifdef LIBXUL_SDK
@@ -241,17 +241,17 @@ endif
 ifdef LIBRARY
 ifneq (_1,$(FORCE_SHARED_LIB)_$(BUILD_STATIC_LIBS))
 ifdef MKSHLIB
 
 ifdef LIB_IS_C_ONLY
 MKSHLIB			= $(MKCSHLIB)
 endif
 
-ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
+ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
 IMPORT_LIBRARY		:= $(LIB_PREFIX)$(SHARED_LIBRARY_NAME).$(IMPORT_LIB_SUFFIX)
 endif
 
 ifeq (OS2,$(OS_ARCH))
 ifdef SHORT_LIBNAME
 SHARED_LIBRARY_NAME	:= $(SHORT_LIBNAME)
 endif
 endif
@@ -297,17 +297,17 @@ ifndef FORCE_STATIC_LIB
 LIBRARY			:= $(NULL)
 endif
 endif
 
 ifdef JAVA_LIBRARY_NAME
 JAVA_LIBRARY := $(JAVA_LIBRARY_NAME).jar
 endif
 
-ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
+ifeq ($(OS_ARCH),WINNT)
 ifndef GNU_CC
 
 #
 # Unless we're building SIMPLE_PROGRAMS, all C++ files share a PDB file per
 # directory. For parallel builds, this PDB file is shared and locked by
 # MSPDBSRV.EXE, starting with MSVC8 SP1. If you're using MSVC 7.1 or MSVC8
 # without SP1, don't do parallel builds.
 #
@@ -352,17 +352,17 @@ endif # ENABLE_CXX_EXCEPTIONS
 endif # WINNT
 
 ifeq ($(SOLARIS_SUNPRO_CXX),1)
 ifeq (86,$(findstring 86,$(OS_TEST)))
 OS_LDFLAGS += -M $(topsrcdir)/config/solaris_ia32.map
 endif # x86
 endif # Solaris Sun Studio C++
 
-ifeq (,$(filter-out WINNT WINCE,$(HOST_OS_ARCH)))
+ifeq ($(HOST_OS_ARCH),WINNT)
 HOST_PDBFILE=$(basename $(@F)).pdb
 endif
 
 # Don't build SIMPLE_PROGRAMS during the MOZ_PROFILE_GENERATE pass
 ifdef MOZ_PROFILE_GENERATE
 SIMPLE_PROGRAMS :=
 endif
 
@@ -661,32 +661,22 @@ IFLAGS1 = -m 644
 IFLAGS2 = -m 755
 endif
 
 ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
 OUTOPTION = -Fo# eol
 else
 OUTOPTION = -o # eol
 endif # WINNT && !GNU_CC
-ifneq (,$(filter WINCE,$(OS_ARCH)))
-OUTOPTION = -Fo# eol
-endif
-
-ifeq ($(OS_ARCH), WINCE)
-OUTOPTION = -Fo# eol
-HOST_OUTOPTION = -Fo# eol
-else
 
 ifeq (,$(CROSS_COMPILE))
 HOST_OUTOPTION = $(OUTOPTION)
 else
 HOST_OUTOPTION = -o # eol
 endif
-
-endif
 ################################################################################
 
 # SUBMAKEFILES: List of Makefiles for next level down.
 #   This is used to update or create the Makefiles before invoking them.
 SUBMAKEFILES += $(addsuffix /Makefile, $(DIRS) $(TOOL_DIRS) $(PARALLEL_DIRS))
 
 # The root makefile doesn't want to do a plain export/libs, because
 # of the tiers and because of libxul. Suppress the default rules in favor
@@ -860,17 +850,17 @@ ifdef SHARED_LIBRARY
 ifdef IS_COMPONENT
 	$(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET)/components
 	$(ELF_DYNSTR_GC) $(FINAL_TARGET)/components/$(SHARED_LIBRARY)
 ifndef NO_COMPONENTS_MANIFEST
 	@$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_TARGET)/chrome.manifest "manifest components/components.manifest"
 	@$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_TARGET)/components/components.manifest "binary-component $(SHARED_LIBRARY)"
 endif
 else # ! IS_COMPONENT
-ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
+ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
 	$(INSTALL) $(IFLAGS2) $(IMPORT_LIBRARY) $(DIST)/lib
 else
 	$(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(DIST)/lib
 endif
 	$(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET)
 endif # IS_COMPONENT
 endif # SHARED_LIBRARY
 ifdef PROGRAM
@@ -960,19 +950,16 @@ alltags:
 	find $(topsrcdir) -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' -o -name '*.idl' \) -print | $(TAG_PROGRAM)
 
 #
 # PROGRAM = Foo
 # creates OBJS, links with LIBS to create Foo
 #
 $(PROGRAM): $(PROGOBJS) $(LIBS_DEPS) $(EXTRA_DEPS) $(EXE_DEF_FILE) $(RESFILE) $(GLOBAL_DEPS)
 	@$(RM) $@.manifest
-ifeq (WINCE,$(OS_ARCH))
-	$(EXPAND_LD) -NOLOGO -OUT:$@ $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
-else
 ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
 	$(EXPAND_LD) -NOLOGO -OUT:$@ -PDB:$(LINK_PDBFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
 ifdef MSMANIFEST_TOOL
 	@if test -f $@.manifest; then \
 		if test -f "$(srcdir)/$@.manifest"; then \
 			echo "Embedding manifest from $(srcdir)/$@.manifest and $@.manifest"; \
 			mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" $@.manifest -OUTPUTRESOURCE:$@\;1; \
 		else \
@@ -992,29 +979,25 @@ endif
 else # !WINNT || GNU_CC
 ifeq ($(CPP_PROG_LINK),1)
 	$(EXPAND_CCC) -o $@ $(CXXFLAGS) $(WRAP_MALLOC_CFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) $(WRAP_MALLOC_LIB) $(EXE_DEF_FILE)
 	@$(call CHECK_STDCXX,$@)
 else # ! CPP_PROG_LINK
 	$(EXPAND_CC) -o $@ $(CFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) $(EXE_DEF_FILE)
 endif # CPP_PROG_LINK
 endif # WINNT && !GNU_CC
-endif # WINCE
 
 ifdef ENABLE_STRIP
 	$(STRIP) $@
 endif
 ifdef MOZ_POST_PROGRAM_COMMAND
 	$(MOZ_POST_PROGRAM_COMMAND) $@
 endif
 
 $(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
-ifeq (WINCE,$(OS_ARCH))
-	$(HOST_LD) -NOLOGO -OUT:$@ $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
-else
 ifeq (_WINNT,$(GNU_CC)_$(HOST_OS_ARCH))
 	$(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 ifdef MSMANIFEST_TOOL
 	@if test -f $@.manifest; then \
 		if test -f "$(srcdir)/$@.manifest"; then \
 			echo "Embedding manifest from $(srcdir)/$@.manifest and $@.manifest"; \
 			mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" $@.manifest -OUTPUTRESOURCE:$@\;1; \
 		else \
@@ -1028,69 +1011,60 @@ ifdef MSMANIFEST_TOOL
 endif	# MSVC with manifest tool
 else
 ifeq ($(HOST_CPP_PROG_LINK),1)
 	$(HOST_CXX) -o $@ $(HOST_CXXFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 else
 	$(HOST_CC) -o $@ $(HOST_CFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 endif # HOST_CPP_PROG_LINK
 endif
-endif
 
 #
 # This is an attempt to support generation of multiple binaries
 # in one directory, it assumes everything to compile Foo is in
 # Foo.o (from either Foo.c or Foo.cpp).
 #
 # SIMPLE_PROGRAMS = Foo Bar
 # creates Foo.o Bar.o, links with LIBS to create Foo, Bar.
 #
 $(SIMPLE_PROGRAMS): %$(BIN_SUFFIX): %.$(OBJ_SUFFIX) $(LIBS_DEPS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
-ifeq (WINCE,$(OS_ARCH))
-	$(EXPAND_LD) -nologo  -entry:mainACRTStartup -out:$@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
-else
 ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
 	$(EXPAND_LD) -nologo -out:$@ -pdb:$(LINK_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
 ifdef MSMANIFEST_TOOL
 	@if test -f $@.manifest; then \
 		mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
 		rm -f $@.manifest; \
 	fi
 endif	# MSVC with manifest tool
 else
 ifeq ($(CPP_PROG_LINK),1)
 	$(EXPAND_CCC) $(WRAP_MALLOC_CFLAGS) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(BIN_FLAGS)
 	@$(call CHECK_STDCXX,$@)
 else
 	$(EXPAND_CC) $(WRAP_MALLOC_CFLAGS) $(CFLAGS) $(OUTOPTION)$@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(BIN_FLAGS)
 endif # CPP_PROG_LINK
 endif # WINNT && !GNU_CC
-endif # WINCE
 
 ifdef ENABLE_STRIP
 	$(STRIP) $@
 endif
 ifdef MOZ_POST_PROGRAM_COMMAND
 	$(MOZ_POST_PROGRAM_COMMAND) $@
 endif
 
 $(HOST_SIMPLE_PROGRAMS): host_%$(HOST_BIN_SUFFIX): host_%.$(OBJ_SUFFIX) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
-ifeq (WINCE,$(OS_ARCH))
-	$(HOST_LD) -NOLOGO -OUT:$@ $(WIN32_EXE_LDFLAGS) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
-else
 ifeq (WINNT_,$(HOST_OS_ARCH)_$(GNU_CC))
 	$(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 else
 ifneq (,$(HOST_CPPSRCS)$(USE_HOST_CXX))
 	$(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_CXXFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 else
 	$(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_CFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 endif
 endif
-endif
 
 #
 # Purify target.  Solaris/sparc only to start.
 # Purify does not recognize "egcs" or "c++" so we go with 
 # "gcc" and "g++" for now.
 #
 pure:	$(PROGRAM)
 ifeq ($(CPP_PROG_LINK),1)
@@ -1119,17 +1093,17 @@ endif
 $(filter %.$(LIB_SUFFIX),$(LIBRARY)): $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS_DEPS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
 	$(RM) $(LIBRARY)
 	$(EXPAND_AR) $(AR_FLAGS) $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS)
 	$(RANLIB) $@
 
 $(filter-out %.$(LIB_SUFFIX),$(LIBRARY)): $(filter %.$(LIB_SUFFIX),$(LIBRARY)) $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS_DEPS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
 	$(EXPAND_LIBS_GEN) $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS) > $@
 
-ifeq (,$(filter-out WINNT WINCE, $(OS_ARCH)))
+ifeq ($(OS_ARCH),WINNT)
 $(IMPORT_LIBRARY): $(SHARED_LIBRARY)
 endif
 
 ifeq ($(OS_ARCH),OS2)
 $(DEF_FILE): $(OBJS) $(SHARED_LIBRARY_LIBS)
 	$(RM) $@
 	echo LIBRARY $(SHARED_LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@
 	echo PROTMODE >> $@
@@ -1377,29 +1351,29 @@ endif
 
 %: s.%
 
 %: SCCS/s.%
 
 ###############################################################################
 # Java rules
 ###############################################################################
-ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
+ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
 SEP := ;
 else
 SEP := :
 endif
 
 EMPTY :=
 SPACE := $(EMPTY) $(EMPTY)
 
 # MSYS has its own special path form, but javac expects the source and class
 # paths to be in the DOS form (i.e. e:/builds/...).  This function does the
 # appropriate conversion on Windows, but is a noop on other systems.
-ifeq (,$(filter-out WINNT WINCE, $(HOST_OS_ARCH)))
+ifeq ($(HOST_OS_ARCH),WINNT)
 #  We use 'pwd -W' to get DOS form of the path.  However, since the given path
 #  could be a file or a non-existent path, we cannot call 'pwd -W' directly
 #  on the path.  Instead, we extract the root path (i.e. "c:/"), call 'pwd -W'
 #  on it, then merge with the rest of the path.
 root-path = $(shell echo $(1) | sed -e "s|\(/[^/]*\)/\?\(.*\)|\1|")
 non-root-path = $(shell echo $(1) | sed -e "s|\(/[^/]*\)/\?\(.*\)|\2|")
 normalizepath = $(foreach p,$(1),$(if $(filter /%,$(1)),$(patsubst %/,%,$(shell cd $(call root-path,$(1)) && pwd -W))/$(call non-root-path,$(1)),$(1)))
 else
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -563,27 +563,19 @@ fi
 if test "$GXX" = yes; then
    if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
      INTEL_CXX=1
    fi
 fi
 
 dnl Special win32 checks
 dnl ========================================================
-case "$target" in
-*-wince|*-winmo)
-    WINVER=500
-    WINSDK_TARGETVER=502
-    ;;
-*)
-    WINVER=502
-    dnl Target the Windows 7 SDK by default
-    WINSDK_TARGETVER=601
-    ;;
-esac
+WINVER=502
+dnl Target the Windows 7 SDK by default
+WINSDK_TARGETVER=601
 
 MOZ_ARG_WITH_STRING(windows-version,
 [  --with-windows-version=WINSDK_TARGETVER
                           Highest Windows version to target using this SDK
                               502: Windows Server 2003
                               600: Windows Vista
                               601: Windows 7],
   WINSDK_TARGETVER=$withval)
@@ -595,17 +587,17 @@ 502|600|601)
 
 *)
     AC_MSG_ERROR([Invalid value for --with-windows-version ($WINSDK_TARGETVER), must be 502, 600 or 601]);
     ;;
 
 esac
 
 case "$target" in
-*-mingw*|*-wince|*-winmo)
+*-mingw*)
     if test "$GCC" != "yes"; then
         # Check to see if we are really running in a msvc environemnt
         _WIN32_MSVC=1
 
         # Make sure compilers are valid
         CFLAGS="$CFLAGS -TC -nologo"
         CXXFLAGS="$CXXFLAGS -TP -nologo"
         # MSVC warning C4345 warns of newly conformant behavior as of VS2003.
@@ -889,34 +881,27 @@ if test -n "$_WIN32_MSVC"; then
     SKIP_PATH_CHECKS=1
     SKIP_COMPILER_CHECKS=1
     SKIP_LIBRARY_CHECKS=1
 
     # Since we're skipping compiler and library checks, hard-code
     # some facts here.
 
     # Common to all MSVC environments:
+
     # Windows lacks <stdint.h>, but has __int8, and so on.
     AC_DEFINE(JS_HAVE___INTN)
     AC_DEFINE(HAVE_LOCALECONV)
-
-    case "$target" in
-    *-wince|*-winmo)
-        AC_DEFINE(HAVE_SYSTEMTIMETOFILETIME)
-        AC_DEFINE(JS_CRTDEFS_H_HAS_INTPTR_T)
-        ;;
-    *)
-        AC_DEFINE(HAVE_SYSTEMTIMETOFILETIME)
-        AC_DEFINE(HAVE_GETSYSTEMTIMEASFILETIME)
-        # Windows <stddef.h> defines intptr_t and uintptr_t.
-        # VS2005: http://msdn.microsoft.com/en-us/library/323b6b3k(VS.80).aspx
-        # VS2008: http://msdn.microsoft.com/en-us/library/323b6b3k.aspx
-        AC_DEFINE(JS_STDDEF_H_HAS_INTPTR_T)
-        ;;
-    esac
+    AC_DEFINE(HAVE_SYSTEMTIMETOFILETIME)
+    AC_DEFINE(HAVE_GETSYSTEMTIMEASFILETIME)
+
+    # Windows <stddef.h> defines intptr_t and uintptr_t.
+    # VS2005: http://msdn.microsoft.com/en-us/library/323b6b3k(VS.80).aspx
+    # VS2008: http://msdn.microsoft.com/en-us/library/323b6b3k.aspx
+    AC_DEFINE(JS_STDDEF_H_HAS_INTPTR_T)
 fi
 
 fi # COMPILE_ENVIRONMENT
 
 if test "$cross_compiling"  = "yes"; then
     CROSS_COMPILE=1
 else
     CROSS_COMPILE=
@@ -1219,18 +1204,16 @@ if test -n "$CROSS_COMPILE"; then
     OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
     OS_RELEASE=
     case "${target_os}" in
         linux*)       OS_ARCH=Linux OS_TARGET=Linux ;;
         kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
         gnu*)         OS_ARCH=GNU ;;
         solaris*)     OS_ARCH=SunOS OS_RELEASE=5 ;;
         mingw*)       OS_ARCH=WINNT ;;
-        wince*)       OS_ARCH=WINCE ;;
-        winmo*)       OS_ARCH=WINCE ;;
         darwin*)      OS_ARCH=Darwin OS_TARGET=Darwin ;;
     esac
     case "${target}" in
         arm-android-eabi) OS_ARCH=Linux OS_TARGET=Android ;;
     esac
 else
     OS_TARGET=`uname -s`
     OS_ARCH=`uname -s | sed -e 's|/|_|g'`
@@ -1429,29 +1412,16 @@ SCO_SV)
 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
     OS_ARCH=SINIX
     OS_TEST=`uname -p`
     ;;
 UnixWare)
     OS_ARCH=UNIXWARE
     OS_RELEASE=`uname -v`
     ;;
-WINCE)
-    OS_ARCH=WINCE
-    case "${target_os}" in
-    *winmo)
-        OS_TARGET=WINMO
-        WINCE_WINDOWS_MOBILE=1
-        AC_DEFINE(WINCE_WINDOWS_MOBILE)
-        ;;
-    *)
-        OS_TARGET=WINCE
-        ;;
-    esac
-    ;;
 Darwin)
     case "${target_cpu}" in
     powerpc*)
         OS_TEST=ppc
         ;;
     i*86*)
         OS_TEST=i386 
         ;;
@@ -1805,17 +1775,17 @@ MOZ_ARG_ENABLE_BOOL(profiling,
 [  --enable-profiling      Set compile flags necessary for using sampling profilers (e.g. shark, perf)],
     MOZ_PROFILING=1,
     MOZ_PROFILING= )
 
 dnl ========================================================
 dnl System overrides of the defaults for host
 dnl ========================================================
 case "$host" in
-*mingw*|*wince|*winmo)
+*mingw*)
     # we need Python 2.5 on Windows
     PYTHON_VERSION=2.5
     if test -n "$_WIN32_MSVC"; then
         HOST_AR=lib
         HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
         HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
         HOST_RANLIB='echo ranlib'
     else
@@ -2152,112 +2122,16 @@ ia64*-hpux*)
     	CXXFLAGS="$CXXFLAGS -mieee"
     ;;
     mips*)
         MOZ_DEBUG_FLAGS="-g" # We want inlining
     ;;
     esac
     ;;
 
-*-wince*|*-winmo*)
-    TARGET_COMPILER_ABI=msvc
-    MOZ_TOOLS_DIR=`echo $MOZ_TOOLS`
-    AR_LIST="$AR -list"
-    AR_EXTRACT=
-    AR_DELETE="$AR d"
-    AR_FLAGS='-OUT:"$@"'
-    AS="$AS_BIN"
-
-    DSO_CFLAGS=
-    DSO_PIC_CFLAGS=
-    DLL_SUFFIX=.dll
-    BIN_SUFFIX='.exe'
-    if test -z "$RC"; then 
-        RC=rc.exe  
-    fi
-    # certain versions of cygwin's makedepend barf on the 
-    # #include <string> vs -I./dist/include/string issue so don't use it
-    SYSTEM_MAKEDEPEND=
-
-    HOST_CC=cl
-    HOST_CXX=cl
-    HOST_LD=link
-    HOST_AR='lib'
-    HOST_AR_FLAGS='-OUT:$@'
-    HOST_RANLIB='echo ranlib'
-    HOST_CFLAGS="$HOST_CFLAGS -D_X86_"
-        
-        
-    WARNINGS_AS_ERRORS='-WX'
-    MOZ_OPTIMIZE_FLAGS='-Ox'
-    AR_FLAGS='-NOLOGO -OUT:"$@"'
-    ASM_SUFFIX=asm
-    CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
-    CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
-    DLL_PREFIX=
-    DOXYGEN=:
-    DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE
-    DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
-    GARBAGE=
-    IMPORT_LIB_SUFFIX=lib
-    dnl Need to force-link against mozalloc because it's used in the shunt
-    LIBS="$LIBS \$(LIBXUL_DIST)/lib/mozalloc.lib"
-    LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
-    LIB_PREFIX=
-    LIB_SUFFIX=lib 
-    MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
-    MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
-    MKSHLIB_FORCE_ALL=
-    MKSHLIB_UNFORCE_ALL=
-    MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
-    MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
-    MOZ_DEBUG_FLAGS='-Zi'
-    MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
-    MOZ_FIX_LINK_PATHS=
-    MOZ_JS_LIBS='$(libdir)/mozjs.lib'
-    OBJ_SUFFIX=obj
-    RANLIB='echo not_ranlib'
-    STRIP='echo not_strip'
-    TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"'
-    UNZIP=unzip
-    XARGS=xargs
-    XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
-    ZIP=zip
-
-    AC_DEFINE(HAVE_SNPRINTF)
-    AC_DEFINE(_WINDOWS)
-    AC_DEFINE(WIN32)
-    AC_DEFINE(XP_WIN)
-    AC_DEFINE(XP_WIN32)
-    AC_DEFINE(HW_THREADS)
-    AC_DEFINE(STDC_HEADERS)
-    AC_DEFINE(NEW_H, <new>)
-    AC_DEFINE(WIN32_LEAN_AND_MEAN)
-    AC_DEFINE(HAVE_LOCALTIME_R)
-
-    TARGET_MD_ARCH=win32
-    _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
-    BIN_SUFFIX='.exe'
-    MOZ_USER_DIR="Mozilla"
-
-    dnl Default to Windows Mobile components enabled
-    WINCE_WINDOWS_MOBILE=1
-
-    MOZ_ARG_DISABLE_BOOL(windows-mobile-components,
-    [  --disable-windows-mobile-components
-                          Disable Windows Mobile specific components from
-                          CE build],
-    WINCE_WINDOWS_MOBILE=,
-    WINCE_WINDOWS_MOBILE=1)
- 
-    if test "$WINCE_WINDOWS_MOBILE"; then
-        AC_DEFINE(WINCE_WINDOWS_MOBILE)
-    fi
-;;
-
 *-symbian*)
 
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(SYMBIAN)
     AC_DEFINE(__arm__)
     AC_DEFINE(__SYMBIAN32__)
     AC_DEFINE(_UNICODE)
     AC_DEFINE(NDEBUG)
@@ -2784,17 +2658,17 @@ if test -z "$MKSHLIB_FORCE_ALL" -o -z "$
 fi
 case "$target" in
 *-os2*)
     NO_LD_ARCHIVE_FLAGS=
     ;;
 *-aix4.3*|*-aix5*)
     NO_LD_ARCHIVE_FLAGS=
     ;;
-*-mingw*|*-wince|*-winmo)
+*-mingw*)
     if test -z "$GNU_CC"; then
         NO_LD_ARCHIVE_FLAGS=
     fi
     ;;
 esac
 AC_SUBST(NO_LD_ARCHIVE_FLAGS)
 
 dnl ========================================================
@@ -2816,17 +2690,17 @@ case "$target" in
         fi
         ;;
     *-nto*) 
         MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
         ;;
     *-darwin*)
         MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
         ;;
-    *-mingw*|*-wince|*-winmo)
+    *-mingw*)
         if test -n "$GNU_CC"; then
            MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
         fi
         ;;
 esac
 
 if test -z "$COMPILE_ENVIRONMENT"; then
     SKIP_COMPILER_CHECKS=1
@@ -2948,17 +2822,17 @@ case "$target" in
     AC_DEFINE(AVMPLUS_UNIX)
     ;;
 *-freebsd*|*-kfreebsd*)
     AC_DEFINE(AVMPLUS_UNIX)
     ;;
 *-gnu*)
     AC_DEFINE(AVMPLUS_UNIX)
     ;;
-*-mingw*|*-wince|*-winmo)
+*-mingw*)
     AC_DEFINE(AVMPLUS_WIN32)
     ;;
 *-os2*)
     AC_DEFINE(AVMPLUS_OS2)
     ;;
 *)
     AC_MSG_ERROR([Unrecognized nanojit platform. Use --disable-tracejit to build without tracing JIT support.])
 esac
@@ -3773,17 +3647,17 @@ AC_CACHE_CHECK(
         )]
     )
 
 if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
     AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
 fi
 
 case $target_os in
-    darwin*|mingw*|os2*|wince*|winmo*)
+    darwin*|mingw*|os2*)
         ;;
     *)
     
 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
     AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
         AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
 _SAVE_LIBS=$LIBS
 LIBS="$LIBS $_ICONV_LIBS"
@@ -4865,27 +4739,16 @@ if test "$MOZ_MEMORY"; then
     ;;
   *-solaris*)
     AC_DEFINE(MOZ_MEMORY_SOLARIS)
     ;;
   *-mingw*)
     AC_DEFINE(MOZ_MEMORY_WINDOWS)
     # the interesting bits will get passed down in MOZ_MEMORY_LDFLAGS
     ;;
-  *-*wince)
-    AC_DEFINE(MOZ_MEMORY_WINCE)
-    AC_DEFINE(MOZ_MEMORY_WINDOWS)
-    if test -z "$WINCE_WINDOWS_MOBILE"; then
-      AC_DEFINE(MOZ_MEMORY_WINCE6)
-    fi
-    ;;
-  *-*winmo)
-    AC_DEFINE(MOZ_MEMORY_WINCE)
-    AC_DEFINE(MOZ_MEMORY_WINDOWS)
-    ;;
   *-android*)
     AC_DEFINE(MOZ_MEMORY_LINUX)
     AC_DEFINE(MOZ_MEMORY_ANDROID)
     ;;
   *)
     AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
     ;;
   esac
@@ -5547,17 +5410,17 @@ MOZ_ARG_ENABLE_BOOL(readline,
     JS_WANT_READLINE=1,
     JS_WANT_READLINE= )
 
 JS_NATIVE_EDITLINE=
 EDITLINE_LIBS=
 JS_DISABLE_SHELL=
 
 case "$target" in
-*-mingw*|*-wince*|*-winmo*)
+*-mingw*)
     NO_EDITLINE=1
     ;;
 *-symbian*)
     NO_EDITLINE=1
     JS_DISABLE_SHELL=1
     ;;
 *)
     ;;
@@ -5689,20 +5552,16 @@ AC_SUBST(MOZ_PKG_SPECIAL)
 AC_SUBST(MOZILLA_OFFICIAL)
 
 dnl win32 options
 AC_SUBST(MOZ_MAPINFO)
 AC_SUBST(MOZ_BROWSE_INFO)
 AC_SUBST(MOZ_TOOLS_DIR)
 AC_SUBST(PYTHON)
 
-AC_SUBST(WINCE)
-AC_SUBST(WINCE_SDK_DIR)
-AC_SUBST(WINCE_WINDOWS_MOBILE)
-
 dnl Echo the CFLAGS to remove extra whitespace.
 CFLAGS=`echo \
 	$_WARNINGS_CFLAGS \
 	$CFLAGS`
 
 CXXFLAGS=`echo \
 	$_MOZ_RTTI_FLAGS \
 	$_MOZ_EXCEPTIONS_FLAGS \
@@ -5840,17 +5699,17 @@ fi # COMPILE_ENVIRONMENT
 
 dnl Set various defines and substitutions
 dnl ========================================================
 
 if test "$OS_ARCH" = "Darwin"; then
   AC_DEFINE(XP_MACOSX)
   AC_DEFINE(XP_UNIX)
   AC_DEFINE(UNIX_ASYNC_DNS)
-elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
+elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2"; then
   AC_DEFINE(XP_UNIX)
   AC_DEFINE(UNIX_ASYNC_DNS)
 fi
 
 AC_ARG_ENABLE(threadsafe,
               [  --enable-threadsafe     Enable support for multiple threads.],
               [AC_DEFINE(JS_THREADSAFE)],)