Bug 97954: Allow SpiderMonkey to be built on its own, or as part of Mozilla.
authorJim Blandy <jimb@mozilla.org>
Wed, 29 Oct 2008 08:29:22 -0700
changeset 21062 8c52a9486c8f25a93063f5b628575837156f266b
parent 21061 7d7d5c7be0db78305fc47c0a0e4b7d2e80d67b0d
child 21063 14284381d56d8a392f38aef95a80dfc5a9689501
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs97954
milestone1.9.1b2pre
Bug 97954: Allow SpiderMonkey to be built on its own, or as part of Mozilla. Give SpiderMonkey its own configure script and top-level Makefile. Adjust js/src/Makefile as appropriate for life as a stand-alone makefile, instead of a 'make export; make libs'-style Mozilla tier makefile. Have the configure script accept '--with-nspr-cflags' and '--with-nspr-libs' options for using an in-tree NSPR. Also accept '--with-system-nspr', '--with-nspr-prefix', and '--with-nspr-exec-prefix' flags for using an installed NSPR. Default to --disable-jemalloc, assuming we don't have that part of the tree available; have the top-level configure script pass --enable-jemalloc as needed. Since we no longer have an export phase to copy header files into dist/include/js before we build the library, we need to be able to find nanojit.h in the nanojit directory; fix references in jsbuiltins.h and jstracer.cpp. Give SpiderMonkey it its own copies of many of the files from ./config and ./build. These are all exact copies, except as follows: . js/src/config/Makefile.in: js/src only has a subset of js/src/config, and thus a subset of the makefile targets. . js/src/config/autoconf.mk.in: js/src/configure.in has its own make variables to set, not set by the top-level configure script, so it needs a custom automake.mk template. . js/src/config/make-system-wrappers.pl: a copy from nsprpub/config, so that we can build without having an NSPR source tree handy. Invoke js/src/configure from ./configure, passing the values computed for NSPR_CFLAGS and NSPR_LIBS by the top-level configure script. Treat js/src as a static directory of the js tier, and create a new config/js (just a Makefile) to be the js tier's non-static directory. Let js/src/configure generate SpiderMonkey's makefiles, not ./configure. Generate a 'js-config' script, which clients can call to find the CFLAGS and LIBS values necessary to compile and link against an installed SpiderMonkey library. Don't include the js-config script in Macintosh packages. Teach client.mk how to rebuild js/src/configure. Tell Mercurial to ignore files generated by autoconf in js/src. Further work: . Right now, callers must define JS_THREADSAFE when #including jsapi.h. This is fixed in a subsequent patch. . js/src/configure is a trimmed copy of ./configure. It could be trimmed more.
.hgignore
client.mk
config/js/Makefile.in
config/js/build.mk
configure.in
js/src/Makefile.in
js/src/aclocal.m4
js/src/build.mk
js/src/build/autoconf/acoutput-fast.pl
js/src/build/autoconf/altoptions.m4
js/src/build/autoconf/config.guess
js/src/build/autoconf/config.sub
js/src/build/autoconf/glib.m4
js/src/build/autoconf/install-sh
js/src/build/autoconf/make-makefile
js/src/build/autoconf/match-dir.sh
js/src/build/autoconf/nspr.m4
js/src/build/autoconf/pkg.m4
js/src/build/autoconf/update-makefile.sh
js/src/build/cygwin-wrapper
js/src/build/hcc
js/src/build/hcpp
js/src/build/unix/mddepend.pl
js/src/build/unix/uniq.pl
js/src/config/Makefile.in
js/src/config/Moz/Milestone.pm
js/src/config/autoconf.mk.in
js/src/config/config.mk
js/src/config/elf-dynstr-gc.c
js/src/config/fastcwd.pl
js/src/config/gcc_hidden.h
js/src/config/insure.mk
js/src/config/make-system-wrappers.pl
js/src/config/milestone.pl
js/src/config/milestone.txt
js/src/config/mkdepend/Makefile.in
js/src/config/mkdepend/cppsetup.c
js/src/config/mkdepend/def.h
js/src/config/mkdepend/ifparser.c
js/src/config/mkdepend/ifparser.h
js/src/config/mkdepend/imakemdep.h
js/src/config/mkdepend/include.c
js/src/config/mkdepend/main.c
js/src/config/mkdepend/mkdepend.man
js/src/config/mkdepend/parse.c
js/src/config/mkdepend/pr.c
js/src/config/nfspwd.pl
js/src/config/nsinstall.c
js/src/config/nsinstall.py
js/src/config/pathsub.c
js/src/config/pathsub.h
js/src/config/preprocessor.pl
js/src/config/revdepth-nt.pl
js/src/config/revdepth.pl
js/src/config/rules.mk
js/src/config/system-headers
js/src/config/version.mk
js/src/config/version_win.pl
js/src/configure.in
js/src/js-config.in
js/src/jsbuiltins.h
js/src/jstracer.cpp
toolkit/mozapps/installer/packager.mk
toolkit/toolkit-makefiles.sh
toolkit/toolkit-tiers.mk
--- a/.hgignore
+++ b/.hgignore
@@ -21,8 +21,11 @@
 
 # Build directories
 ^obj
 
 # Build directories for js shell
 _DBG\.OBJ/
 _OPT\.OBJ/
 
+# SpiderMonkey configury
+^js/src/configure$
+^js/src/autom4te.cache$
--- a/client.mk
+++ b/client.mk
@@ -164,16 +164,17 @@ else
   MOZ_MAKE := $(MAKE) $(MOZ_MAKE_FLAGS)
 endif
 
 endif # MOZ_BUILD_PROJECTS
 
 # 'configure' scripts generated by autoconf.
 CONFIGURES := $(TOPSRCDIR)/configure
 CONFIGURES += $(TOPSRCDIR)/nsprpub/configure
+CONFIGURES += $(TOPSRCDIR)/js/src/configure
 
 #######################################################################
 # Rules
 # 
 
 # The default rule is build
 build::
 
@@ -272,16 +273,17 @@ else
 
 CONFIG_STATUS = $(wildcard $(OBJDIR)/config.status)
 CONFIG_CACHE  = $(wildcard $(OBJDIR)/config.cache)
 
 ifdef RUN_AUTOCONF_LOCALLY
 EXTRA_CONFIG_DEPS := \
 	$(TOPSRCDIR)/aclocal.m4 \
 	$(wildcard $(TOPSRCDIR)/build/autoconf/*.m4) \
+	$(TOPSRCDIR)/js/src/aclocal.m4 \
 	$(NULL)
 
 $(CONFIGURES): %: %.in $(EXTRA_CONFIG_DEPS)
 	@echo Generating $@ using autoconf
 	cd $(@D); $(AUTOCONF)
 endif
 
 CONFIG_STATUS_DEPS := \
new file mode 100644
--- /dev/null
+++ b/config/js/Makefile.in
@@ -0,0 +1,65 @@
+#
+# ***** 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. This file was copied from parts of
+# mozilla/config/Makefile.in
+#
+# The Initial Developer of the Original Code is
+# Netscape Communications Corporation.
+# Portions created by the Initial Developer are Copyright (C) 1998
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Robert Ginda <rginda@netscape.com>
+#   John Taylor <jtaylor@netscape.com>
+#   Benjamin Smedberg <benjamin@smedbergs.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 *****
+
+DEPTH = ../..
+topsrcdir = @top_srcdir@
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+JS_OBJDIR	= $(DEPTH)/js/src
+JS_CONFIG	= $(DIST)/bin/js-config
+
+include $(topsrcdir)/config/rules.mk
+
+# These rules assume that we configured js with an appropriate bindir,
+# libdir, and includedir, so that the 'make install' will put things
+# mostly in the right places.  The install-runtime-libs target takes
+# care of getting the needed libraries into the 'bin' directory as
+# well as the 'lib' directory.
+export::
+	$(MAKE) -C $(JS_OBJDIR) install
+	$(MAKE) -C $(JS_OBJDIR) install-runtime-libs libdir=$(DIST)/bin
+	$(INSTALL) $(IFLAGS2) $(JS_CONFIG) $(SDK_BIN_DIR)
+
+check::
+	$(MAKE) -C $(JS_OBJDIR) $@
new file mode 100644
--- /dev/null
+++ b/config/js/build.mk
@@ -0,0 +1,40 @@
+# ***** 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 the Mozilla build system.
+#
+# The Initial Developer of the Original Code is
+# the Mozilla Foundation <http://www.mozilla.org/>.
+# Portions created by the Initial Developer are Copyright (C) 2006
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Benjamin Smedberg <benjamin@smedbergs.us> (Initial Code)
+#
+# 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 *****
+
+TIERS += js
+tier_js_staticdirs = js/src
+tier_js_dirs = config/js
--- a/configure.in
+++ b/configure.in
@@ -8277,10 +8277,25 @@ if test -z "$MOZ_NATIVE_NSPR"; 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
 
+# Run the SpiderMonkey 'configure' script.
+dist=$MOZ_BUILD_ROOT/dist
+ac_configure_args="$_SUBDIR_CONFIG_ARGS"
+ac_configure_args="$ac_configure_args --enable-threadsafe"
+ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
+ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
+ac_configure_args="$ac_configure_args --includedir=$dist/include"
+ac_configure_args="$ac_configure_args --bindir=$dist/bin"
+ac_configure_args="$ac_configure_args --libdir=$dist/lib"
+if test "$MOZ_MEMORY"; then
+   ac_configure_args="$ac_configure_args --enable-jemalloc"  
+fi
+AC_OUTPUT_SUBDIRS(js/src)
+ac_configure_args="$_SUBDIR_CONFIG_ARGS"
+
 fi # COMPILE_ENVIRONMENT
 
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -32,20 +32,22 @@
 # 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		= ../..
+DEPTH		= .
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 
+DIRS		= config
+
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= js
 LIBRARY_NAME	= mozjs
 GRE_MODULE	= 1
 
 PROGRAM         = js$(BIN_SUFFIX)
 # The shell uses some 'HIDDEN' symbols to produce statistics, so we
@@ -162,17 +164,17 @@ CPPSRCS		= \
 		prmjtime.cpp \
 		$(NULL)
 
 ifdef HAVE_DTRACE
 CSRCS 		+= \
 		jsdtracef.c
 endif
 
-EXPORTS		= \
+INSTALLED_HEADERS = \
 		jsautocfg.h \
 		jsautokw.h \
 		js.msg \
 		jsapi.h \
 		jsarray.h \
 		jsarena.h \
 		jsatom.h \
 		jsbit.h \
@@ -216,17 +218,17 @@ EXPORTS		= \
 		jsversion.h \
 		jsxdrapi.h \
 		jsxml.h \
 		$(NULL)
 
 ifdef ENABLE_JIT
 VPATH		+= $(srcdir)/nanojit
 
-EXPORTS += \
+INSTALLED_HEADERS += \
 		builtins.tbl    \
 		jsbuiltins.h    \
 		Assembler.h     \
 		LIR.h		\
 		avmplus.h	\
 		Fragmento.h	\
 		Native.h	\
 		Native$(NANOJIT_ARCH).h \
@@ -249,24 +251,24 @@ CPPSRCS += \
 ifdef DEBUG
 CPPSRCS += TraceTreeDrawer.cpp
 endif
 
 DEFINES += -DFEATURE_NANOJIT -DJS_TRACER
 endif
 
 ifdef HAVE_DTRACE
-EXPORTS 	+= \
+INSTALLED_HEADERS += \
 		jsdtracef.h \
 		javascript-trace.h \
 		$(NULL)
 endif
 
 ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
-EXPORTS		+= jscpucfg.h
+INSTALLED_HEADERS += jscpucfg.h
 endif
 
 JS_SAFE_ARENA	= 1
 
 DASH_R		= -r
 
 ifneq (,$(filter OS2 WINCE WINNT,$(OS_ARCH)))
 SDK_LIBRARY = $(IMPORT_LIBRARY)
@@ -483,16 +485,18 @@ jsatom.o: jsatom.cpp Makefile.in
 jsdtoa.o: jsdtoa.cpp Makefile.in
 	$(REPORT_BUILD)
 	@$(MAKE_DEPS_AUTO_CXX)
 	$(CXX) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $<
 endif
 
 jsopcode.h jsopcode.cpp: jsopcode.tbl
 
+export:: jsautocfg.h
+
 ifeq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH)))
 jsautocfg.h:
 	touch $@
 else
 ifeq ($(OS_ARCH),WINCE)
 jsautocfg.h:
 	touch $@
 else
@@ -543,16 +547,74 @@ ifeq ($(OS_ARCH),WINCE)
 jscpucfg$(HOST_BIN_SUFFIX):
 	echo no need to build jscpucfg $<
 else
 jscpucfg$(HOST_BIN_SUFFIX): jscpucfg.cpp Makefile.in
 	$(HOST_CXX) $(HOST_CXXFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) $(HOST_OUTOPTION)$@ $<
 endif
 endif
 
+# Compute the linker flags that programs linking against SpiderMonkey should
+# pass to get SpiderMonkey and its dependencies, beyond just the -L and -l
+# for the SpiderMonkey library itself.
+# - EXTRA_DSO_LDOPTS includes the NSPR -L and -l flags.
+# - OS_LIBS includes libraries selected by the configure script.
+# - EXTRA_LIBS includes libraries selected by this Makefile.
+JS_CONFIG_LIBS=$(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) 
+
+# The configure script invokes this rule explicitly at configure time!
+# It's important that js-config be ready by the time we're done
+# configuring, because we may be running other configure scripts that
+# would like to run js-config themselves, before js is built.
+#
+# This file and rules.mk go through a certain amount of work to decide
+# which libraries to build, what to name them, and what flags to pass
+# when linking them (and thus what flags its own clients must pass).
+# All this information needs to go into the js-config script.  To
+# avoid trying to re-compute all that in the configure script, we just
+# have the configure script generate this Makefile, and then invoke
+# this rule.
+at=@
+js-config: js-config.in Makefile $(DEPTH)/config/autoconf.mk $(topsrcdir)/config/config.mk $(topsrcdir)/config/rules.mk
+	rm -f js-config.tmp
+	sed < $< > js-config.tmp \
+	-e 's|$(at)prefix$(at)|$(prefix)|' \
+	-e 's|$(at)exec_prefix$(at)|$(exec_prefix)|' \
+	-e 's|$(at)includedir$(at)|$(includedir)|' \
+	-e 's|$(at)libdir$(at)|$(libdir)|' \
+	-e 's|$(at)MOZILLA_VERSION$(at)|$(MOZILLA_VERSION)|' \
+	-e 's|$(at)LIBRARY_NAME$(at)|$(LIBRARY_NAME)|' \
+	-e 's|$(at)NSPR_CFLAGS$(at)|$(NSPR_CFLAGS)|' \
+	-e 's|$(at)JS_CONFIG_LIBS$(at)|$(JS_CONFIG_LIBS)|' \
+	-e 's|$(at)MOZ_JS_LIBS$(at)|$(MOZ_JS_LIBS)|' \
+	&& mv js-config.tmp $@ && chmod +x $@
+
+SCRIPTS = js-config
+
+install:: $(INSTALLED_HEADERS)
+	$(SYSINSTALL) $(IFLAGS1) $^ $(includedir)/$(MODULE)
+
+install:: $(SCRIPTS) $(PROGRAM)
+	$(SYSINSTALL) $(IFLAGS2) $^ $(bindir)
+
+# The Mozilla top-level makefiles use install-runtime-libs directly to
+# place an additional copy of the libraries in the 'dist/bin'
+# directory.
+install:: install-runtime-libs
+install-runtime-libs:: $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
+ifneq (,$(LIBRARY))
+	$(SYSINSTALL) $(IFLAGS1) $(LIBRARY) $(libdir)
+endif
+ifneq (,$(SHARED_LIBRARY))
+	$(SYSINSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(libdir)
+endif
+ifneq (,$(IMPORT_LIBRARY))
+	$(SYSINSTALL) $(IFLAGS2) $(IMPORT_LIBRARY) $(libdir)
+endif
+
 # Extra dependancies and rules for auto-generated headers
 host_jskwgen.$(OBJ_SUFFIX): jsversion.h jskeyword.tbl
 
 jsautokw.h: host_jskwgen$(HOST_BIN_SUFFIX)
 	./host_jskwgen$(HOST_BIN_SUFFIX) $@
 
 host_jsoplengen.$(OBJ_SUFFIX): jsopcode.tbl
 
new file mode 100644
--- /dev/null
+++ b/js/src/aclocal.m4
@@ -0,0 +1,10 @@
+dnl
+dnl Local autoconf macros used with mozilla
+dnl The contents of this file are under the Public Domain.
+dnl 
+
+builtin(include, build/autoconf/glib.m4)dnl
+builtin(include, build/autoconf/pkg.m4)dnl
+builtin(include, build/autoconf/nspr.m4)dnl
+builtin(include, build/autoconf/altoptions.m4)dnl
+
deleted file mode 100644
--- a/js/src/build.mk
+++ /dev/null
@@ -1,42 +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 the Mozilla build system.
-#
-# The Initial Developer of the Original Code is
-# the Mozilla Foundation <http://www.mozilla.org/>.
-# Portions created by the Initial Developer are Copyright (C) 2006
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Benjamin Smedberg <benjamin@smedbergs.us> (Initial Code)
-#
-# 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 *****
-
-TIERS += js
-
-tier_js_dirs += \
-	js/src \
-	$(NULL)
old mode 100755
new mode 100644
copy from build/autoconf/acoutput-fast.pl
copy to js/src/build/autoconf/acoutput-fast.pl
copy from build/autoconf/altoptions.m4
copy to js/src/build/autoconf/altoptions.m4
old mode 100755
new mode 100644
copy from build/autoconf/config.guess
copy to js/src/build/autoconf/config.guess
old mode 100755
new mode 100644
copy from build/autoconf/config.sub
copy to js/src/build/autoconf/config.sub
copy from build/autoconf/glib.m4
copy to js/src/build/autoconf/glib.m4
old mode 100755
new mode 100644
copy from build/autoconf/install-sh
copy to js/src/build/autoconf/install-sh
old mode 100755
new mode 100644
copy from build/autoconf/make-makefile
copy to js/src/build/autoconf/make-makefile
old mode 100755
new mode 100644
copy from build/autoconf/match-dir.sh
copy to js/src/build/autoconf/match-dir.sh
copy from build/autoconf/nspr.m4
copy to js/src/build/autoconf/nspr.m4
copy from build/autoconf/pkg.m4
copy to js/src/build/autoconf/pkg.m4
old mode 100755
new mode 100644
copy from build/autoconf/update-makefile.sh
copy to js/src/build/autoconf/update-makefile.sh
old mode 100755
new mode 100644
copy from build/cygwin-wrapper
copy to js/src/build/cygwin-wrapper
old mode 100755
new mode 100644
copy from build/hcc
copy to js/src/build/hcc
old mode 100755
new mode 100644
copy from build/hcpp
copy to js/src/build/hcpp
old mode 100755
new mode 100644
copy from build/unix/mddepend.pl
copy to js/src/build/unix/mddepend.pl
old mode 100755
new mode 100644
copy from build/unix/uniq.pl
copy to js/src/build/unix/uniq.pl
copy from config/Makefile.in
copy to js/src/config/Makefile.in
--- a/config/Makefile.in
+++ b/js/src/config/Makefile.in
@@ -85,90 +85,37 @@ endif
 
 include $(topsrcdir)/config/config.mk
 
 # Do not install util programs
 NO_INSTALL=1
 
 include $(topsrcdir)/config/rules.mk
 
-ifeq ($(OS_CONFIG),SunOS4.1)
-NSPR_CFLAGS	+= -I$(srcdir)/../nsprpub/pr/include/md
-endif
-
-HEADERS = \
-	$(DEPTH)/mozilla-config.h \
-	$(srcdir)/nsStaticComponents.h \
-	$(NULL)
-
-export:: $(TARGETS) $(HEADERS)
-	$(INSTALL) $(IFLAGS1) $(HEADERS) $(DIST)/include
-	-rm -f $(FINAL_LINK_COMPS) $(FINAL_LINK_LIBS) $(FINAL_LINK_COMP_NAMES)
-	-rm -f $(DIST)/bin/chrome/chromelist.txt
+export:: $(TARGETS)
 ifdef HOST_PROGRAM
 	$(INSTALL) $(HOST_PROGRAM) $(DIST)/bin
 endif
 
-# Generate a new buildid every time we "export" in config... that's only
-# supposed to be once per-build!
-export::
-ifdef MOZ_BUILD_DATE
-	printf "%s" $(MOZ_BUILD_DATE) > buildid
-else
-	$(PYTHON) $(topsrcdir)/toolkit/xre/make-platformini.py --print-buildid > buildid
-endif
-
 ifdef WRAP_SYSTEM_INCLUDES
 export::
 	if test ! -d system_wrappers; then mkdir system_wrappers; fi
-	$(PERL) $(topsrcdir)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) \
+	$(PERL) $(srcdir)/preprocessor.pl $(DEFINES) $(ACDEFINES) \
 		-DBUILD_STATIC_LIBS=$(BUILD_STATIC_LIBS) \
-		-DMOZ_TREE_CAIRO=$(MOZ_TREE_CAIRO) \
-		-DMOZ_ENABLE_LIBXUL=$(MOZ_ENABLE_LIBXUL) \
-		-DMOZ_NATIVE_HUNSPELL=$(MOZ_NATIVE_HUNSPELL) \
-		-DMOZ_NATIVE_BZ2=$(MOZ_NATIVE_BZ2) \
-		-DMOZ_NATIVE_ZLIB=$(MOZ_NATIVE_ZLIB) \
-		-DMOZ_NATIVE_PNG=$(MOZ_NATIVE_PNG) \
-		-DMOZ_NATIVE_JPEG=$(MOZ_NATIVE_JPEG) \
-		-DMOZ_NATIVE_LCMS=$(MOZ_NATIVE_LCMS) \
-		$(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
+		$(srcdir)/system-headers | $(PERL) $(srcdir)/make-system-wrappers.pl system_wrappers
 	$(INSTALL) system_wrappers $(DIST)/include
 
 GARBAGE_DIRS += system_wrappers
 endif
 
-install::
-	$(SYSINSTALL) $(IFLAGS1) $(DEPTH)/mozilla-config.h $(DESTDIR)$(includedir)
-
-GARBAGE += \
-	$(FINAL_LINK_COMPS) $(FINAL_LINK_LIBS) $(FINAL_LINK_COMP_NAMES) buildid $(srcdir)/*.pyc
-
 ifndef CROSS_COMPILE
 ifdef USE_ELF_DYNSTR_GC
 elf-dynstr-gc: elf-dynstr-gc.c Makefile Makefile.in
 	$(CC) $(COMPILE_CFLAGS) $(GLIB_CFLAGS) -o $@ $< $(LDFLAGS) $(GLIB_LIBS) 
 endif
 endif
 
 FORCE:
 
 ifdef MKDEPEND_DIR
 clean clobber realclean clobber_all::
 	cd $(MKDEPEND_DIR); $(MAKE) $@
 endif
-
-PYUNITS := unit-Expression.py unit-Preprocessor.py
-
-check:: check-preprocessor check-jar-mn
-
-check-preprocessor::
-	@$(EXIT_ON_ERROR) \
-	for test in $(PYUNITS); do \
-	  $(PYTHON) $(srcdir)/tests/$$test ; \
-	done
-
-check-jar-mn::
-	make -C tests/src-simple check-jar
-	make -C tests/src-simple check-flat
-	make -C tests/src-simple check-flat USE_EXTENSION_MANIFEST=1
-ifneq ($(OS_ARCH), WINNT)
-	make -C tests/src-simple check-symlink
-endif
old mode 100755
new mode 100644
copy from config/Moz/Milestone.pm
copy to js/src/config/Moz/Milestone.pm
copy from config/autoconf.mk.in
copy to js/src/config/autoconf.mk.in
--- a/config/autoconf.mk.in
+++ b/js/src/config/autoconf.mk.in
@@ -40,54 +40,36 @@
 
 INCLUDED_AUTOCONF_MK = 1
 USE_AUTOCONF 	= 1
 MOZILLA_CLIENT	= 1
 target          = @target@
 ac_configure_args = @ac_configure_args@
 BUILD_MODULES	= @BUILD_MODULES@
 MOZILLA_VERSION = @MOZILLA_VERSION@
-FIREFOX_VERSION	= @FIREFOX_VERSION@
 
 MOZ_BUILD_APP = @MOZ_BUILD_APP@
 MOZ_APP_NAME	= @MOZ_APP_NAME@
 MOZ_APP_DISPLAYNAME = @MOZ_APP_DISPLAYNAME@
 MOZ_APP_VERSION = @MOZ_APP_VERSION@
 
 MOZ_PKG_SPECIAL = @MOZ_PKG_SPECIAL@
 
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
 bindir		= @bindir@
-includedir	= @includedir@/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
+includedir	= @includedir@
 libdir		= @libdir@
 datadir		= @datadir@
 mandir		= @mandir@
-idldir		= $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
 
 installdir	= $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
 sdkdir		= $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
 
 DIST		= $(DEPTH)/dist
-LIBXUL_SDK      = @LIBXUL_SDK@
-
-L10NBASEDIR     = @L10NBASEDIR@
-
-LIBXUL_DIST	= @LIBXUL_DIST@
-
-XULRUNNER_STUB_NAME = @XULRUNNER_STUB_NAME@
-
-MOZ_CHROME_FILE_FORMAT	= @MOZ_CHROME_FILE_FORMAT@
-
-MOZ_WIDGET_TOOLKIT	= @MOZ_WIDGET_TOOLKIT@
-MOZ_GFX_TOOLKIT		= @MOZ_GFX_TOOLKIT@
-MOZ_DFB			= @MOZ_DFB@
-MOZ_X11			= @MOZ_X11@
-
-MOZ_PANGO = @MOZ_PANGO@
 
 MOZ_JS_LIBS		   = @MOZ_JS_LIBS@
 
 MOZ_DEBUG	= @MOZ_DEBUG@
 MOZ_DEBUG_MODULES = @MOZ_DEBUG_MODULES@
 MOZ_PROFILE_MODULES = @MOZ_PROFILE_MODULES@
 MOZ_DEBUG_ENABLE_DEFS		= @MOZ_DEBUG_ENABLE_DEFS@
 MOZ_DEBUG_DISABLE_DEFS	= @MOZ_DEBUG_DISABLE_DEFS@
@@ -102,79 +84,28 @@ MOZ_PERF_METRICS = @MOZ_PERF_METRICS@
 MOZ_LEAKY	= @MOZ_LEAKY@
 MOZ_MEMORY      = @MOZ_MEMORY@
 MOZ_JPROF       = @MOZ_JPROF@
 MOZ_SHARK       = @MOZ_SHARK@
 MOZ_CALLGRIND   = @MOZ_CALLGRIND@
 MOZ_VTUNE       = @MOZ_VTUNE@
 DEHYDRA_PATH    = @DEHYDRA_PATH@
 
-MOZ_XPCTOOLS    = @MOZ_XPCTOOLS@
 ENABLE_EAZEL_PROFILER=@ENABLE_EAZEL_PROFILER@
 EAZEL_PROFILER_CFLAGS=@EAZEL_PROFILER_CFLAGS@
 EAZEL_PROFILER_LIBS=@EAZEL_PROFILER_LIBS@
 GC_LEAK_DETECTOR = @GC_LEAK_DETECTOR@
 NS_TRACE_MALLOC = @NS_TRACE_MALLOC@
 USE_ELF_DYNSTR_GC = @USE_ELF_DYNSTR_GC@
 INCREMENTAL_LINKER = @INCREMENTAL_LINKER@
 MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@
-MOZ_MAIL_NEWS	= @MOZ_MAIL_NEWS@
-MOZ_CALENDAR	= @MOZ_CALENDAR@
-MOZ_PLAINTEXT_EDITOR_ONLY = @MOZ_PLAINTEXT_EDITOR_ONLY@
 BUILD_STATIC_LIBS = @BUILD_STATIC_LIBS@
-MOZ_ENABLE_LIBXUL = @MOZ_ENABLE_LIBXUL@
 ENABLE_TESTS	= @ENABLE_TESTS@
-IBMBIDI = @IBMBIDI@
-MOZ_UNIVERSALCHARDET = @MOZ_UNIVERSALCHARDET@
-ACCESSIBILITY = @ACCESSIBILITY@
-MOZ_VIEW_SOURCE = @MOZ_VIEW_SOURCE@
-MOZ_XPINSTALL = @MOZ_XPINSTALL@
-MOZ_JSLOADER  = @MOZ_JSLOADER@
-MOZ_USE_NATIVE_UCONV = @MOZ_USE_NATIVE_UCONV@
-MOZ_BRANDING_DIRECTORY = @MOZ_BRANDING_DIRECTORY@
-XPCOM_USE_LEA = @XPCOM_USE_LEA@
 JS_ULTRASPARC_OPTS = @JS_ULTRASPARC_OPTS@
 JS_STATIC_BUILD = @JS_STATIC_BUILD@
-MOZ_ENABLE_POSTSCRIPT = @MOZ_ENABLE_POSTSCRIPT@
-MOZ_INSTALLER	= @MOZ_INSTALLER@
-MOZ_UPDATER	= @MOZ_UPDATER@
-MOZ_UPDATE_PACKAGING	= @MOZ_UPDATE_PACKAGING@
-MOZ_NO_ACTIVEX_SUPPORT = @MOZ_NO_ACTIVEX_SUPPORT@
-MOZ_ACTIVEX_SCRIPTING_SUPPORT = @MOZ_ACTIVEX_SCRIPTING_SUPPORT@
-MOZ_DISABLE_VISTA_SDK_REQUIREMENTS = @MOZ_DISABLE_VISTA_SDK_REQUIREMENTS@
-MOZ_DISABLE_PARENTAL_CONTROLS = @MOZ_DISABLE_PARENTAL_CONTROLS@
-XPC_IDISPATCH_SUPPORT = @XPC_IDISPATCH_SUPPORT@
-MOZ_SPELLCHECK = @MOZ_SPELLCHECK@
-MOZ_XPFE_COMPONENTS = @MOZ_XPFE_COMPONENTS@
-MOZ_IPCD = @MOZ_IPCD@
-MOZ_PROFILESHARING = @MOZ_PROFILESHARING@
-MOZ_PROFILELOCKING = @MOZ_PROFILELOCKING@
-MOZ_FEEDS = @MOZ_FEEDS@
-MOZ_PLACES = @MOZ_PLACES@
-MOZ_PLACES_BOOKMARKS = @MOZ_PLACES_BOOKMARKS@
-MOZ_STORAGE = @MOZ_STORAGE@
-MOZ_SAFE_BROWSING = @MOZ_SAFE_BROWSING@
-MOZ_URL_CLASSIFIER = @MOZ_URL_CLASSIFIER@
-MOZ_ZIPWRITER = @MOZ_ZIPWRITER@
-MOZ_MORK = @MOZ_MORK@
-MOZ_MORKREADER = @MOZ_MORKREADER@
-MOZ_NO_XPCOM_OBSOLETE = @MOZ_NO_XPCOM_OBSOLETE@
-MOZ_NO_FAST_LOAD = @MOZ_NO_FAST_LOAD@
-MOZ_OGG = @MOZ_OGG@
-MOZ_MEDIA = @MOZ_MEDIA@
-NS_PRINTING = @NS_PRINTING@
-MOZ_CRASHREPORTER = @MOZ_CRASHREPORTER@
-MOZ_HELP_VIEWER = @MOZ_HELP_VIEWER@
-MOC= @MOC@
-
-MOZ_JAVAXPCOM = @MOZ_JAVAXPCOM@
-JAVA_INCLUDE_PATH="@JAVA_INCLUDE_PATH@"
-JAVA="@JAVA@"
-JAVAC="@JAVAC@"
-JAR="@JAR@"
 
 TAR=@TAR@
 
 # The MOZ_UI_LOCALE var is used to build a particular locale. Do *not*
 # use the var to change any binary files. Do *not* use this var unless you
 # write rules for the "clean-locale" and "locale" targets.
 MOZ_UI_LOCALE = @MOZ_UI_LOCALE@
 
@@ -185,103 +116,41 @@ MOZ_FIX_LINK_PATHS=@MOZ_FIX_LINK_PATHS@
 
 XPCOM_FROZEN_LDOPTS=@XPCOM_FROZEN_LDOPTS@
 XPCOM_LIBS=@XPCOM_LIBS@
 MOZ_TIMELINE=@MOZ_TIMELINE@
 
 ENABLE_STRIP	= @ENABLE_STRIP@
 PKG_SKIP_STRIP	= @PKG_SKIP_STRIP@
 
-ClientWallet=1
-CookieManagement=1
-SingleSignon=1
-
-MOZ_OJI		= @MOZ_OJI@
-MOZ_PLUGINS	= @MOZ_PLUGINS@
-
 MOZ_POST_DSO_LIB_COMMAND = @MOZ_POST_DSO_LIB_COMMAND@
 MOZ_POST_PROGRAM_COMMAND = @MOZ_POST_PROGRAM_COMMAND@
 
 MOZ_BUILD_ROOT             = @MOZ_BUILD_ROOT@
 
-MOZ_XUL                    = @MOZ_XUL@
-MOZ_RDF                    = @MOZ_RDF@
-
-NECKO_PROTOCOLS = @NECKO_PROTOCOLS@
-NECKO_DISK_CACHE = @NECKO_DISK_CACHE@
-NECKO_SMALL_BUFFERS = @NECKO_SMALL_BUFFERS@
-NECKO_COOKIES = @NECKO_COOKIES@
-MOZ_AUTH_EXTENSION = @MOZ_AUTH_EXTENSION@
-
-MOZ_NATIVE_HUNSPELL = @SYSTEM_HUNSPELL@
-MOZ_HUNSPELL_LIBS = @MOZ_HUNSPELL_LIBS@
-MOZ_HUNSPELL_CFLAGS = @MOZ_HUNSPELL_CFLAGS@
-
-MOZ_NATIVE_ZLIB	= @SYSTEM_ZLIB@
-MOZ_NATIVE_BZ2	= @SYSTEM_BZ2@
-MOZ_NATIVE_JPEG	= @SYSTEM_JPEG@
-MOZ_NATIVE_PNG	= @SYSTEM_PNG@
-MOZ_TREE_CAIRO = @MOZ_TREE_CAIRO@
-
-MOZ_UPDATE_XTERM = @MOZ_UPDATE_XTERM@
-MOZ_MATHML = @MOZ_MATHML@
-MOZ_PERMISSIONS = @MOZ_PERMISSIONS@
-MOZ_XTF = @MOZ_XTF@
-MOZ_NO_INSPECTOR_APIS = @MOZ_NO_INSPECTOR_APIS@
-MOZ_SVG = @MOZ_SVG@
-MOZ_LIBART_CFLAGS = @MOZ_LIBART_CFLAGS@
-MOZ_ENABLE_CANVAS = @MOZ_ENABLE_CANVAS@
-MOZ_CAIRO_CFLAGS = @MOZ_CAIRO_CFLAGS@
-MOZ_XSLT_STANDALONE = @MOZ_XSLT_STANDALONE@
-
-MOZ_PREF_EXTENSIONS = @MOZ_PREF_EXTENSIONS@
-
-MOZ_CAIRO_LIBS = @MOZ_CAIRO_LIBS@
-
-MOZ_ENABLE_GNOMEUI = @MOZ_ENABLE_GNOMEUI@
-MOZ_GNOMEUI_CFLAGS = @MOZ_GNOMEUI_CFLAGS@
-MOZ_GNOMEUI_LIBS = @MOZ_GNOMEUI_LIBS@
-
-MOZ_ENABLE_STARTUP_NOTIFICATION = @MOZ_ENABLE_STARTUP_NOTIFICATION@
-MOZ_STARTUP_NOTIFICATION_CFLAGS = @MOZ_STARTUP_NOTIFICATION_CFLAGS@
-MOZ_STARTUP_NOTIFICATION_LIBS = @MOZ_STARTUP_NOTIFICATION_LIBS@
-
-MOZ_GNOMEVFS_CFLAGS = @MOZ_GNOMEVFS_CFLAGS@
-MOZ_GNOMEVFS_LIBS = @MOZ_GNOMEVFS_LIBS@
-
-MOZ_ENABLE_GCONF = @MOZ_ENABLE_GCONF@
-MOZ_GCONF_CFLAGS = @MOZ_GCONF_CFLAGS@
-MOZ_GCONF_LIBS = @MOZ_GCONF_LIBS@
-
-MOZ_LIBGNOME_CFLAGS = @MOZ_LIBGNOME_CFLAGS@
-MOZ_LIBGNOME_LIBS = @MOZ_LIBGNOME_LIBS@
-
-MOZ_ENABLE_GNOME_COMPONENT = @MOZ_ENABLE_GNOME_COMPONENT@
-
 MOZ_INSURE = @MOZ_INSURE@
 MOZ_INSURIFYING = @MOZ_INSURIFYING@
 MOZ_INSURE_DIRS = @MOZ_INSURE_DIRS@
 MOZ_INSURE_EXCLUDE_DIRS = @MOZ_INSURE_EXCLUDE_DIRS@
 
 MOZ_NATIVE_NSPR = @MOZ_NATIVE_NSPR@
-MOZ_NATIVE_NSS = @MOZ_NATIVE_NSS@
 
 CROSS_COMPILE   = @CROSS_COMPILE@
 
 WCHAR_CFLAGS	= @WCHAR_CFLAGS@
 
 OS_CPPFLAGS	= @CPPFLAGS@
 OS_CFLAGS	= $(OS_CPPFLAGS) @CFLAGS@
 OS_CXXFLAGS	= $(OS_CPPFLAGS) @CXXFLAGS@
 OS_LDFLAGS	= @LDFLAGS@
 
 OS_COMPILE_CFLAGS = $(OS_CPPFLAGS) @COMPILE_CFLAGS@
 OS_COMPILE_CXXFLAGS = $(OS_CPPFLAGS) @COMPILE_CXXFLAGS@
 
-OS_INCLUDES	= $(NSPR_CFLAGS) $(JPEG_CFLAGS) $(PNG_CFLAGS) $(ZLIB_CFLAGS) $(LCMS_CFLAGS)
+OS_INCLUDES	= $(NSPR_CFLAGS)
 OS_LIBS		= @LIBS@
 ACDEFINES	= @MOZ_DEFINES@
 
 WARNINGS_AS_ERRORS = @WARNINGS_AS_ERRORS@
 
 MOZ_OPTIMIZE	= @MOZ_OPTIMIZE@
 MOZ_OPTIMIZE_FLAGS = @MOZ_OPTIMIZE_FLAGS@
 MOZ_OPTIMIZE_LDFLAGS = @MOZ_OPTIMIZE_LDFLAGS@
@@ -290,20 +159,16 @@ MOZ_OPTIMIZE_SIZE_TWEAK = @MOZ_OPTIMIZE_
 MOZ_RTTI_FLAGS_ON = @_MOZ_RTTI_FLAGS_ON@
 
 MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE = @MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE@
 PROFILE_GEN_CFLAGS = @PROFILE_GEN_CFLAGS@
 PROFILE_GEN_LDFLAGS = @PROFILE_GEN_LDFLAGS@
 PROFILE_USE_CFLAGS = @PROFILE_USE_CFLAGS@
 PROFILE_USE_LDFLAGS = @PROFILE_USE_LDFLAGS@
 
-XCFLAGS		= @XCFLAGS@
-XLDFLAGS	= @XLDFLAGS@
-XLIBS		= @XLIBS@
-
 WIN_TOP_SRC	= @WIN_TOP_SRC@
 CYGWIN_WRAPPER	= @CYGWIN_WRAPPER@
 AS_PERL         = @AS_PERL@
 CYGDRIVE_MOUNT	= @CYGDRIVE_MOUNT@
 AR		= @AR@
 AR_FLAGS	= @AR_FLAGS@
 AR_EXTRACT	= @AR_EXTRACT@
 AR_LIST		= @AR_LIST@
@@ -360,20 +225,16 @@ HOST_CXXFLAGS	= @HOST_CXXFLAGS@
 HOST_OPTIMIZE_FLAGS = @HOST_OPTIMIZE_FLAGS@
 HOST_NSPR_MDCPUCFG = @HOST_NSPR_MDCPUCFG@
 HOST_AR		= @HOST_AR@
 HOST_AR_FLAGS	= @HOST_AR_FLAGS@
 HOST_LD		= @HOST_LD@
 HOST_RANLIB	= @HOST_RANLIB@
 HOST_BIN_SUFFIX	= @HOST_BIN_SUFFIX@
 
-HOST_LIBIDL_CONFIG = @HOST_LIBIDL_CONFIG@
-HOST_LIBIDL_CFLAGS = @HOST_LIBIDL_CFLAGS@
-HOST_LIBIDL_LIBS   = @HOST_LIBIDL_LIBS@
-
 HOST_OS_ARCH	= @HOST_OS_ARCH@
 host_cpu	= @host_cpu@
 host_vendor	= @host_vendor@
 host_os		= @host_os@
 
 TARGET_NSPR_MDCPUCFG = @TARGET_NSPR_MDCPUCFG@
 TARGET_CPU	= @TARGET_CPU@
 TARGET_VENDOR	= @TARGET_VENDOR@
@@ -390,93 +251,23 @@ UNZIP		= @UNZIP@
 ZIP		= @ZIP@
 XARGS		= @XARGS@
 STRIP		= @STRIP@
 DOXYGEN		= @DOXYGEN@
 MAKE		= @MAKE@
 PBBUILD_BIN	= @PBBUILD@
 SDP		= @SDP@
 NSINSTALL_BIN	= @NSINSTALL_BIN@
-WGET		= @WGET@
-
-ifdef MOZ_NATIVE_JPEG
-JPEG_CFLAGS	= @JPEG_CFLAGS@
-JPEG_LIBS	= @JPEG_LIBS@
-JPEG_REQUIRES	=
-else
-JPEG_CFLAGS	= @MOZ_JPEG_CFLAGS@
-JPEG_LIBS	= @MOZ_JPEG_LIBS@
-JPEG_REQUIRES	= jpeg
-endif
-
-ifdef MOZ_NATIVE_ZLIB
-ZLIB_CFLAGS	= @ZLIB_CFLAGS@
-ZLIB_LIBS	= @ZLIB_LIBS@
-ZLIB_REQUIRES	=
-else
-ZLIB_CFLAGS	= @MOZ_ZLIB_CFLAGS@
-ifdef MOZ_ENABLE_LIBXUL
-MOZ_ZLIB_LIBS = @MOZ_ZLIB_LIBS@
-else
-ZLIB_LIBS = @MOZ_ZLIB_LIBS@
-endif
-ZLIB_REQUIRES	= zlib
-endif
-
-ifdef MOZ_NATIVE_BZ2
-BZ2_CFLAGS	= @BZ2_CFLAGS@
-BZ2_LIBS	= @BZ2_LIBS@
-BZ2_REQUIRES	=
-else
-BZ2_CFLAGS	= @MOZ_BZ2_CFLAGS@
-BZ2_LIBS	= @MOZ_BZ2_LIBS@
-BZ2_REQUIRES	= libbz2
-endif
-
-ifdef MOZ_NATIVE_PNG
-PNG_CFLAGS	= @PNG_CFLAGS@
-PNG_LIBS	= @PNG_LIBS@
-PNG_REQUIRES	=
-else
-PNG_CFLAGS	= @MOZ_PNG_CFLAGS@
-PNG_LIBS	= @MOZ_PNG_LIBS@
-PNG_REQUIRES	= png
-endif
-
-MOZ_NATIVE_LCMS	= @MOZ_NATIVE_LCMS@
-LCMS_CFLAGS	= @LCMS_CFLAGS@
-LCMS_LIBS	= @LCMS_LIBS@
-ifdef MOZ_NATIVE_LCMS
-LCMS_REQUIRES	=
-else
-LCMS_REQUIRES	= lcms
-endif
-
-MOZ_NATIVE_SQLITE = @MOZ_NATIVE_SQLITE@
-SQLITE_CFLAGS     = @SQLITE_CFLAGS@
-SQLITE_LIBS       = @SQLITE_LIBS@
 
 NSPR_CONFIG	= @NSPR_CONFIG@
 NSPR_CFLAGS	= @NSPR_CFLAGS@
 NSPR_LIBS	= @NSPR_LIBS@
 
-NSS_CONFIG	= @NSS_CONFIG@
-NSS_CFLAGS	= @NSS_CFLAGS@
-NSS_LIBS	= @NSS_LIBS@
-NSS_DEP_LIBS	= @NSS_DEP_LIBS@
-
-XPCOM_GLUE_LDOPTS = @XPCOM_GLUE_LDOPTS@
-XPCOM_STANDALONE_GLUE_LDOPTS = @XPCOM_STANDALONE_GLUE_LDOPTS@
-MOZ_XPCOM_OBSOLETE_LIBS = @MOZ_XPCOM_OBSOLETE_LIBS@
-
 USE_DEPENDENT_LIBS = @USE_DEPENDENT_LIBS@
 
-# UNIX98 iconv support
-LIBICONV = @LIBICONV@
-
 # MKSHLIB_FORCE_ALL is used to force the linker to include all object
 # files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker
 # to normal behavior. Makefile's that create shared libraries out of
 # archives use these flags to force in all of the .o files in the
 # archives into the shared library.
 WRAP_MALLOC_LIB         = @WRAP_MALLOC_LIB@
 WRAP_MALLOC_CFLAGS      = @WRAP_MALLOC_CFLAGS@
 DSO_CFLAGS              = @DSO_CFLAGS@
@@ -485,61 +276,22 @@ MKSHLIB                 = @MKSHLIB@
 MKCSHLIB                = @MKCSHLIB@
 MKSHLIB_FORCE_ALL       = @MKSHLIB_FORCE_ALL@
 MKSHLIB_UNFORCE_ALL     = @MKSHLIB_UNFORCE_ALL@
 DSO_LDOPTS              = @DSO_LDOPTS@
 DLL_SUFFIX              = @DLL_SUFFIX@
 
 NO_LD_ARCHIVE_FLAGS     = @NO_LD_ARCHIVE_FLAGS@
 
-GTK_CONFIG	= @GTK_CONFIG@
-QT_CONFIG	= @QT_CONFIG@
-TK_CFLAGS	= @TK_CFLAGS@
-TK_LIBS		= @TK_LIBS@
-
 MOZ_TOOLKIT_REGISTRY_CFLAGS = \
 	$(TK_CFLAGS)
 
-CAIRO_FT_CFLAGS		= @CAIRO_FT_CFLAGS@
-
-MOZ_ENABLE_CAIRO_FT	= @MOZ_ENABLE_CAIRO_FT@
-MOZ_ENABLE_GTK2		= @MOZ_ENABLE_GTK2@
-MOZ_ENABLE_QT		= @MOZ_ENABLE_QT@
-MOZ_ENABLE_PHOTON	= @MOZ_ENABLE_PHOTON@
-MOZ_ENABLE_COCOA	= @MOZ_ENABLE_COCOA@
-MOZ_ENABLE_XREMOTE	= @MOZ_ENABLE_XREMOTE@
-
-MOZ_GTK2_CFLAGS		= @MOZ_GTK2_CFLAGS@
-MOZ_GTK2_LIBS		= @MOZ_GTK2_LIBS@
-
-MOZ_QT_CFLAGS		= @MOZ_QT_CFLAGS@
-MOZ_QT_LIBS		= @MOZ_QT_LIBS@
-
-MOZ_DBUS_GLIB_CFLAGS    = @MOZ_DBUS_GLIB_CFLAGS@
-MOZ_DBUS_GLIB_LIBS      = @MOZ_DBUS_GLIB_LIBS@
-MOZ_ENABLE_DBUS         = @MOZ_ENABLE_DBUS@
-
-MOZ_GTHREAD_CFLAGS      = @MOZ_GTHREAD_CFLAGS@
-MOZ_GTHREAD_LIBS        = @MOZ_GTHREAD_LIBS@
-
-FT2_CFLAGS             = @FT2_CFLAGS@
-FT2_LIBS               = @FT2_LIBS@
-
-MOZ_PANGO_CFLAGS        = @MOZ_PANGO_CFLAGS@
-MOZ_PANGO_LIBS          = @MOZ_PANGO_LIBS@
-
-MOZ_XIE_LIBS		= @MOZ_XIE_LIBS@
-XT_LIBS			= @XT_LIBS@
-
 GLIB_CFLAGS	= @GLIB_CFLAGS@
 GLIB_LIBS	= @GLIB_LIBS@
 GLIB_GMODULE_LIBS	= @GLIB_GMODULE_LIBS@
-LIBIDL_CFLAGS = @LIBIDL_CFLAGS@
-LIBIDL_LIBS = @LIBIDL_LIBS@
-STATIC_LIBIDL = @STATIC_LIBIDL@
 
 MOZ_NATIVE_MAKEDEPEND	= @SYSTEM_MAKEDEPEND@
 
 # Used for LD_LIBRARY_PATH
 LIBS_PATH       = @LIBS_PATH@
 
 MOZ_AUTO_DEPS	= @MOZ_AUTO_DEPS@
 COMPILER_DEPEND = @COMPILER_DEPEND@
@@ -561,25 +313,16 @@ TARGET_DEVICE = @TARGET_DEVICE@
 # For AIX build
 AIX_OBJMODEL = @AIX_OBJMODEL@
 
 # For OS/2 build
 MOZ_OS2_TOOLS = @MOZ_OS2_TOOLS@
 MOZ_OS2_USE_DECLSPEC = @MOZ_OS2_USE_DECLSPEC@
 MOZ_OS2_HIGH_MEMORY = @MOZ_OS2_HIGH_MEMORY@
 
-HAVE_XIE=@HAVE_XIE@
-
-MOZ_MOVEMAIL=@MOZ_MOVEMAIL@
-MOZ_PSM=@MOZ_PSM@
-
-# Gssapi (krb5) libraries and headers for the Negotiate auth method
-GSSAPI_INCLUDES = @GSSAPI_INCLUDES@
-USE_GSSAPI	= @USE_GSSAPI@
-
 MOZILLA_OFFICIAL = @MOZILLA_OFFICIAL@
 BUILD_OFFICIAL = @BUILD_OFFICIAL@
 MOZ_MILESTONE_RELEASE = @MOZ_MILESTONE_RELEASE@
 
 # Win32 options
 MOZ_PROFILE	= @MOZ_PROFILE@
 MOZ_BROWSE_INFO	= @MOZ_BROWSE_INFO@
 MOZ_TOOLS_DIR	= @MOZ_TOOLS_DIR@
@@ -593,57 +336,25 @@ WIN32_CUSTOM_CRT_DIR = @WIN32_CUSTOM_CRT
 ifdef MOZ_MEMORY
 ifneq (,$(WIN32_CRT_SRC_DIR)$(WIN32_CUSTOM_CRT_DIR))
 export LIB = @MOZ_LIB@
 export PATH = @MOZ_PATH@
 DLLFLAGS = @DLLFLAGS@
 endif
 endif
 
-# python options.
-MOZ_PYTHON_EXTENSIONS = @MOZ_PYTHON_EXTENSIONS@
-MOZ_PYTHON = @MOZ_PYTHON@
-MOZ_PYTHON_PREFIX = @MOZ_PYTHON_PREFIX@
-MOZ_PYTHON_INCLUDES = @MOZ_PYTHON_INCLUDES@
-MOZ_PYTHON_LIBS = @MOZ_PYTHON_LIBS@
-MOZ_PYTHON_DEBUG_SUFFIX = @MOZ_PYTHON_DEBUG_SUFFIX@
-MOZ_PYTHON_DLL_SUFFIX = @MOZ_PYTHON_DLL_SUFFIX@
-MOZ_PYTHON_VER_DOTTED = @MOZ_PYTHON_VER_DOTTED@
-MOZ_PYTHON_VER = @MOZ_PYTHON_VER@
-
 # Codesighs tools option, enables win32 mapfiles.
 MOZ_MAPINFO	= @MOZ_MAPINFO@
 
-MOZ_PHOENIX	= @MOZ_PHOENIX@
-MOZ_XULRUNNER	= @MOZ_XULRUNNER@
-MOZ_XUL_APP	= @MOZ_XUL_APP@
 WINCE		= @WINCE@
 
-MOZ_DISTRIBUTION_ID = @MOZ_DISTRIBUTION_ID@
-
-NS_OSSO 	= @NS_OSSO@
-MOZ_PLATFORM_HILDON = @MOZ_PLATFORM_HILDON@
-
-LIBHILDONMIME_CFLAGS	= @LIBHILDONMIME_CFLAGS@
-LIBHILDONMIME_LIBS	= @LIBHILDONMIME_LIBS@
-LIBOSSO_CFLAGS 	= @LIBOSSO_CFLAGS@
-LIBOSSO_LIBS 	= @LIBOSSO_LIBS@
-NS_MAEMO_LOCATION 	= @NS_MAEMO_LOCATION@
-  
-MOZ_LOCATION_CFLAGS 	= @MOZ_LOCATION_CFLAGS@
-MOZ_LOCATION_LIBS 	= @MOZ_LOCATION_LIBS@
-
 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@
 HAVE_DTRACE= @HAVE_DTRACE@
 
 VISIBILITY_FLAGS = @VISIBILITY_FLAGS@
 WRAP_SYSTEM_INCLUDES = @WRAP_SYSTEM_INCLUDES@
 
-MOZ_EMBEDDING_LEVEL_DEFAULT = @MOZ_EMBEDDING_LEVEL_DEFAULT@
-MOZ_EMBEDDING_LEVEL_BASIC = @MOZ_EMBEDDING_LEVEL_BASIC@
-MOZ_EMBEDDING_LEVEL_MINIMAL = @MOZ_EMBEDDING_LEVEL_MINIMAL@
-
 HAVE_ARM_SIMD= @HAVE_ARM_SIMD@
copy from config/config.mk
copy to js/src/config/config.mk
copy from config/elf-dynstr-gc.c
copy to js/src/config/elf-dynstr-gc.c
copy from config/fastcwd.pl
copy to js/src/config/fastcwd.pl
copy from config/gcc_hidden.h
copy to js/src/config/gcc_hidden.h
copy from config/insure.mk
copy to js/src/config/insure.mk
copy from nsprpub/config/make-system-wrappers.pl
copy to js/src/config/make-system-wrappers.pl
old mode 100755
new mode 100644
copy from config/milestone.pl
copy to js/src/config/milestone.pl
copy from config/milestone.txt
copy to js/src/config/milestone.txt
copy from config/mkdepend/Makefile.in
copy to js/src/config/mkdepend/Makefile.in
copy from config/mkdepend/cppsetup.c
copy to js/src/config/mkdepend/cppsetup.c
copy from config/mkdepend/def.h
copy to js/src/config/mkdepend/def.h
copy from config/mkdepend/ifparser.c
copy to js/src/config/mkdepend/ifparser.c
copy from config/mkdepend/ifparser.h
copy to js/src/config/mkdepend/ifparser.h
copy from config/mkdepend/imakemdep.h
copy to js/src/config/mkdepend/imakemdep.h
copy from config/mkdepend/include.c
copy to js/src/config/mkdepend/include.c
copy from config/mkdepend/main.c
copy to js/src/config/mkdepend/main.c
copy from config/mkdepend/mkdepend.man
copy to js/src/config/mkdepend/mkdepend.man
copy from config/mkdepend/parse.c
copy to js/src/config/mkdepend/parse.c
copy from config/mkdepend/pr.c
copy to js/src/config/mkdepend/pr.c
copy from config/nfspwd.pl
copy to js/src/config/nfspwd.pl
copy from config/nsinstall.c
copy to js/src/config/nsinstall.c
old mode 100755
new mode 100644
copy from config/nsinstall.py
copy to js/src/config/nsinstall.py
copy from config/pathsub.c
copy to js/src/config/pathsub.c
copy from config/pathsub.h
copy to js/src/config/pathsub.h
old mode 100755
new mode 100644
copy from config/preprocessor.pl
copy to js/src/config/preprocessor.pl
copy from config/revdepth-nt.pl
copy to js/src/config/revdepth-nt.pl
copy from config/revdepth.pl
copy to js/src/config/revdepth.pl
copy from config/rules.mk
copy to js/src/config/rules.mk
copy from config/system-headers
copy to js/src/config/system-headers
copy from config/version.mk
copy to js/src/config/version.mk
old mode 100755
new mode 100644
copy from config/version_win.pl
copy to js/src/config/version_win.pl
copy from configure.in
copy to js/src/configure.in
--- a/configure.in
+++ b/js/src/configure.in
@@ -56,28 +56,23 @@ dnl the provisions above, a recipient ma
 dnl the terms of any one of the MPL, the GPL or the LGPL.
 dnl
 dnl ***** END LICENSE BLOCK *****
 
 dnl Process this file with autoconf to produce a configure script.
 dnl ========================================================
 
 AC_PREREQ(2.13)
-AC_INIT(config/config.mk)
+AC_INIT(jsapi.h)
 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
 AC_CANONICAL_SYSTEM
 TARGET_CPU="${target_cpu}"
 TARGET_VENDOR="${target_vendor}"
 TARGET_OS="${target_os}"
 
-
-MOZ_DEB_TIMESTAMP=`date +"%a, %d  %b %Y %T %z"   2>&1` 
-AC_SUBST(MOZ_DEB_TIMESTAMP)
-
-
 dnl ========================================================
 dnl =
 dnl = Don't change the following two lines.  Doing so breaks:
 dnl =
 dnl = CFLAGS="-foo" ./configure
 dnl =
 dnl ========================================================
 CFLAGS="${CFLAGS=}"
@@ -111,33 +106,20 @@ MOZJPEG=62
 MOZPNG=10217
 MOZZLIB=0x1230
 NSPR_VERSION=4
 NSS_VERSION=3
 
 dnl Set the minimum version of toolkit libs used by mozilla
 dnl ========================================================
 GLIB_VERSION=1.2.0
-LIBIDL_VERSION=0.6.3
 PERL_VERSION=5.006
-LIBART_VERSION=2.3.4
-CAIRO_VERSION=1.6.0
-PANGO_VERSION=1.10.0
-GTK2_VERSION=2.10.0
 MAKE_VERSION=3.78
 WINDRES_VERSION=2.14.90
 W32API_VERSION=3.8
-GNOMEVFS_VERSION=2.0
-GNOMEUI_VERSION=2.2.0
-GCONF_VERSION=1.2.1
-LIBGNOME_VERSION=2.0
-STARTUP_NOTIFICATION_VERSION=0.8
-DBUS_VERSION=0.60
-LCMS_VERSION=1.17
-SQLITE_VERSION=3.6.4
 
 MSMANIFEST_TOOL=
 
 dnl Set various checks
 dnl ========================================================
 MISSING_X=
 AC_PROG_AWK
 
@@ -201,30 +183,16 @@ fi
 
 COMPILE_ENVIRONMENT=1
 MOZ_ARG_ENABLE_BOOL(compile-environment,
 [  --disable-compile-environment
                            Disable compiler/library checks.],
     COMPILE_ENVIRONMENT=1,
     COMPILE_ENVIRONMENT= )
 
-MOZ_ARG_WITH_STRING(l10n-base,
-[  --with-l10n-base=DIR     path to l10n repositories],
-    L10NBASEDIR=$withval)
-if test ! -z "$L10NBASEDIR"; then
-    if test "$L10NBASEDIR" = "yes" -o "$L10NBASEDIR" = "no"; then
-        AC_MSG_ERROR([--with-l10n-base must specify a path])
-    elif test -d "$L10NBASEDIR"; then
-        L10NBASEDIR=`cd "$L10NBASEDIR" && pwd`
-    else
-        AC_MSG_ERROR([Invalid value --with-l10n-base, $L10NBASEDIR doesn't exist])
-    fi
-fi
-AC_SUBST(L10NBASEDIR)
-
 dnl ========================================================
 dnl Checks for compilers.
 dnl ========================================================
 dnl Set CROSS_COMPILE in the environment when running configure
 dnl to use the cross-compile setup for now
 dnl ========================================================
 
 if test "$COMPILE_ENVIRONMENT"; then
@@ -948,32 +916,18 @@ IMPORT_LIB_SUFFIX=
 TARGET_MD_ARCH=unix
 DIRENT_INO=d_ino
 CYGWIN_WRAPPER=
 WIN_TOP_SRC=
 MOZ_USER_DIR=".mozilla"
 HOST_AR='$(AR)'
 HOST_AR_FLAGS='$(AR_FLAGS)'
 
-MOZ_JPEG_CFLAGS=
-MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/jpeg)'
-MOZ_ZLIB_CFLAGS=
-MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,$(DEPTH)/modules/zlib/src)'
-MOZ_BZ2_CFLAGS=
-MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
-MOZ_PNG_CFLAGS=
-MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/modules/libimg/png)'
-
-MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -lmozjs'
-DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core'
+MOZ_JS_LIBS='-L$(libdir) -lmozjs'
 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(PREFIX)/lib'
-XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom'
-LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
-XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
-XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
 
 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom_compat'
 
 USE_DEPENDENT_LIBS=1
 
 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
 MOZ_GFX_TOOLKIT='$(MOZ_WIDGET_TOOLKIT)'
@@ -1575,25 +1529,16 @@ case "$host" in
     ;;
 
 *)
     HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
     HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
     ;;
 esac
 
-dnl Get mozilla version from central milestone file
-MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
-
-dnl Get version of various core apps from the version files.
-FIREFOX_VERSION=`cat $topsrcdir/browser/config/version.txt`
-
-AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
-AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
-
 dnl ========================================================
 dnl System overrides of the defaults for target
 dnl ========================================================
 
 case "$target" in
 *-aix*)
     AC_DEFINE(AIX)
     if test ! "$GNU_CC"; then
@@ -1837,17 +1782,16 @@ case "$target" in
     TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
     MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions $MOZ_OPTIMIZE_SIZE_TWEAK"
     MOZ_DEBUG_FLAGS="-g -fno-inline"  # most people on linux use gcc/gdb,
                                       # and that combo is not yet good at
                                       # debugging inlined functions (even
                                       # when using DWARF2 as the debugging
                                       # format)    
 
-    MOZ_MEMORY=1
 
     case "${target_cpu}" in
     alpha*)
     	CFLAGS="$CFLAGS -mieee"
     	CXXFLAGS="$CXXFLAGS -mieee"
     ;;
     i*86)
     	USE_ELF_DYNSTR_GC=1
@@ -1909,29 +1853,26 @@ case "$target" in
     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='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
+    MOZ_JS_LIBS='$(libdir)/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
     MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.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'
     ZIP=zip
-    LIBIDL_CFLAGS="-I$MOZ_TOOLS_DIR/include ${GLIB_CFLAGS}"
-    LIBIDL_LIBS="$MOZ_TOOLS_DIR/lib/libidl-0.6_s.lib $MOZ_TOOLS_DIR/lib/glib-1.2_s.lib"
-    STATIC_LIBIDL=1
 
     AC_DEFINE(HAVE_SNPRINTF)
     AC_DEFINE(_WINDOWS)
     AC_DEFINE(_WIN32)
     AC_DEFINE(WIN32)
     AC_DEFINE(XP_WIN)
     AC_DEFINE(XP_WIN32)
     AC_DEFINE(HW_THREADS)
@@ -1965,17 +1906,17 @@ case "$target" in
         DSO_LDOPTS='-shared'
         MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
         MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
         RC='$(WINDRES)'
         # Use temp file for windres (bug 213281)
         RCFLAGS='-O coff --use-temp-file'
         # mingw doesn't require kernel32, user32, and advapi32 explicitly
         LIBS="$LIBS -lgdi32 -lwinmm -lwsock32"
-        MOZ_JS_LIBS='-L$(LIBXUL_DIST)/lib -ljs$(MOZ_BITS)$(VERSION_NUMBER)'
+        MOZ_JS_LIBS='-L$(libdir) -ljs$(MOZ_BITS)$(VERSION_NUMBER)'
         MOZ_FIX_LINK_PATHS=
         DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core'
         XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom'
         DLL_PREFIX=
         IMPORT_LIB_SUFFIX=dll.a
     else
         TARGET_COMPILER_ABI=msvc
         HOST_CC='$(CC)'
@@ -2002,17 +1943,17 @@ case "$target" in
         DSO_LDOPTS=-SUBSYSTEM:WINDOWS
         CFLAGS="$CFLAGS -W3 -Gy -Fd\$(PDBFILE)"
         CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(PDBFILE)"
         LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
         MOZ_DEBUG_FLAGS='-Zi'
         MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
         WARNINGS_AS_ERRORS='-WX'
     	MOZ_OPTIMIZE_FLAGS='-O1'
-        MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
+        MOZ_JS_LIBS='$(libdir)/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
         MOZ_FIX_LINK_PATHS=
         DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
         XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
         LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
         MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
         MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
         if test $_MSC_VER -ge 1400; then
             LDFLAGS="$LDFLAGS -NXCOMPAT -SAFESEH"
@@ -2109,68 +2050,29 @@ case "$target" in
     GLIB_CFLAGS="-I${_GLIB_PREFIX_DIR}/include"
     if test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"; then
         GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"
     elif test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"; then
         GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"
     else
         AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/lib/glib-1.2.lib or $_GLIB_PREFIX_DIR/lib/glib-1.2_s.lib])
     fi
-
-    if test -n "$LIBIDL_PREFIX"; then
-        _LIBIDL_PREFIX_DIR=`cd $LIBIDL_PREFIX && pwd`
-        if test "$?" = "0"; then
-            if test `echo ${PATH}: | grep -ic "$_LIBIDL_PREFIX_DIR/bin:"` = 0; then
-                AC_MSG_ERROR([LIBIDL_PREFIX must be in your \$PATH.])
-            fi
-            _LIBIDL_PREFIX_DIR=`$CYGPATH_W $_LIBIDL_PREFIX_DIR | $CYGPATH_S`
-        else
-            AC_MSG_ERROR([LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory.])
-        fi
-    else
-        _LIBIDL_PREFIX_DIR=$MOZ_TOOLS_DIR
-    fi        
-    if test ! -f "${_LIBIDL_PREFIX_DIR}/include/libIDL/IDL.h"; then
-        AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/include/libIDL/IDL.h .])
-    fi
-    LIBIDL_CFLAGS="-I${_LIBIDL_PREFIX_DIR}/include ${GLIB_CFLAGS}"
-    if test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"; then
-        LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"
-        STATIC_LIBIDL=1
-    elif test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"; then
-        LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"
-    else
-        AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/lib/libidl-0.6.lib or $_LIBIDL_PREFIX_DIR/lib/libidl-0.6_s.lib])
-    fi
-    LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
     ;;
 
     *) # else cross-compiling
         if test -n "$GLIB_PREFIX"; then
             GLIB_CFLAGS="-I${GLIB_PREFIX}/include"
             if test -f "${GLIB_PREFIX}/lib/glib-1.2_s.lib"; then
                 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2_s.lib"
             elif test -f "${GLIB_PREFIX}/lib/glib-1.2.lib"; then
                 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2.lib"
             else
                 AC_MSG_ERROR([Cannot find $GLIB_PREFIX/lib/glib-1.2.lib or $GLIB_PREFIX/lib/glib-1.2_s.lib])
             fi
         fi
-        if test -n "$LIBIDL_PREFIX"; then
-            LIBIDL_CFLAGS="-I${LIBIDL_PREFIX}/include ${GLIB_CFLAGS}"
-            if test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"; then
-                LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"
-                STATIC_LIBIDL=1
-            elif test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"; then
-                LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"
-            else
-                AC_MSG_ERROR([Cannot find $LIBIDL_PREFIX/lib/libIDL-0.6.lib or $LIBIDL_PREFIX/lib/libIDL-0.6_s.lib])
-            fi
-        fi
-        LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
         ;;
     esac 
 
 
     case "$host_os" in
     cygwin*|msvc*|mks*)
         AC_MSG_WARN([Using a cygwin build environment is unsupported. Configure cannot check for the presence of necessary headers. Please upgrade to MozillaBuild; see http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites])
         ;;
@@ -2405,17 +2307,16 @@ dnl the qsort routine under solaris is f
 *-solaris*) 
     AC_DEFINE(SOLARIS)
     TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
     SYSTEM_MAKEDEPEND=
     # $ORIGIN/.. is for shared libraries under components/ to locate shared
     # libraries one level up (e.g. libnspr4.so)
     LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'"
     LIBS="-lCrun -lCstd $LIBS"
-    MOZ_MEMORY=1
     if test -z "$GNU_CC"; then
        NS_USE_NATIVE=1
        MOZ_FIX_LINK_PATHS=
        AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
 
        if test "$CPU_ARCH" != "sparc"; then
           CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all"
           CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife -norunpath"
@@ -3015,128 +2916,16 @@ if test ! "$GNU_CXX"; then
 	;;
      *)
 	AC_CHECK_LIB(C, demangle)
 	;;
      esac
 fi
 AC_CHECK_LIB(socket, socket)
 
-XLDFLAGS="$X_LIBS"
-XLIBS="$X_EXTRA_LIBS"
-
-dnl ========================================================
-dnl Checks for X libraries.
-dnl Ordering is important.
-dnl Xt is dependent upon SM as of X11R6
-dnl ========================================================
-if test "$no_x" = "yes"; then
-    AC_DEFINE(NO_X11)
-else
-    AC_DEFINE_UNQUOTED(FUNCPROTO,15)
-	XLIBS="-lX11 $XLIBS"
-	_SAVE_LDFLAGS="$LDFLAGS"
-	LDFLAGS="$XLDFLAGS $LDFLAGS"
-	AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"],
-		[MISSING_X="$MISSING_X -lX11"], $XLIBS)
-	AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
-		[MISSING_X="$MISSING_X -lXext"], $XLIBS)
-   
-     
-	AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
-        unset ac_cv_lib_Xt_XtFree
-	    AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
-	    AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS) 
-        AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
-		    [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
-        ])
-
-    # AIX needs the motif library linked before libXt to prevent
-    # crashes in plugins linked against Motif - Bug #98892
-    case "${target_os}" in
-    aix*)
-        XT_LIBS="-lXm $XT_LIBS"
-        ;;
-    esac
-
-    dnl ========================================================
-    dnl = Check for XShm
-    dnl ========================================================
-    AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
-        $XLIBS $XEXT_LIBS)
-    AC_CHECK_HEADER(X11/extensions/XShm.h)
-    if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" &&
-        test -n "$_HAVE_XSHM_XEXT"; then
-        AC_DEFINE(HAVE_XSHM)
-    fi
-
-    dnl ========================================================
-    dnl = Check for XIE
-    dnl ========================================================
-    AC_CHECK_LIB(XIE, XieFloGeometry, [MOZ_XIE_LIBS="-lXIE"],,
-        $XLIBS $XEXT_LIBS)
-    AC_CHECK_HEADER(X11/extensions/XIElib.h)
-
-    if test "$MOZ_XIE_LIBS"; then
-	dnl ====================================================
-	dnl = If XIE is present and is desired, turn it on
-	dnl ====================================================
-	case $target in
-	    *-hpux*)
-		;;
-	    *)
-		HAVE_XIE=1
-		;;
-	esac
-    fi
-
-	LDFLAGS="$_SAVE_LDFLAGS"
-
-    dnl ========================================================
-    dnl = Check for freetype2 and its functionality
-    dnl ========================================================
-    AC_CHECK_FT2(6.1.0, [_HAVE_FREETYPE2=1], [_HAVE_FREETYPE2=])
-
-    if test "$_HAVE_FREETYPE2"; then
-    	_SAVE_LIBS="$LIBS"
-    	_SAVE_CFLAGS="$CFLAGS"
-    	LIBS="$LIBS $FT2_LIBS"
-    	CFLAGS="$CFLAGS $FT2_CFLAGS"
-
-        AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
-            ac_cv_member_FT_Bitmap_Size_y_ppem,
-            [AC_TRY_COMPILE([#include <ft2build.h>
-                             #include FT_FREETYPE_H],
-                            [FT_Bitmap_Size s;
-                             if (sizeof s.y_ppem) return 0;
-                             return 1],
-                            ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
-                            ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
-        if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
-            HAVE_FT_BITMAP_SIZE_Y_PPEM=1
-        else
-            HAVE_FT_BITMAP_SIZE_Y_PPEM=0
-        fi
-        AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
-                           $HAVE_FT_BITMAP_SIZE_Y_PPEM,
-                           [FT_Bitmap_Size structure includes y_ppem field])
-
-        AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size)
-
-    	LIBS="$_SAVE_LIBS"
-    	CFLAGS="$_SAVE_CFLAGS"
-    fi
-
-fi # $no_x
-
-AC_SUBST(XCFLAGS)
-AC_SUBST(XLDFLAGS)
-AC_SUBST(XLIBS)
-AC_SUBST(XT_LIBS)
-
 dnl ========================================================
 dnl = pthread support
 dnl = Start by checking whether the system support pthreads
 dnl ========================================================
 case "$target_os" in
 darwin*)
     USE_PTHREADS=1
     ;;
@@ -3448,18 +3237,16 @@ if test "$ac_cv_func_iconv" = "yes"; the
         AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
     fi
 fi
 LIBS=$_SAVE_LIBS
 
     ;;
 esac
 
-AM_LANGINFO_CODESET
-
 AC_LANG_C
 
 dnl **********************
 dnl *** va_copy checks ***
 dnl **********************
 dnl we currently check for all three va_copy possibilities, so we get
 dnl all results in config.log for bug reports.
 AC_MSG_CHECKING(for an implementation of va_copy())
@@ -3969,307 +3756,71 @@ dnl are defined in build/autoconf/altopt
 
 dnl ========================================================
 dnl =
 dnl = Check for external package dependencies
 dnl =
 dnl ========================================================
 MOZ_ARG_HEADER(External Packages)
 
-MOZ_ENABLE_LIBXUL=
-
-MOZ_ARG_WITH_STRING(libxul-sdk,
-[  --with-libxul-sdk=PFX   Use the libXUL SDK at <PFX>],
-  LIBXUL_SDK_DIR=$withval)
-
-if test "$LIBXUL_SDK_DIR" = "yes"; then
-    AC_MSG_ERROR([--with-libxul-sdk must specify a path])
-elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
-    LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
-
-    if test ! -f "$LIBXUL_SDK/sdk/include/xpcom-config.h"; then
-        AC_MSG_ERROR([$LIBXUL_SDK/sdk/include/xpcom-config.h doesn't exist])
-    fi
-
-    MOZ_ENABLE_LIBXUL=1
-fi
-AC_SUBST(LIBXUL_SDK)
-
-if test -n "$LIBXUL_SDK"; then
-    LIBXUL_DIST="$LIBXUL_SDK"
-else
-    LIBXUL_DIST="$MOZ_BUILD_ROOT/dist"
-fi
-AC_SUBST(LIBXUL_DIST)
-
 dnl ========================================================
-dnl = If NSPR was not detected in the system, 
-dnl = use the one in the source tree (mozilla/nsprpub)
+dnl = Find the right NSPR to use.
 dnl ========================================================
 MOZ_ARG_WITH_BOOL(system-nspr,
-[  --with-system-nspr      Use system installed NSPR],
+[  --with-system-nspr      Use an NSPR that is already built and installed.
+                          Use the 'nspr-config' script in the current path,
+                          or look for the script in the directories given with
+                          --with-nspr-exec-prefix or --with-nspr-prefix.],
     _USE_SYSTEM_NSPR=1 )
 
+MOZ_ARG_WITH_STRING(nspr-cflags,
+[  --with-nspr-cflags=FLAGS Pass FLAGS to CC when building code that uses NSPR.
+                          Use this when there's no accurate nspr-config
+                          script available.  This is the case when building
+                          SpiderMonkey as part of the Mozilla tree: the
+                          top-level configure script computes NSPR flags
+                          that accomodate the quirks of that environment.],
+    NSPR_CFLAGS=$withval)
+MOZ_ARG_WITH_STRING(nspr-libs,
+[  --with-nspr-libs=LIBS   Pass LIBS to LD when linking code that uses NSPR.
+                          See --with-nspr-cflags for more details.],
+    NSPR_LIBS=$withval)
+AC_SUBST(NSPR_CFLAGS)
+AC_SUBST(NSPR_LIBS)
+
+dnl Pass either --with-system-nspr or (--with-nspr-cflags and
+dnl --with-nspr-libs), but not both.
+if test "$_USE_SYSTEM_NSPR" && (test "$NSPR_CFLAGS" || test "$NSPR_LIBS"); then
+    AC_MSG_ERROR([--with-system-nspr and --with-nspr-libs/cflags are mutually exclusive.
+See 'configure --help'.])
+fi
+
 if test -n "$_USE_SYSTEM_NSPR"; then
-    AM_PATH_NSPR(4.7.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=])
+    MOZ_NATIVE_NSPR=
+    AM_PATH_NSPR(4.7.0, [MOZ_NATIVE_NSPR=1])
+    if test -z "$MOZ_NATIVE_NSPR"; then
+        AC_MSG_ERROR([--with-system-nspr given, but configure could not find a suitable NSPR.
+Pass --with-nspr-exec-prefix, --with-nspr-prefix, or --with-nspr-cflags/libs.
+See 'configure --help'.])
+    fi
 fi
 
 if test -n "$MOZ_NATIVE_NSPR"; then
     _SAVE_CFLAGS=$CFLAGS
     CFLAGS="$CFLAGS $NSPR_CFLAGS"
     AC_TRY_COMPILE([#include "prlog.h"],
                 [#ifndef PR_STATIC_ASSERT
                  #error PR_STATIC_ASSERT not defined
                  #endif],
                 [MOZ_NATIVE_NSPR=1],
                 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT]))
     CFLAGS=$_SAVE_CFLAGS
-else
-    NSPR_CFLAGS='`$(DEPTH)/nsprpub/config/nspr-config --prefix='${LIBXUL_DIST}' --includedir='${LIBXUL_DIST}'/include/nspr --cflags`'
-    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
-        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_LIBS='`$(DEPTH)/nsprpub/config/nspr-config --prefix='${LIBXUL_DIST}' --libdir='${LIBXUL_DIST}'/lib --libs`'
-    fi
 fi
 
 dnl ========================================================
-dnl = If NSS was not detected in the system, 
-dnl = use the one in the source tree (mozilla/security/nss)
-dnl ========================================================
-
-MOZ_ARG_WITH_BOOL(system-nss,
-[  --with-system-nss      Use system installed NSS],
-    _USE_SYSTEM_NSS=1 )
-
-if test -n "$_USE_SYSTEM_NSS"; then
-    AM_PATH_NSS(3.12.0, [MOZ_NATIVE_NSS=1], [MOZ_NATIVE_NSS=])
-fi
-
-if test -n "$MOZ_NATIVE_NSS"; then
-   NSS_LIBS="$NSS_LIBS -lcrmf"
-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) \
-        \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)softokn$NSS_VERSION\$(DLL_SUFFIX)"
-
-   if test -z "$GNU_CC" && test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
-       NSS_LIBS="\
-        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
-        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)smime$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
-        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)ssl$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
-        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nss$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
-        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nssutil$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
-        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)softokn$NSS_VERSION.\$(IMPORT_LIB_SUFFIX)"
-   else
-       NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION -lsoftokn$NSS_VERSION"
-   fi
-fi
-
-if test -z "$SKIP_LIBRARY_CHECKS"; then
-dnl system JPEG support
-dnl ========================================================
-MOZ_ARG_WITH_STRING(system-jpeg,
-[  --with-system-jpeg[=PFX]
-                          Use system libjpeg [installed at prefix PFX]],
-    JPEG_DIR=$withval)
-
-_SAVE_CFLAGS=$CFLAGS
-_SAVE_LDFLAGS=$LDFLAGS
-_SAVE_LIBS=$LIBS
-if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
-    CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
-    LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
-fi
-if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
-    SYSTEM_JPEG=
-else
-    AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"], SYSTEM_JPEG=, $JPEG_LIBS)
-fi
-
-if test "$SYSTEM_JPEG" = 1; then
-    LIBS="$JPEG_LIBS $LIBS"
-    AC_TRY_COMPILE([ #include <stdio.h>
-                     #include <sys/types.h>
-                     #include <jpeglib.h> ],
-                   [ #if JPEG_LIB_VERSION < $MOZJPEG
-                     #error "Insufficient JPEG library version ($MOZJPEG required)."
-                     #endif ],
-                   SYSTEM_JPEG=1,
-                   [SYSTEM_JPEG= JPEG_CFLAGS= JPEG_LIBS=]) 
-fi 
-CFLAGS=$_SAVE_CFLAGS
-LDFLAGS=$_SAVE_LDFLAGS
-LIBS=$_SAVE_LIBS
-
-if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$SYSTEM_JPEG" = 1; then
-    JPEG_CFLAGS="-I${JPEG_DIR}/include"
-    JPEG_LIBS="-L${JPEG_DIR}/lib ${JPEG_LIBS}"
-fi
-
-dnl system ZLIB support
-dnl ========================================================
-MOZ_ARG_WITH_STRING(system-zlib,
-[  --with-system-zlib[=PFX]
-                          Use system libz [installed at prefix PFX]],
-    ZLIB_DIR=$withval)
-
-_SAVE_CFLAGS=$CFLAGS
-_SAVE_LDFLAGS=$LDFLAGS
-_SAVE_LIBS=$LIBS
-if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
-    CFLAGS="-I${ZLIB_DIR}/include $CFLAGS"
-    LDFLAGS="-L${ZLIB_DIR}/lib $LDFLAGS"
-fi
-if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
-    SYSTEM_ZLIB=
-else
-    AC_CHECK_LIB(z, gzread, [SYSTEM_ZLIB=1 ZLIB_LIBS="-lz $ZLIB_LIBS"], 
-	[SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=], $ZLIB_LIBS)
-fi
-if test "$SYSTEM_ZLIB" = 1; then
-    LIBS="$ZLIB_LIBS $LIBS"
-    AC_TRY_COMPILE([ #include <stdio.h>
-                     #include <string.h>
-                     #include <zlib.h> ],
-                   [ #if ZLIB_VERNUM < $MOZZLIB 
-                     #error "Insufficient zlib version ($MOZZLIB required)."
-                     #endif ],
-                   SYSTEM_ZLIB=1,
-                   [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=]) 
-fi
-CFLAGS=$_SAVE_CFLAGS
-LDFLAGS=$_SAVE_LDFLAGS
-LIBS=$_SAVE_LIBS
-
-if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$SYSTEM_ZLIB" = 1; then
-    ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
-    ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
-fi
-
-dnl system BZIP2 Support
-dnl ========================================================
-MOZ_ARG_WITH_STRING(system-bz2,
-[  --with-system-bz2[=PFX]
-                          Use system libbz2 [installed at prefix PFX]],
-    BZ2_DIR=$withval)
-
-_SAVE_CFLAGS=$CFLAGS
-_SAVE_LDFLAGS=$LDFLAGS
-_SAVE_LIBS=$LIBS
-if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then
-    CFLAGS="-I${BZ2_DIR}/include $CFLAGS"
-    LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS"
-fi
-if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then
-    SYSTEM_BZ2=
-else
-    AC_CHECK_LIB(bz2, BZ2_bzread, [SYSTEM_BZ2=1 BZ2_LIBS="-lbz2"],
-	[SYSTEM_BZ2= BZ2_CFLAGS= BZ2_LIBS=], $BZ2_LIBS)
-fi
-CFLAGS=$_SAVE_CFLAGS
-LDFLAGS=$_SAVE_LDFLAGS
-LIBS=$_SAVE_LIBS
-
-if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$SYSTEM_BZ2" = 1; then
-    BZ2_CFLAGS="-I${BZ2_DIR}/include"
-    BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}"
-fi
-
-dnl system PNG Support
-dnl ========================================================
-MOZ_ARG_WITH_STRING(system-png, 
-[  --with-system-png[=PFX]
-                          Use system libpng [installed at prefix PFX]],
-    PNG_DIR=$withval)
-
-_SAVE_CFLAGS=$CFLAGS
-_SAVE_LDFLAGS=$LDFLAGS
-_SAVE_LIBS=$LIBS
-CFLAGS="$ZLIB_CFLAGS $CFLAGS"
-LDFLAGS="$ZLIB_LIBS -lz $LDFLAGS"
-if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
-    CFLAGS="-I${PNG_DIR}/include $CFLAGS"
-    LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
-fi
-if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
-    SYSTEM_PNG=
-else
-    _SAVE_PNG_LIBS=$PNG_LIBS
-    AC_CHECK_LIB(png, png_get_valid, [SYSTEM_PNG=1 PNG_LIBS="-lpng $PNG_LIBS"],
-                 AC_MSG_ERROR([--with-system-png requested but no working libpng found]), 
-                 $PNG_LIBS)
-    AC_CHECK_LIB(png, png_get_acTL, ,
-                 AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]),
-                 $_SAVE_PNG_LIBS)
-fi
-if test "$SYSTEM_PNG" = 1; then
-    LIBS="$PNG_LIBS $LIBS"
-    AC_TRY_COMPILE([ #include <stdio.h>
-                     #include <sys/types.h>
-                     #include <png.h> ],
-                   [ #if PNG_LIBPNG_VER < $MOZPNG
-                     #error "Insufficient libpng version ($MOZPNG required)."
-                     #endif
-                     #ifndef PNG_UINT_31_MAX
-                     #error "Insufficient libpng version."
-                     #endif ],
-                   SYSTEM_PNG=1,
-                   AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
-fi
-CFLAGS=$_SAVE_CFLAGS
-LDFLAGS=$_SAVE_LDFLAGS
-LIBS=$_SAVE_LIBS
-
-if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$SYSTEM_PNG" = 1; then
-    PNG_CFLAGS="-I${PNG_DIR}/include"
-    PNG_LIBS="-L${PNG_DIR}/lib ${PNG_LIBS}"
-fi
-
-fi # SKIP_LIBRARY_CHECKS
-
-dnl system HunSpell Support
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(system-hunspell,
-[  --enable-system-hunspell  Use system hunspell (located with pkgconfig)],
-    SYSTEM_HUNSPELL=1 )
-
-if test -n "$SYSTEM_HUNSPELL"; then
-    PKG_CHECK_MODULES(MOZ_HUNSPELL, hunspell)
-fi
-
-AC_SUBST(SYSTEM_HUNSPELL)
-
-dnl ========================================================
-dnl Java SDK support
-dnl ========================================================
-JAVA_INCLUDE_PATH=
-MOZ_ARG_WITH_STRING(java-include-path,
-[  --with-java-include-path=dir   Location of Java SDK headers],
-    JAVA_INCLUDE_PATH=$withval)
-
-JAVA_BIN_PATH=
-MOZ_ARG_WITH_STRING(java-bin-path,
-[  --with-java-bin-path=dir   Location of Java binaries (java, javac, jar)],
-    JAVA_BIN_PATH=$withval)
-
-dnl ========================================================
 dnl Use ARM userspace kernel helpers; tell NSPR to enable
 dnl their usage and use them in spidermonkey.
 dnl ========================================================
 MOZ_ARG_WITH_BOOL(arm-kuser,
 [  --with-arm-kuser         Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)],
     USE_ARM_KUSER=1,
     USE_ARM_KUSER=)
 if test -n "$USE_ARM_KUSER"; then
@@ -4281,582 +3832,18 @@ dnl =
 dnl = Application
 dnl =
 dnl ========================================================
 
 MOZ_ARG_HEADER(Application)
 
 BUILD_STATIC_LIBS=
 ENABLE_TESTS=1
-MOZ_ACTIVEX_SCRIPTING_SUPPORT=
-MOZ_BRANDING_DIRECTORY=
 MOZ_DBGRINFO_MODULES=
-MOZ_ENABLE_CANVAS=1
-MOZ_FEEDS=1
-MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp xbm icon"
-MOZ_IMG_ENCODERS_DEFAULT="png jpeg"
-MOZ_IPCD=
-MOZ_JAVAXPCOM=
-MOZ_JSDEBUGGER=1
-MOZ_JSLOADER=1
-MOZ_LIBART_CFLAGS=
-MOZ_LIBART_LIBS=
-MOZ_MATHML=1
-MOZ_MORK=1
-MOZ_MORKREADER=
-MOZ_AUTH_EXTENSION=1
-MOZ_NO_ACTIVEX_SUPPORT=1
-MOZ_NO_INSPECTOR_APIS=
-MOZ_NO_XPCOM_OBSOLETE=
-MOZ_NO_FAST_LOAD=
-MOZ_OGG=1
-MOZ_MEDIA=
-MOZ_OJI=1
-MOZ_PERMISSIONS=1
-MOZ_PLACES=
-MOZ_PLAINTEXT_EDITOR_ONLY=
-MOZ_PLUGINS=1
-MOZ_PREF_EXTENSIONS=1
-MOZ_PROFILELOCKING=1
-MOZ_PROFILESHARING=1
-MOZ_PSM=1
-MOZ_PYTHON_EXTENSIONS="xpcom dom"
-MOZ_PYTHON=
-MOZ_PYTHON_DEBUG_SUFFIX=
-MOZ_PYTHON_DLL_SUFFIX=
-MOZ_PYTHON_INCLUDES=
-MOZ_PYTHON_LIBS=
-MOZ_PYTHON_PREFIX=
-MOZ_PYTHON_VER=
-MOZ_PYTHON_VER_DOTTED=
-MOZ_RDF=1
-MOZ_REFLOW_PERF=
-MOZ_SAFE_BROWSING=
-MOZ_HELP_VIEWER=
-MOZ_SPELLCHECK=1
-MOZ_STATIC_MAIL_BUILD=
-MOZ_STORAGE=1
-MOZ_SVG=1
-MOZ_TIMELINE=
-MOZ_UI_LOCALE=en-US
-MOZ_UNIVERSALCHARDET=1
-MOZ_URL_CLASSIFIER=
-MOZ_USE_NATIVE_UCONV=
-MOZ_VIEW_SOURCE=1
-MOZ_XPFE_COMPONENTS=1
-MOZ_XPINSTALL=1
-MOZ_XSLT_STANDALONE=
-MOZ_XTF=1
-MOZ_XUL=1
-MOZ_XUL_APP=1
-MOZ_ZIPWRITER=1
-NS_PRINTING=1
-NECKO_COOKIES=1
-NECKO_DISK_CACHE=1
-NECKO_PROTOCOLS_DEFAULT="about data file ftp gopher http res viewsource"
-NECKO_SMALL_BUFFERS=
 JS_STATIC_BUILD=
-XPC_IDISPATCH_SUPPORT=
-
-
-case "$target_os" in
-darwin*)
-    ACCESSIBILITY=
-    ;;
-*)
-    ACCESSIBILITY=1
-    ;;
-esac
-
-case "$target_os" in
-    msvc*|mks*|cygwin*|mingw*)
-        if test -z "$GNU_CC"; then 
-            XPC_IDISPATCH_SUPPORT=1
-            MOZ_NO_ACTIVEX_SUPPORT=
-            MOZ_ACTIVEX_SCRIPTING_SUPPORT=1
-        fi
-        ;;
-esac
-
-MOZ_ARG_ENABLE_STRING(application,
-[  --enable-application=APP
-                          Options include:
-                            browser (Firefox)
-                            xulrunner
-                            content/xslt (Standalone Transformiix XSLT)
-                            netwerk (Standalone Necko)
-                            tools/update-packaging (AUS-related packaging tools)
-                            standalone (use this for standalone
-                              xpcom/xpconnect or to manually drive a build)],
-[ MOZ_BUILD_APP=$enableval ] )
-
-MOZ_EMBEDDING_PROFILE=default
-MOZ_ARG_WITH_STRING(embedding-profile,
-[  --with-embedding-profile=default|basic|minimal
-                       see http://wiki.mozilla.org/Gecko:Small_Device_Support],
-[ MOZ_EMBEDDING_PROFILE=$withval ])
-
-case "$MOZ_EMBEDDING_PROFILE" in
-default)
-  MOZ_EMBEDDING_LEVEL_DEFAULT=1
-  MOZ_EMBEDDING_LEVEL_BASIC=1
-  MOZ_EMBEDDING_LEVEL_MINIMAL=1
-  AC_DEFINE(MOZ_EMBEDDING_LEVEL_DEFAULT)
-  AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
-  AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
-  ;;
-
-basic)
-  MOZ_EMBEDDING_LEVEL_DEFAULT=
-  MOZ_EMBEDDING_LEVEL_BASIC=1
-  MOZ_EMBEDDING_LEVEL_MINIMAL=1
-  AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
-  AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
-  ENABLE_TESTS=
-  MOZ_ACTIVEX_SCRIPTING_SUPPORT=
-  MOZ_ENABLE_CANVAS=
-  MOZ_ENABLE_POSTSCRIPT=
-  MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
-  MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
-  MOZ_IMG_ENCODERS_DEFAULT=
-  MOZ_IMG_ENCODERS=
-  MOZ_INSTALLER=
-  MOZ_JSDEBUGGER=
-  MOZ_MATHML=
-  MOZ_AUTH_EXTENSION=
-  MOZ_NO_ACTIVEX_SUPPORT=1
-  MOZ_NO_INSPECTOR_APIS=1
-  MOZ_NO_XPCOM_OBSOLETE=1
-  MOZ_NO_FAST_LOAD=1
-  MOZ_OJI=
-  MOZ_PLAINTEXT_EDITOR_ONLY=1
-#  MOZ_PLUGINS=
-  MOZ_PREF_EXTENSIONS=
-  MOZ_PROFILELOCKING=
-  MOZ_PROFILESHARING=
-  MOZ_SPELLCHECK=
-  MOZ_SVG=
-  MOZ_UNIVERSALCHARDET=
-  MOZ_UPDATER=
-  MOZ_USE_NATIVE_UCONV=
-  MOZ_VIEW_SOURCE=
-  MOZ_XPFE_COMPONENTS=
-  MOZ_XPINSTALL=
-  MOZ_XTF=
-  MOZ_ZIPWRITER=
-  NECKO_DISK_CACHE=
-  NECKO_PROTOCOLS_DEFAULT="about data http file res"
-  NECKO_SMALL_BUFFERS=1
-  NS_DISABLE_LOGGING=1
-  NS_PRINTING=
-  JS_STATIC_BUILD=1
-  ;;
-
-minimal)
-  MOZ_EMBEDDING_LEVEL_DEFAULT=
-  MOZ_EMBEDDING_LEVEL_BASIC=
-  MOZ_EMBEDDING_LEVEL_MINIMAL=1
-  AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
-  ENABLE_TESTS=
-  MOZ_ACTIVEX_SCRIPTING_SUPPORT=
-  MOZ_ENABLE_CANVAS=
-  MOZ_ENABLE_POSTSCRIPT=
-  MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
-  MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
-  MOZ_IMG_ENCODERS_DEFAULT=
-  MOZ_IMG_ENCODERS=
-  MOZ_INSTALLER=
-  MOZ_JSDEBUGGER=
-  MOZ_MATHML=
-  MOZ_AUTH_EXTENSION=
-  MOZ_NO_ACTIVEX_SUPPORT=1
-  MOZ_NO_INSPECTOR_APIS=1
-  MOZ_NO_XPCOM_OBSOLETE=1
-  MOZ_NO_FAST_LOAD=1
-  MOZ_OJI=
-  MOZ_PLAINTEXT_EDITOR_ONLY=1
-  MOZ_PLUGINS=
-  MOZ_PREF_EXTENSIONS=
-  MOZ_PROFILELOCKING=
-  MOZ_PROFILESHARING=
-  MOZ_SPELLCHECK=
-  MOZ_STORAGE=1
-  MOZ_PLACES=
-  MOZ_SVG=
-  MOZ_UNIVERSALCHARDET=
-  MOZ_UPDATER=
-  MOZ_USE_NATIVE_UCONV=1
-  MOZ_VIEW_SOURCE=
-  MOZ_XPFE_COMPONENTS=
-  MOZ_XPINSTALL=
-  MOZ_XTF=
-  MOZ_XUL=
-  MOZ_ZIPWRITER=
-  MOZ_RDF=
-  NECKO_DISK_CACHE=
-  NECKO_PROTOCOLS_DEFAULT="about data http file res"
-  NECKO_SMALL_BUFFERS=1
-  NS_DISABLE_LOGGING=1
-  NS_PRINTING=
-  JS_STATIC_BUILD=1
-  ;;
-
-*)
-  AC_MSG_ERROR([Unrecognized value: --with-embedding-profile=$MOZ_EMBEDDING_PROFILE])
-  ;;
-esac
-
-AC_SUBST(MOZ_EMBEDDING_LEVEL_DEFAULT)
-AC_SUBST(MOZ_EMBEDDING_LEVEL_BASIC)
-AC_SUBST(MOZ_EMBEDDING_LEVEL_MINIMAL)
-
-MOZ_ARG_WITH_STRING(xulrunner-stub-name,
-[  --with-xulrunner-stub-name=appname   Create the xulrunner stub with the given name],
-  XULRUNNER_STUB_NAME=$withval)
-
-if test -z "$XULRUNNER_STUB_NAME"; then
-  case "$target_os" in
-  darwin*)
-    XULRUNNER_STUB_NAME=xulrunner
-    ;;
-  *)
-    XULRUNNER_STUB_NAME=xulrunner-stub
-  esac
-fi
-AC_SUBST(XULRUNNER_STUB_NAME)
-
-if test -z "$MOZ_BUILD_APP"; then
-  AC_MSG_ERROR([--enable-application=APP was not specified and is required.])
-else
-  # We have a valid application only if it has a build.mk file in its top
-  # directory.
-  if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
-    AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
-  fi
-fi
-
-# Allow the application to influence configure with a confvars.sh script.
-
-AC_MSG_CHECKING([if app-specific confvars.sh exists])
-if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
-  AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
-  . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
-else
-  AC_MSG_RESULT([no])
-fi
-
-# Now is a good time to test for logic errors, define mismatches, etc.
-case "$MOZ_BUILD_APP" in
-xulrunner)
-  if test "$LIBXUL_SDK"; then
-    AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
-  fi
-  ;;
-*)
-  # Fix this case for folks who forget. Warn them.
-  if test -n "$LIBXUL_SDK" -a -z "$MOZ_XUL_APP"; then
-    AC_MSG_WARN([Setting MOZ_XUL_APP since LIBXUL_SDK was set. Add to confvars.sh!])
-    MOZ_XUL_APP=1
-  fi
-  ;;
-esac
-
-# Special cases where we need to AC_DEFINE something. Also a holdover for apps
-# that haven't made a confvars.sh yet. Don't add new stuff here, use
-# MOZ_BUILD_APP.
-case "$MOZ_BUILD_APP" in
-browser)
-  AC_DEFINE(MOZ_PHOENIX)
-  ;;
-
-xulrunner)
-  AC_DEFINE(MOZ_XULRUNNER)
-  ;;
-
-content/xslt)
-  AC_DEFINE(TX_EXE)
-  ;;
-
-standalone) 
-  MOZ_APP_NAME=mozilla
-  MOZ_APP_DISPLAYNAME=Mozilla
-  MOZ_APP_VERSION=$MOZILLA_VERSION
-  ;;
-
-esac
-
-if test -z "$MOZ_XUL_APP"; then
-	AC_MSG_ERROR([builds with unsetting MOZ_XUL_APP in confvars.sh are not supported.])
-fi
-
-AC_SUBST(MOZ_BUILD_APP)
-AC_SUBST(MOZ_XUL_APP)
-AC_SUBST(MOZ_PHOENIX)
-AC_SUBST(MOZ_XULRUNNER)
-
-AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
-
-if test "$MOZ_XUL_APP"; then
-  MOZ_PROFILESHARING=
-  AC_DEFINE(MOZ_XUL_APP)
-fi
-
-dnl ========================================================
-dnl = 
-dnl = Toolkit Options
-dnl = 
-dnl ========================================================
-MOZ_ARG_HEADER(Toolkit Options)
-
-    dnl ========================================================
-    dnl = Select the default toolkit
-    dnl ========================================================
-	MOZ_ARG_ENABLE_STRING(default-toolkit,
-	[  --enable-default-toolkit=TK
-                          Select default toolkit
-                          Platform specific defaults:
-                            BeOS - cairo-beos
-                            Mac OS X - cairo-cocoa
-                            Neutrino/QNX - photon
-                            OS/2 - cairo-os2
-                            Win32 - cairo-windows
-                            WinCE - 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" \
-        -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
-        -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-dfb" \
-        -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
-        -o "$_DEFAULT_TOOLKIT" = "cairo-qt" \
-        -o "$_DEFAULT_TOOLKIT" = "cairo-beos" \
-        -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
-        -o "$_DEFAULT_TOOLKIT" = "cairo-mac" \
-        -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa"
-    then
-        dnl nglayout only supports building with one toolkit,
-        dnl so ignore everything after the first comma (",").
-        MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
-    else
-        AC_MSG_ERROR([You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).])
-    fi
-
-AC_DEFINE_UNQUOTED(MOZ_DEFAULT_TOOLKIT,"$MOZ_WIDGET_TOOLKIT")
-
-dnl ========================================================
-dnl = Enable the toolkit as needed                         =
-dnl ========================================================
-
-case "$MOZ_WIDGET_TOOLKIT" in
-photon)
-	MOZ_ENABLE_PHOTON=1
-	AC_DEFINE(MOZ_WIDGET_PHOTON)
-    ;;
-
-cairo-windows)
-    MOZ_WIDGET_TOOLKIT=windows
-    MOZ_GFX_TOOLKIT=cairo
-    ;;
-
-cairo-gtk2|cairo-gtk2-x11)
-    MOZ_WIDGET_TOOLKIT=gtk2
-    MOZ_GFX_TOOLKIT=cairo
-    MOZ_ENABLE_GTK2=1
-    MOZ_ENABLE_XREMOTE=1
-
-    AC_DEFINE(MOZ_X11)
-    MOZ_X11=1
-
-    TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
-    TK_LIBS='$(MOZ_GTK2_LIBS)'
-    AC_DEFINE(MOZ_WIDGET_GTK2)
-    ;;
-
-cairo-gtk2-dfb)
-    MOZ_WIDGET_TOOLKIT=gtk2
-    MOZ_GFX_TOOLKIT=cairo
-    MOZ_ENABLE_GTK2=1
-
-    AC_DEFINE(MOZ_DFB)
-    MOZ_DFB=1
-
-    TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
-    TK_LIBS='$(MOZ_GTK2_LIBS)'
-    AC_DEFINE(MOZ_WIDGET_GTK2)
-    if test "$no_x" != "yes"; then
-        AC_MSG_WARN([Disabling X when DirectFB is specified.])
-        no_x=yes
-    fi
-    ;;
-
-cairo-qt)
-    MOZ_WIDGET_TOOLKIT=qt
-    MOZ_GFX_TOOLKIT=cairo
-    MOZ_ENABLE_QT=1
-    MOZ_ENABLE_XREMOTE=1
-    USE_ELF_DYNSTR_GC=
-
-    AC_DEFINE(MOZ_X11)
-    MOZ_X11=1
-
-    TK_CFLAGS='$(MOZ_QT_CFLAGS)'
-    TK_LIBS='$(MOZ_QT_LIBS)'
-    AC_DEFINE(MOZ_WIDGET_QT)
-    ;;
-
-cairo-beos)
-    MOZ_WIDGET_TOOLKIT=beos
-    MOZ_GFX_TOOLKIT=cairo
-    TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
-    TK_LIBS='$(MOZ_CAIRO_LIBS)'
-    ;;
-
-cairo-os2)
-    MOZ_WIDGET_TOOLKIT=os2
-    MOZ_GFX_TOOLKIT=cairo
-    TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
-    TK_LIBS='$(MOZ_CAIRO_LIBS)'
-    ;;
-
-cairo-mac|cairo-cocoa)
-    if test "$MOZ_WIDGET_TOOLKIT" = "cairo-cocoa"; then
-        MOZ_WIDGET_TOOLKIT=cocoa
-        AC_DEFINE(MOZ_WIDGET_COCOA)
-        MOZ_ENABLE_COCOA=1
-    else
-        MOZ_WIDGET_TOOLKIT=mac
-    fi
-    MOZ_GFX_TOOLKIT=cairo
-    MOZ_USER_DIR="Mozilla"
-    AC_DEFINE(XP_MACOSX)
-    AC_DEFINE(TARGET_CARBON)
-    AC_DEFINE(TARGET_API_MAC_CARBON)
-    TK_LIBS='-framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook'
-    TK_CFLAGS="-I${MACOS_SDK_DIR}/Developer/Headers/FlatCarbon"
-    CFLAGS="$CFLAGS $TK_CFLAGS"
-    CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
-    ;;
-esac
-
-if test "$MOZ_ENABLE_XREMOTE"; then
-    AC_DEFINE(MOZ_ENABLE_XREMOTE)
-fi
-
-if test "$COMPILE_ENVIRONMENT"; then
-  if test "$MOZ_ENABLE_GTK2"; then
-    if test "$MOZ_X11"; then
-      GDK_PACKAGES=gdk-x11-2.0
-    elif test "$MOZ_DFB"; then
-      PKG_CHECK_MODULES(MOZ_DFB, directfb >= 1.1.0)
-      GDK_PACKAGES=directfb
-    fi
-
-    PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
-  fi
-
-fi # COMPILE_ENVIRONMENT
-
-AC_SUBST(MOZ_DEFAULT_TOOLKIT)
-
-dnl ========================================================
-dnl = startup-notification support module
-dnl ========================================================
-
-if test "$MOZ_ENABLE_GTK2"
-then
-    MOZ_ENABLE_STARTUP_NOTIFICATION=
-
-    MOZ_ARG_ENABLE_BOOL(startup-notification,
-    [  --enable-startup-notification       Enable startup-notification support (default: disabled) ],
-        MOZ_ENABLE_STARTUP_NOTIFICATION=force,
-        MOZ_ENABLE_STARTUP_NOTIFICATION=)
-    if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
-    then
-        PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
-                          libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
-        [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
-            if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
-            then
-                AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
-            fi
-            MOZ_ENABLE_STARTUP_NOTIFICATION=
-        ])
-    fi
-
-    if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
-        AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
-    fi
-
-    TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
-fi
-AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
-AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
-AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
-
-dnl ========================================================
-dnl = QT support
-dnl ========================================================
-if test "$MOZ_ENABLE_QT"
-then
-    PKG_CHECK_MODULES(MOZ_QT, QtGui QtNetwork QtUiTools QtCore)
-    AC_SUBST(MOZ_QT_CFLAGS)
-    AC_SUBST(MOZ_QT_LIBS)
-
-    MOZ_ARG_WITH_STRING(qtdir,
-    [  --with-qtdir=\$dir       Specify Qt directory ],
-    [ QTDIR=$withval])
-
-    if test -z "$QTDIR"; then
-      QTDIR="/usr"
-    fi
-    QTINCDIR="/include/qt"
-    if test ! -d "$QTDIR$QTINCDIR"; then
-       QTINCDIR="/include/X11/qt"
-    fi
-    if test ! -d "$QTDIR$QTINCDIR"; then
-       QTINCDIR="/include"
-    fi
-
-    if test -x "$QTDIR/bin/moc-qt4"; then
-      HOST_MOC="$QTDIR/bin/moc-qt4"
-    else
-      if test -x "$QTDIR/bin/moc"; then
-        HOST_MOC="$QTDIR/bin/moc"
-      else
-        AC_CHECK_PROGS(HOST_MOC, moc, "")
-      fi
-    fi
-    if test -z "$HOST_MOC"; then
-      AC_MSG_ERROR([no acceptable moc preprocessor found])
-    fi
-    MOC=$HOST_MOC
-fi
-
-AC_SUBST(GTK_CONFIG)
-AC_SUBST(TK_CFLAGS)
-AC_SUBST(TK_LIBS)
-
-AC_SUBST(MOZ_ENABLE_GTK2)
-AC_SUBST(MOZ_ENABLE_PHOTON)
-AC_SUBST(MOZ_ENABLE_COCOA)
-AC_SUBST(MOZ_ENABLE_QT)
-AC_SUBST(MOZ_ENABLE_XREMOTE)
-AC_SUBST(MOZ_GTK2_CFLAGS)
-AC_SUBST(MOZ_GTK2_LIBS)
-AC_SUBST(MOZ_QT_CFLAGS)
-AC_SUBST(MOZ_QT_LIBS)
-
-AC_SUBST(MOC)
-
-AC_SUBST(MOZ_DFB)
-AC_SUBST(MOZ_X11)
 
 dnl ========================================================
 dnl =
 dnl = Components & Features
 dnl = 
 dnl ========================================================
 MOZ_ARG_HEADER(Components and Features)
 
@@ -4865,1205 +3852,46 @@ dnl = Localization
 dnl ========================================================
 MOZ_ARG_ENABLE_STRING(ui-locale,
 [  --enable-ui-locale=ab-CD
                           Select the user interface locale (default: en-US)],
     MOZ_UI_LOCALE=$enableval )
 AC_SUBST(MOZ_UI_LOCALE)
 
 dnl ========================================================
-dnl = Trademarked Branding 
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(official-branding,
-[  --enable-official-branding Enable Official mozilla.org Branding
-                          Do not distribute builds with
-                          --enable-official-branding unless you have
-                          permission to use trademarks per
-                          http://www.mozilla.org/foundation/trademarks/ .],
-[case "$MOZ_BUILD_APP" in
-browser)
-    MOZ_BRANDING_DIRECTORY=other-licenses/branding/firefox
-    MOZ_APP_DISPLAYNAME=Firefox
-    ;;
-
-*)]
-    AC_MSG_ERROR([Official branding is only available for Firefox.])
-esac
-)
-
-MOZ_ARG_WITH_STRING(branding,
-[  --with-branding=dir    Use branding from the specified directory.],
-    MOZ_BRANDING_DIRECTORY=$withval)
-
-REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
-if test -z "$REAL_BRANDING_DIRECTORY"; then
-  REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
-fi
-
-if test -f "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"; then
-  . "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"
-fi
-
-AC_SUBST(MOZ_BRANDING_DIRECTORY)
-
-dnl ========================================================
-dnl = Distribution ID
-dnl ========================================================
-MOZ_ARG_WITH_STRING(distribution-id,
-[  --with-distribution-id=ID  Set distribution-specific id (default=org.mozilla)],
-[ val=`echo $withval`
-    MOZ_DISTRIBUTION_ID="$val"])
-
-if test -z "$MOZ_DISTRIBUTION_ID"; then
-   MOZ_DISTRIBUTION_ID="org.mozilla"
-fi
-
-AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
-AC_SUBST(MOZ_DISTRIBUTION_ID)
-
-
-dnl ========================================================
-dnl complex text support off by default
-dnl ========================================================
-MOZ_PANGO=1
-MOZ_ARG_DISABLE_BOOL(pango,
-[  --disable-pango Disable usage of Pango ],
-    MOZ_PANGO=,
-    MOZ_PANGO=1)
-
-
-dnl ========================================================
-dnl = Pango
-dnl ========================================================
-if test "$MOZ_ENABLE_GTK2"
-then
-    AC_SUBST(MOZ_PANGO)
-
-    PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
-
-    if test "$MOZ_PANGO"
-    then
-        PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
-        AC_SUBST(MOZ_PANGO_CFLAGS)
-        AC_SUBST(MOZ_PANGO_LIBS)
-        AC_DEFINE(MOZ_PANGO)
-    else
-        PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
-        AC_SUBST(MOZ_PANGO_CFLAGS)
-        AC_SUBST(MOZ_PANGO_LIBS)
-
-        PKG_CHECK_MODULES(FT2, freetype2 > 6.1.0 fontconfig)
-        AC_SUBST(FT2_CFLAGS)
-        AC_SUBST(FT2_LIBS)
-    fi
-fi
-
-dnl ========================================================
-dnl = PostScript print module
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(postscript,
-[  --disable-postscript    Disable PostScript printing support ],
-    MOZ_ENABLE_POSTSCRIPT=,
-    MOZ_ENABLE_POSTSCRIPT=1 )
-
-dnl ========================================================
-dnl = GnomeVFS support module
-dnl ========================================================
-
-if test "$MOZ_X11"
-then
-    dnl build the gnomevfs extension by default only when the
-    dnl GTK2 toolkit is in use.
-    if test "$MOZ_ENABLE_GTK2"
-    then
-        MOZ_ENABLE_GNOMEVFS=1
-        MOZ_ENABLE_GCONF=1
-        MOZ_ENABLE_LIBGNOME=1
-    fi
-
-    MOZ_ARG_DISABLE_BOOL(gnomevfs,
-    [  --disable-gnomevfs      Disable GnomeVFS support ],
-        MOZ_ENABLE_GNOMEVFS=,
-        MOZ_ENABLE_GNOMEVFS=force)
-
-    if test "$MOZ_ENABLE_GNOMEVFS"
-    then
-        PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
-            MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
-            MOZ_ENABLE_GNOMEVFS=1
-        ],[
-            if test "$MOZ_ENABLE_GNOMEVFS" = "force"
-            then
-                AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
-            fi
-            MOZ_ENABLE_GNOMEVFS=
-        ])
-    fi
-
-    AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
-    AC_SUBST(MOZ_GNOMEVFS_LIBS)
-
-    if test "$MOZ_ENABLE_GCONF"
-    then
-        PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION,[
-            MOZ_GCONF_LIBS=`echo $MOZ_GCONF_LIBS | sed 's/-llinc\>//'`
-            MOZ_ENABLE_GCONF=1
-        ],[
-            MOZ_ENABLE_GCONF=
-        ])
-    fi
-
-    if test "$MOZ_ENABLE_GCONF"; then
-        AC_DEFINE(MOZ_ENABLE_GCONF)
-    fi
-
-    AC_SUBST(MOZ_ENABLE_GCONF)
-    AC_SUBST(MOZ_GCONF_CFLAGS)
-    AC_SUBST(MOZ_GCONF_LIBS)
-
-    if test "$MOZ_ENABLE_LIBGNOME"
-    then
-        PKG_CHECK_MODULES(MOZ_LIBGNOME, libgnome-2.0 >= $LIBGNOME_VERSION,[
-            MOZ_LIBGNOME_LIBS=`echo $MOZ_LIBGNOME_LIBS | sed 's/-llinc\>//'`
-            MOZ_ENABLE_LIBGNOME=1
-        ],[
-            MOZ_ENABLE_LIBGNOME=
-        ])
-    fi
-
-    AC_SUBST(MOZ_LIBGNOME_CFLAGS)
-    AC_SUBST(MOZ_LIBGNOME_LIBS)
-
-    # The GNOME component is built if gtk2, gconf, gnome-vfs, and libgnome
-    # are all available.
-
-    if test "$MOZ_ENABLE_GTK2" -a "$MOZ_ENABLE_GCONF" -a \
-            "$MOZ_ENABLE_GNOMEVFS" -a "$MOZ_ENABLE_LIBGNOME"; then
-      MOZ_ENABLE_GNOME_COMPONENT=1
-    else
-      MOZ_ENABLE_GNOME_COMPONENT=
-    fi
-
-    AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
-fi
-
-dnl ========================================================
-dnl = libgnomeui support module
-dnl ========================================================
-
-if test "$MOZ_ENABLE_GTK2"
-then
-    MOZ_ENABLE_GNOMEUI=1
-
-    MOZ_ARG_DISABLE_BOOL(gnomeui,
-    [  --disable-gnomeui       Disable libgnomeui support (default: auto, optional at runtime) ],
-        MOZ_ENABLE_GNOMEUI=,
-        MOZ_ENABLE_GNOMEUI=force)
-
-    if test "$MOZ_ENABLE_GNOMEUI"
-    then
-        PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
-        [
-            MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
-            MOZ_ENABLE_GNOMEUI=1
-        ],[
-            if test "$MOZ_ENABLE_GNOMEUI" = "force"
-            then
-                AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
-            fi
-            MOZ_ENABLE_GNOMEUI=
-        ])
-    fi
-
-    if test "$MOZ_ENABLE_GNOMEUI"; then
-        AC_DEFINE(MOZ_ENABLE_GNOMEUI)
-    fi
-fi
-AC_SUBST(MOZ_ENABLE_GNOMEUI)
-AC_SUBST(MOZ_GNOMEUI_CFLAGS)
-AC_SUBST(MOZ_GNOMEUI_LIBS)
-
-dnl ========================================================
-dnl = dbus support
-dnl ========================================================
-
-if test "$MOZ_ENABLE_GTK2" || test "$MOZ_ENABLE_QT"
-then
-    MOZ_ENABLE_DBUS=1
-
-    MOZ_ARG_DISABLE_BOOL(dbus,
-    [  --disable-dbus       Disable dbus support ],
-        MOZ_ENABLE_DBUS=,
-        MOZ_ENABLE_DBUS=1)
-
-    if test "$MOZ_ENABLE_DBUS"
-    then
-        PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
-        AC_DEFINE(MOZ_ENABLE_DBUS)
-    fi
-fi
-AC_SUBST(MOZ_ENABLE_DBUS)
-AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
-AC_SUBST(MOZ_DBUS_GLIB_LIBS)
-
-dnl ========================================================
-dnl = Build Personal Security Manager
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(crypto,
-[  --disable-crypto        Disable crypto support (Personal Security Manager)],
-    MOZ_PSM=,
-    MOZ_PSM=1 )
-
-dnl ========================================================
-dnl = JS Debugger XPCOM component (js/jsd)
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(jsd,
-[  --disable-jsd           Disable JavaScript debug library],
-    MOZ_JSDEBUGGER=,
-    MOZ_JSDEBUGGER=1)
-
-
-dnl ========================================================
-dnl = Disable plugin support
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(plugins,
-[  --disable-plugins       Disable plugins support],
-    MOZ_PLUGINS=,
-    MOZ_PLUGINS=1)
-
-dnl ========================================================
-dnl = Open JVM Interface (OJI) support
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(oji,
-[  --disable-oji           Disable Open JVM Integration support],
-    MOZ_OJI=,
-    MOZ_OJI=1)
-if test -n "$MOZ_OJI"; then
-    AC_DEFINE(OJI)
-fi
-
-dnl bi-directional support always on
-IBMBIDI=1
-AC_DEFINE(IBMBIDI)
-
-dnl ========================================================
-dnl view source support on by default
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(view-source,
-[  --disable-view-source     Disable view source support],
-    MOZ_VIEW_SOURCE=,
-    MOZ_VIEW_SOURCE=1 )
-if test "$MOZ_VIEW_SOURCE"; then
-    AC_DEFINE(MOZ_VIEW_SOURCE)
-fi
-
-
-dnl ========================================================
-dnl accessibility support on by default on all platforms 
-dnl except OS X.
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(accessibility,
-[  --disable-accessibility Disable accessibility support (off by default on OS X)],
-    ACCESSIBILITY=,
-    ACCESSIBILITY=1 )
-if test "$ACCESSIBILITY"; then
-    AC_DEFINE(ACCESSIBILITY)
-fi
-
-if test -n "$ACCESSIBILITY" -a "$COMPILE_ENVIRONMENT" = "1"; then
-case "$target" in
-*-mingw*|*-cygwin*|*-msvc*|*-mks*)
-    if test "$ac_cv_header_atlbase_h" = "no"; then
-        AC_MSG_ERROR([System header atlbase.h is not available. See http://developer.mozilla.org/en/docs/atlbase.h for details on fixing this problem.])
-    fi
-    if test "$ac_cv_header_oleacc_idl" = "no"; then
-        AC_MSG_ERROR([System header oleacc.idl is not available. See http://developer.mozilla.org/en/docs/oleacc.idl for details on fixing this problem.])
-    fi
-    ;;
-esac
-fi
-
-dnl ========================================================
-dnl xpfe/components on by default
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(xpfe-components,
-[  --disable-xpfe-components
-                          Disable xpfe components],
-    MOZ_XPFE_COMPONENTS=,
-    MOZ_XPFE_COMPONENTS=1 )
-
-dnl ========================================================
-dnl xpinstall support on by default
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(xpinstall,
-[  --disable-xpinstall     Disable xpinstall support],
-    MOZ_XPINSTALL=,
-    MOZ_XPINSTALL=1 )
-if test "$MOZ_XPINSTALL"; then
-    AC_DEFINE(MOZ_XPINSTALL)
-fi
-
-dnl ========================================================
-dnl xpcom js loader support on by default
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(jsloader,
-[  --disable-jsloader      Disable xpcom js loader support],
-    MOZ_JSLOADER=,
-    MOZ_JSLOADER=1 )
-if test "$MOZ_JSLOADER"; then
-    AC_DEFINE(MOZ_JSLOADER)
-fi
-
-dnl ========================================================
-dnl Disable printing
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(printing,
-[  --disable-printing  Disable printing support],
-    NS_PRINTING=,
-    NS_PRINTING=1 )
-
-if test "$NS_PRINTING"; then
-    AC_DEFINE(NS_PRINTING)
-    AC_DEFINE(NS_PRINT_PREVIEW)
-fi
-
-dnl ========================================================
-dnl use native unicode converters
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(native-uconv,
-[  --enable-native-uconv   Enable iconv support],
-    MOZ_USE_NATIVE_UCONV=1,
-    MOZ_USE_NATIVE_UCONV= )
-if test "$MOZ_USE_NATIVE_UCONV"; then
-    AC_DEFINE(MOZ_USE_NATIVE_UCONV)
-fi
-if test "$OS_ARCH" != "WINCE" -a "$OS_ARCH" != "WINNT" -a "$MOZ_USE_NATIVE_UCONV" -a "$ac_cv_func_iconv" != "yes"; then
-    AC_MSG_ERROR([iconv() not found.  Cannot enable native uconv support.])
-fi
-
-
-dnl ========================================================
-dnl Libeditor can be build as plaintext-only,
-dnl or as a full html and text editing component.
-dnl We build both by default.
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(plaintext-editor-only,
-[  --enable-plaintext-editor-only
-                          Allow only plaintext editing],
-    MOZ_PLAINTEXT_EDITOR_ONLY=1,
-    MOZ_PLAINTEXT_EDITOR_ONLY= )
-dnl Note the #define is MOZILLA, not MOZ, for compat with the Mac build.
-AC_SUBST(MOZ_PLAINTEXT_EDITOR_ONLY)
-
-dnl ========================================================
-dnl = Drop XPCOM Obsolete library
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(xpcom-obsolete,
-[  --disable-xpcom-obsolete           Disable XPCOM Obsolete Library],
-    MOZ_NO_XPCOM_OBSOLETE=1,
-    MOZ_NO_XPCOM_OBSOLETE=)
-
-if test -n "$MOZ_NO_XPCOM_OBSOLETE"; then
-    AC_DEFINE(MOZ_NO_XPCOM_OBSOLETE)
-fi
-
-dnl ========================================================
-dnl = Disable Fast Load
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(xpcom-fastload,
-[  --disable-xpcom-fastload           Disable XPCOM fastload support],
-    MOZ_NO_FAST_LOAD=1,
-    MOZ_NO_FAST_LOAD=)
-
-AC_SUBST(MOZ_NO_FAST_LOAD)
-
-if test -n "$MOZ_NO_FAST_LOAD"; then
-    AC_DEFINE(MOZ_NO_FAST_LOAD)
-fi
-
-dnl ========================================================
-dnl = Enable Ogg Codecs
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(ogg,
-[  --disable-ogg           Disable Ogg Codec support],
-    MOZ_OGG=,
-    MOZ_OGG=1)
-
-AC_SUBST(MOZ_OGG)
-
-if test -n "$MOZ_OGG"; then
-    AC_DEFINE(MOZ_OGG)
-    MOZ_MEDIA=1
-fi
-
-AC_SUBST(MOZ_MEDIA)
-
-if test -n "$MOZ_MEDIA"; then
-    AC_DEFINE(MOZ_MEDIA)
-fi
-
-dnl If using Ogg with Linux, ensure that the alsa library is available
-if test -n "$MOZ_OGG"; then
-   case "$target_os" in
-linux*)
-      AC_CHECK_LIB(asound, snd_pcm_open,,AC_MSG_ERROR([Ogg support on Linux requires the alsa library]))
-      ;;
-   esac
-fi
-
-dnl ========================================================
-dnl Permissions System
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(permissions,
-[  --disable-permissions   Disable permissions (popup and cookie blocking)],
-    MOZ_PERMISSIONS=,
-    MOZ_PERMISSIONS=1
-)
-
-dnl ========================================================
-dnl NegotiateAuth
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(negotiateauth,
-[  --disable-negotiateauth Disable GSS-API negotiation ],
-    MOZ_AUTH_EXTENSION=,
-    MOZ_AUTH_EXTENSION=1 )
-
-dnl ========================================================
-dnl XTF
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(xtf,
-[  --disable-xtf           Disable XTF (pluggable xml tags) support],
-    MOZ_XTF=,
-    MOZ_XTF=1 )
-if test "$MOZ_XTF"; then
-  AC_DEFINE(MOZ_XTF)
-fi
-
-dnl ========================================================
-dnl Inspector APIs
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(inspector-apis,
-[  --disable-inspector-apis Disable the DOM inspection APIs ],
-    MOZ_NO_INSPECTOR_APIS=1,
-    MOZ_NO_INSPECTOR_APIS= )
-
-dnl ========================================================
-dnl Pref extensions (autoconfig and system-pref)
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(pref-extensions,
-[  --disable-pref-extensions
-                          Disable pref extensions such as autoconfig and
-                          system-pref],
-  MOZ_PREF_EXTENSIONS=,
-  MOZ_PREF_EXTENSIONS=1 )
-
-dnl ========================================================
-dnl = Universalchardet
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(universalchardet,
-[  --disable-universalchardet
-                          Disable universal encoding detection],
-  MOZ_UNIVERSALCHARDET=,
-  MOZ_UNIVERSALCHARDET=1 )
-
-dnl ========================================================
-dnl JavaXPCOM
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(javaxpcom,
-[  --enable-javaxpcom
-                          Enable Java-XPCOM bridge],
-    MOZ_JAVAXPCOM=1,
-    MOZ_JAVAXPCOM= )
-
-if test -n "${MOZ_JAVAXPCOM}"; then
-  case "$host_os" in
-    cygwin*|msvc*|mks*)
-      if test -n "$JAVA_HOME"; then
-        JAVA_HOME=`cygpath -u \`cygpath -m -s "$JAVA_HOME"\``
-      fi
-      ;;
-    *mingw*)
-      if test -n "$JAVA_HOME"; then
-        JAVA_HOME=`cd "$JAVA_HOME" && pwd`
-      fi
-      ;;
-  esac
-
-  if test -n "${JAVA_INCLUDE_PATH}"; then
-    dnl Make sure jni.h exists in the given include path.
-    if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
-      AC_MSG_ERROR([jni.h was not found in given include path $JAVA_INCLUDE_PATH.])
-    fi
-  else
-    case "$target_os" in
-      darwin*)
-        dnl Default to java system location
-        JAVA_INCLUDE_PATH=/System/Library/Frameworks/JavaVM.framework/Headers
-        ;;
-      *)
-        dnl Try $JAVA_HOME
-        JAVA_INCLUDE_PATH="$JAVA_HOME/include"
-        ;;
-    esac
-    if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
-      AC_MSG_ERROR([The header jni.h was not found.  Set \$JAVA_HOME to your java sdk directory, use --with-java-bin-path={java-bin-dir}, or reconfigure with --disable-javaxpcom.])
-    fi
-  fi
-
-  if test -n "${JAVA_BIN_PATH}"; then
-    dnl Look for javac and jar in the specified path.
-    JAVA_PATH="$JAVA_BIN_PATH"
-  else
-    dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
-    JAVA_PATH="$JAVA_HOME/bin:$PATH"
-  fi
-
-  AC_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
-  AC_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
-  AC_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
-  if test -z "$JAVA" || test "$JAVA" = ":" || test -z "$JAVAC" || test "$JAVAC" = ":" || test -z "$JAR" || test "$JAR" = ":"; then
-    AC_MSG_ERROR([The programs java, javac and jar were not found.  Set \$JAVA_HOME to your java sdk directory, use --with-java-bin-path={java-bin-dir}, or reconfigure with --disable-javaxpcom.])
-  fi
-fi
-
-dnl ========================================================
-dnl = Breakpad crash reporting (on by default on supported platforms)
-dnl ========================================================
-
-if (test "$OS_ARCH" = "WINNT" -a -z "$GNU_CC" \
-    || test "$OS_ARCH" = "Darwin" \
-    || test "$OS_ARCH" = "Linux" -a "$CPU_ARCH" = "x86" \
-    || test "$OS_ARCH" = "SunOS") \
-   && test -z "$HAVE_64BIT_OS"; then
-   MOZ_CRASHREPORTER=1
-fi
-
-MOZ_ARG_DISABLE_BOOL(crashreporter,
-[  --disable-crashreporter          Disable breakpad crash reporting],
-    MOZ_CRASHREPORTER=,
-    MOZ_CRASHREPORTER=1)
-
-if test -n "$MOZ_CRASHREPORTER"; then
-   AC_DEFINE(MOZ_CRASHREPORTER)
-
-  if (test "$OS_ARCH" = "Linux" || test "$OS_ARCH" = "SunOS") && \
-    test -z "$SKIP_LIBRARY_CHECKS"; then
-    PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
-    AC_SUBST(MOZ_GTHREAD_CFLAGS)
-    AC_SUBST(MOZ_GTHREAD_LIBS)
-
-    AC_CHECK_HEADERS([curl/curl.h], [], [AC_MSG_ERROR([Couldn't find curl/curl.h which is required for the crash reporter.  Use --disable-crashreporter to disable the crash reporter.])])
-  fi
-fi
-
-MOZ_ARG_WITH_STRING(crashreporter-enable-percent,
-[  --with-crashreporter-enable-percent=NN  Enable sending crash reports by default on NN% of users. (default=100)],
-[ val=`echo $withval | sed 's/[^0-9]//g'`
-    MOZ_CRASHREPORTER_ENABLE_PERCENT="$val"])
-
-if test -z "$MOZ_CRASHREPORTER_ENABLE_PERCENT"; then
-   MOZ_CRASHREPORTER_ENABLE_PERCENT=100
-fi
-AC_DEFINE_UNQUOTED(MOZ_CRASHREPORTER_ENABLE_PERCENT, $MOZ_CRASHREPORTER_ENABLE_PERCENT)
-
-dnl ========================================================
-dnl = Enable compilation of specific extension modules
-dnl ========================================================
-
-MOZ_ARG_ENABLE_STRING(extensions,
-[  --enable-extensions     Enable extensions],
-[ for option in `echo $enableval | sed 's/,/ /g'`; do
-    if test "$option" = "yes" || test "$option" = "all"; then
-        AC_MSG_ERROR([--enable-extensions=$option is no longer supported.])
-    elif test "$option" = "no" || test "$option" = "none"; then
-        MOZ_EXTENSIONS=""
-    elif test "$option" = "default"; then
-        MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
-    elif test `echo "$option" | grep -c \^-` != 0; then
-        option=`echo $option | sed 's/^-//'`
-        MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
-    else
-        MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
-    fi
-done],
-    MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
-
-if test -z "$MOZ_ENABLE_GNOMEVFS" && test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
-    # Suppress warning on non-X11 platforms
-    if test -n "$MOZ_X11"; then
-        AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
-    fi
-    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
-fi
-
-if test -z "$MOZ_JSDEBUGGER" && test `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
-    AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
-    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
-fi
-
-dnl This might be temporary: build tridentprofile only on Windows
-if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0 && test "$OS_ARCH" != "WINNT"; then
-    AC_MSG_WARN([tridentprofile extension works only on Windows at this time. Removing tridentprofile from MOZ_EXTENSIONS.])
-    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
-fi
-
-dnl cookie must be built before tridentprofile. put it at list's end.
-if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0; then
-  MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
-  MOZ_EXTENSIONS="$MOZ_EXTENSIONS tridentprofile"
-fi
-
-dnl xforms requires xtf and schema-validation
-if test -z "$MOZ_XTF" && test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
-    AC_MSG_WARN([Cannot build XForms without XTF support.  Removing XForms from MOZ_EXTENSIONS.])
-    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
-fi
-if test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0 && test `echo "$MOZ_EXTENSIONS" | grep -c schema-validation` -eq 0; then
-    AC_MSG_WARN([Cannot build XForms without schema validation.  Removing XForms from MOZ_EXTENSIONS.])
-    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
-fi
-
-if test `echo "$MOZ_EXTENSIONS" | grep -c auth` -ne 0; then
-    AC_MSG_WARN([auth is no longer an extension, use --disable-negotiateauth to disable.])
-    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|auth||g'`
-fi
-
-if test `echo "$MOZ_EXTENSIONS" | grep -c 'cookie\|permissions'` -ne 0; then
-    AC_MSG_WARN([cookie and permissions are no longer extensions, use --disable-permissions to disable.])
-    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|cookie||g; s|permissions||g'`
-fi
-
-if test `echo "$MOZ_EXTENSIONS" | grep -c pref` -ne 0; then
-    AC_MSG_WARN([pref is no longer an extension, use --disable-pref-extensions to disable.])
-    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|pref||g'`
-fi
-
-if test `echo "$MOZ_EXTENSIONS" | grep -c universalchardet` -ne 0; then
-    AC_MSG_WARN([universalchardet is no longer an extension, use --disable-universalchardet to disable.])
-    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|universalchardet||g'`
-fi
-
-if test `echo "$MOZ_EXTENSIONS" | grep -c java` -ne 0; then
-    AC_MSG_WARN([java is no longer an extension, use --enable-javaxpcom to enable.])
-    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|java||g'`
-fi
-
-if test `echo "$MOZ_EXTENSIONS" | grep -c spellcheck` -ne 0; then
-    AC_MSG_WARN([spellcheck is no longer an extension.])
-    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|spellcheck||g'`
-fi
-
-if test -n "$MOZ_NO_XPCOM_OBSOLETE" && test `echo "$MOZ_EXTENSIONS" | grep -c sroaming` -ne 0; then
-    AC_MSG_WARN([Cannot currently build sroaming without xpcom obsolete -- bug 249343. Removing sroaming from MOZ_EXTENSIONS.])
-    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|sroaming||'`
-fi
-
-dnl Remove dupes
-MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
-
-dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
-dnl when trying to build a non-existent extension.
-for extension in $MOZ_EXTENSIONS; do
-    if test ! -d "${srcdir}/extensions/${extension}"; then
-        AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
-    fi
-done
-
-
-dnl ========================================================
-dnl Image decoders
-dnl ========================================================
-case "$MOZ_WIDGET_TOOLKIT" in
-beos|windows|os2|mac|cocoa)
-    ;;
-*)
-    if test -z "$MOZ_ENABLE_GTK2" && test -z "$MOZ_ENABLE_QT"; then
-       MOZ_IMG_DECODERS_DEFAULT=`echo $MOZ_IMG_DECODERS_DEFAULT | sed -e 's|icon||'`
-    fi
-    ;;
-esac
-
-MOZ_ARG_ENABLE_STRING(image-decoders,
-[  --enable-image-decoders[={mod1,mod2,default,all,none}]
-                          Enable specific image decoders],
-[ for option in `echo $enableval | sed 's/,/ /g'`; do
-    if test "$option" = "yes" || test "$option" = "all"; then
-        MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
-    elif test "$option" = "no" || test "$option" = "none"; then
-        MOZ_IMG_DECODERS=""
-    elif test "$option" = "default"; then
-        MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
-    elif test `echo "$option" | grep -c \^-` != 0; then
-        option=`echo $option | sed 's/^-//'`
-        MOZ_IMG_DECODERS=`echo "$MOZ_IMG_DECODERS" | sed "s/ ${option}//"`
-    else
-        MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $option"
-    fi
-done],
-    MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS_DEFAULT")
-
-dnl Dupes are removed in the encoder section because it will also add decoders
-
-dnl ========================================================
-dnl Image encoders
-dnl ========================================================
-MOZ_ARG_ENABLE_STRING(image-encoders,
-[  --enable-image-encoders[={mod1,mod2,default,all,none}]
-                          Enable specific image encoders],
-[ for option in `echo $enableval | sed 's/,/ /g'`; do
-    if test "$option" = "yes" || test "$option" = "all"; then
-        addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
-    elif test "$option" = "no" || test "$option" = "none"; then
-        MOZ_IMG_ENCODERS=""
-        addencoder=""
-    elif test "$option" = "default"; then
-        addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
-    elif test `echo "$option" | grep -c \^-` != 0; then
-        option=`echo $option | sed 's/^-//'`
-        addencoder=`echo "$MOZ_IMG_ENCODERS" | sed "s/ ${option}//"`
-    else
-        addencoder="$option"
-    fi
-    MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS $addencoder"
-done],
-    MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS_DEFAULT")
-
-dnl Remove dupes
-MOZ_IMG_DECODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_DECODERS}`
-MOZ_IMG_ENCODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_ENCODERS}`
-
-dnl ========================================================
-dnl MathML on by default
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(mathml,
-[  --disable-mathml        Disable MathML support],
-    MOZ_MATHML=,
-    MOZ_MATHML=1 )
-if test "$MOZ_MATHML"; then
-  AC_DEFINE(MOZ_MATHML)
-fi
-
-dnl ========================================================
-dnl Canvas
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(canvas,
-[  --disable-canvas          Disable html:canvas feature],
-    MOZ_ENABLE_CANVAS=,
-    MOZ_ENABLE_CANVAS=1 )
-if test -n "$MOZ_ENABLE_CANVAS"; then
-    AC_DEFINE(MOZ_ENABLE_CANVAS)
-fi
-AC_SUBST(MOZ_ENABLE_CANVAS)
-
-dnl ========================================================
-dnl SVG
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(svg,
-[  --disable-svg            Disable SVG support],
-    MOZ_SVG=,
-    MOZ_SVG=1 )
-if test -n "$MOZ_SVG"; then
-  AC_DEFINE(MOZ_SVG)
-fi
-
-dnl ========================================================
-dnl Installer
-dnl ========================================================
-case "$target_os" in
-    aix*|solaris*|linux*|msvc*|mks*|cygwin*|mingw*|os2*|wince*)
-        MOZ_INSTALLER=1
-        ;;
-esac
-
-MOZ_ARG_DISABLE_BOOL(installer,
-[  --disable-installer     Disable building of installer],
-    MOZ_INSTALLER=,
-    MOZ_INSTALLER=1 )
-if test -n "$MOZ_INSTALLER" -a -n "$MOZ_XUL_APP" -a "$OS_ARCH" = "WINNT"; then
-    # Disable installer for Windows builds that use the new toolkit if NSIS
-    # isn't in the path.
-    AC_PATH_PROGS(MAKENSIS, makensis)
-    if test -z "$MAKENSIS" || test "$MAKENSIS" = ":"; then
-        AC_MSG_ERROR([To build the installer makensis is required in your path. To build without the installer reconfigure using --disable-installer.])
-    fi
-    # The Windows build for NSIS requires the iconv command line utility to
-    # convert the charset of the locale files.
-    AC_PATH_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
-    if test -z "$HOST_ICONV"; then
-        AC_MSG_ERROR([To build the installer iconv is required in your path. To build without the installer reconfigure using --disable-installer.])
-    fi
-fi
-
-# Automatically disable installer if xpinstall isn't built
-if test -z "$MOZ_XPINSTALL"; then
-    MOZ_INSTALLER=
-fi
-AC_SUBST(MOZ_INSTALLER)
-
-AC_MSG_CHECKING([for tar archiver])
-AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
-if test -z "$TAR"; then
-    AC_MSG_ERROR([no tar archiver found in \$PATH])
-fi
-AC_MSG_RESULT([$TAR])
-AC_SUBST(TAR)
-
-AC_MSG_CHECKING([for wget])
-AC_CHECK_PROGS(WGET, wget, "")
-AC_MSG_RESULT([$WGET])
-AC_SUBST(WGET)
-
-dnl ========================================================
-dnl Updater
-dnl ========================================================
-
-MOZ_ARG_DISABLE_BOOL(updater,
-[  --disable-updater       Disable building of updater],
-    MOZ_UPDATER=,
-    MOZ_UPDATER=1 )
-# The Windows build requires the iconv command line utility
-# in order to build the updater.
-case "$target_os" in
-    msvc*|mks*|cygwin*|mingw*|wince*)
-        if test -n "$MOZ_UPDATER"; then
-            AC_MSG_CHECKING([for iconv])
-            AC_CHECK_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
-            if test -z "$HOST_ICONV"; then
-                AC_MSG_ERROR([iconv not found in \$PATH])
-            fi
-        fi
-        ;;
-esac
-AC_SUBST(MOZ_UPDATER)
-
-# app update channel is 'default' when not supplied.
-MOZ_ARG_ENABLE_STRING([update-channel],
-[  --enable-update-channel=CHANNEL
-                           Select application update channel (default=default)],
-    MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
-
-if test -z "$MOZ_UPDATE_CHANNEL"; then
-    MOZ_UPDATE_CHANNEL=default
-fi
-AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
-
-# tools/update-packaging is not checked out by default.
-MOZ_ARG_ENABLE_BOOL(update-packaging,
-[  --enable-update-packaging
-                           Enable tools/update-packaging],
-    MOZ_UPDATE_PACKAGING=1,
-    MOZ_UPDATE_PACKAGING= )
-AC_SUBST(MOZ_UPDATE_PACKAGING)
-
-dnl ========================================================
-dnl ActiveX
-dnl ========================================================
-
-MOZ_ARG_DISABLE_BOOL(xpconnect-idispatch,
-[  --disable-xpconnect-idispatch
-                          Disable building of xpconnect support for IDispatch
-                          (win32 only)],
-    XPC_IDISPATCH_SUPPORT=,
-    XPC_IDISPATCH_SUPPORT=1)
-AC_SUBST(XPC_IDISPATCH_SUPPORT)
-
-MOZ_ARG_DISABLE_BOOL(activex,
-[  --disable-activex       Disable building of ActiveX control (win32 only)],
-    MOZ_NO_ACTIVEX_SUPPORT=1,
-    MOZ_NO_ACTIVEX_SUPPORT= )
-AC_SUBST(MOZ_NO_ACTIVEX_SUPPORT)
-
-MOZ_ARG_DISABLE_BOOL(activex-scripting,
-[  --disable-activex-scripting
-                          Disable building of ActiveX scripting support (win32)],
-    MOZ_ACTIVEX_SCRIPTING_SUPPORT=,
-    MOZ_ACTIVEX_SCRIPTING_SUPPORT=1)
-AC_SUBST(MOZ_ACTIVEX_SCRIPTING_SUPPORT)
-
-if test -n "$MOZ_NO_ACTIVEX_SUPPORT" -a -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT";
-then
-    AC_MSG_ERROR([Cannot enable ActiveX scripting support when ActiveX support is disabled.])
-fi
-
-if test "$COMPILE_ENVIRONMENT" = "1"; then
-if test -n "$XPC_IDISPATCH_SUPPORT" -o -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT" -o -z "$MOZ_NO_ACTIVEX_SUPPORT"; then
-case "$target" in
-*-mingw*|*-cygwin*|*-msvc*|*-mks*)
-    if test "$ac_cv_header_atlbase_h" = "no"; then
-        AC_MSG_ERROR([System header atlbase.h is not available. See http://developer.mozilla.org/en/docs/atlbase.h for details on fixing this problem.])
-    fi
-    ;;
-esac
-fi
-fi
-
-dnl ========================================================
-dnl leaky
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(leaky,
-[  --enable-leaky          Build leaky memory tool],
-    MOZ_LEAKY=1,
-    MOZ_LEAKY=)
-
-
-dnl ========================================================
-dnl xpctools
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(xpctools,
-[  --enable-xpctools       Build JS profiling tool],
-    MOZ_XPCTOOLS=1,
-    MOZ_XPCTOOLS= )
-
-
-dnl ========================================================
 dnl build the tests by default
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(tests,
 [  --disable-tests         Do not build test libraries & programs],
     ENABLE_TESTS=,
     ENABLE_TESTS=1 )
 
 dnl ========================================================
-dnl parental controls (for Windows Vista)
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(parental-controls,
-[  --disable-parental-controls
-                           Do not build parental controls],
-   MOZ_DISABLE_PARENTAL_CONTROLS=1,
-   MOZ_DISABLE_PARENTAL_CONTROLS=)
-if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
-    AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
-fi
-
-dnl ========================================================
-dnl Vista SDK specific api
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(vista-sdk-requirements,
-[  --disable-vista-sdk-requirements
-                           Do not build Vista SDK specific code],
-   MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=1,
-   MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=)
-if test -n "$COMPILE_ENVIRONMENT"; then
-if test -n "$MOZ_DISABLE_VISTA_SDK_REQUIREMENTS"; then
-    AC_MSG_WARN([Resulting builds will not be compatible with Windows Vista. (bug 428970)])
-    AC_DEFINE(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
-    if test -z "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
-        AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
-    fi
-    MOZ_DISABLE_PARENTAL_CONTROLS=1
-else
-case "$target" in
-*-mingw*|*-cygwin*|*-msvc*|*-mks*)
-    if test "$ac_cv_header_wpcapi_h" = "no"; then
-        AC_MSG_ERROR([System header wpcapi.h is not available. See updated http://developer.mozilla.org/en/docs/wpcapi.h for details on fixing this problem.])
-    fi
-    ;;
-esac
-fi
-fi
-AC_SUBST(MOZ_DISABLE_PARENTAL_CONTROLS)
-AC_SUBST(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
-
-dnl ========================================================
 dnl =
 dnl = Module specific options
 dnl =
 dnl ========================================================
 MOZ_ARG_HEADER(Individual module options)
 
 dnl ========================================================
-dnl = Enable Lea malloc in xpcom. OFF by default.
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(xpcom-lea,
-[  --enable-xpcom-lea      Use Lea malloc in xpcom ],
-    XPCOM_USE_LEA=1,
-    XPCOM_USE_LEA= )
-if test -n "$XPCOM_USE_LEA"; then
-    AC_DEFINE(XPCOM_USE_LEA)
-fi
-
-dnl ========================================================
-dnl = Enable places (new history/bookmarks)
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(places,
-[  --enable-places        Enable 'places' bookmark/history implementation],
-    MOZ_PLACES=1,
-    MOZ_PLACES= )
-if test -n "$MOZ_PLACES"; then
-    AC_DEFINE(MOZ_PLACES)
-    if test -z "$MOZ_MAIL_NEWS"; then
-      MOZ_MORK=
-    fi
-    MOZ_MORKREADER=1
-else
-  if test "$MOZ_BUILD_APP" = "browser"; then
-    AC_MSG_ERROR([Cannot build Firefox with --disable-places.])
-  fi
-fi
-
-dnl ========================================================
-dnl = Disable feed handling components
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(feeds,
-[  --disable-feeds        Disable feed handling and processing components],
-    MOZ_FEEDS=,
-    MOZ_FEEDS=1 )
-if test -n "$MOZ_FEEDS"; then
-    AC_DEFINE(MOZ_FEEDS)
-else
-    if test "$MOZ_BUILD_APP" = "browser"; then
-        AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
-    fi
-fi
-
-dnl ========================================================
-dnl = Enable mozStorage
-dnl ========================================================
-dnl Implicitly enabled by default if building calendar or places
-MOZ_ARG_ENABLE_BOOL(storage,
-[  --enable-storage        Enable mozStorage module and related components],
-    MOZ_STORAGE=1,
-    MOZ_STORAGE= )
-if test -n "$MOZ_STORAGE"; then
-    AC_DEFINE(MOZ_STORAGE)
-fi
-
-dnl ========================================================
-dnl Check for sqlite
-dnl ========================================================
-
-MOZ_NATIVE_SQLITE=
-MOZ_ARG_ENABLE_BOOL(system-sqlite,
-[  --enable-system-sqlite  Use system sqlite (located with pkgconfig)],
-MOZ_NATIVE_SQLITE=1,
-MOZ_NATIVE_SQLITE= )
-
-if test -z "$MOZ_NATIVE_SQLITE"
-then
-    SQLITE_CFLAGS=
-    SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,sqlite3,$(DIST)/lib)'
-else
-    PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
-fi
-
-AC_SUBST(MOZ_NATIVE_SQLITE)
-
-dnl ========================================================
-dnl = Enable help viewer (off by default)
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(help-viewer,
-[  --enable-help-viewer        Enable help viewer],
-    MOZ_HELP_VIEWER=1,
-    MOZ_HELP_VIEWER= )
-if test -n "$MOZ_HELP_VIEWER"; then
-     AC_DEFINE(MOZ_HELP_VIEWER)
-fi
-AC_SUBST(MOZ_HELP_VIEWER)
-if test "$MOZ_BUILD_APP" = "browser" -a -n "$MOZ_HELP_VIEWER"; then
-    AC_MSG_ERROR([Cannot build Firefox with --enable-help-viewer.])
-fi
-
-dnl ========================================================
-dnl = Enable safe browsing (anti-phishing)
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(safe-browsing,
-[  --enable-safe-browsing        Enable safe browsing (anti-phishing) implementation],
-    MOZ_SAFE_BROWSING=1,
-    MOZ_SAFE_BROWSING= )
-if test -n "$MOZ_SAFE_BROWSING"; then
-    AC_DEFINE(MOZ_SAFE_BROWSING)
-fi
-AC_SUBST(MOZ_SAFE_BROWSING)
-
-dnl ========================================================
-dnl = Enable url-classifier
-dnl ========================================================
-dnl Implicitly enabled by default if building with safe-browsing
-if test -n "$MOZ_SAFE_BROWSING"; then
-    MOZ_URL_CLASSIFIER=1
-fi
-MOZ_ARG_ENABLE_BOOL(url-classifier,
-[  --enable-url-classifier        Enable url classifier module],
-    MOZ_URL_CLASSIFIER=1,
-    MOZ_URL_CLASSIFIER= )
-if test -n "$MOZ_URL_CLASSIFIER"; then
-    AC_DEFINE(MOZ_URL_CLASSIFIER)
-fi
-AC_SUBST(MOZ_URL_CLASSIFIER)
-
-dnl ========================================================
-dnl = Disable zipwriter
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(zipwriter,
-[  --disable-zipwriter             Disable zipwriter component],
-    MOZ_ZIPWRITER=,
-    MOZ_ZIPWRITER=1 )
-AC_SUBST(MOZ_ZIPWRITER)
-
-dnl ========================================================
 dnl = Enable Ultrasparc specific optimizations for JS
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(js-ultrasparc,
 [  --enable-js-ultrasparc  Use UltraSPARC optimizations in JS],
     JS_ULTRASPARC_OPTS=1,
     JS_ULTRASPARC_OPTS= )
 
 dnl only enable option for ultrasparcs
 if test `echo "$target_os" | grep -c \^solaris 2>/dev/null` = 0 -o \
     "$OS_TEST" != "sun4u"; then
     JS_ULTRASPARC_OPTS=
 fi
 AC_SUBST(JS_ULTRASPARC_OPTS)
 
 dnl ========================================================
-dnl = Hildon and OSSO checks
-dnl ========================================================
-PKG_CHECK_MODULES(LIBHILDONMIME,libhildonmime,
-                  MOZ_PLATFORM_HILDON=1,
-                  MOZ_PLATFORM_HILDON=)
-if test $MOZ_PLATFORM_HILDON; then
-   AC_DEFINE(MOZ_PLATFORM_HILDON)
-fi
-AC_SUBST(LIBHILDONMIME_CFLAGS)
-AC_SUBST(LIBHILDONMIME_LIBS)
-
-PKG_CHECK_MODULES(LIBOSSO,libosso,
-                  NS_OSSO=1,
-                  NS_OSSO=)
-
-if test $NS_OSSO; then
-    if test -z "$MOZ_ENABLE_DBUS"; then
-        AC_MSG_ERROR([DBus is required when building for OSSO])
-    fi
-    AC_DEFINE(NS_OSSO)
-    dnl XXX this should go somewhere else; it's not just for OSSO
-    AC_DEFINE(MOZ_GFX_OPTIMIZE_MOBILE)
-fi
-AC_SUBST(LIBOSSO_CFLAGS)
-AC_SUBST(LIBOSSO_LIBS)
-
-PKG_CHECK_MODULES(MOZ_LOCATION, [liblocation gpsbt],
-                  NS_MAEMO_LOCATION=1,
-                  NS_MAEMO_LOCATION=)
-
-if test $NS_MAEMO_LOCATION; then
-  AC_DEFINE(NS_MAEMO_LOCATION)
-fi
-
-AC_SUBST(MOZ_LOCATION_CFLAGS)
-AC_SUBST(MOZ_LOCATION_LIBS)
-
-dnl ========================================================
-dnl =
-dnl = Feature options that require extra sources to be pulled
-dnl =
-dnl ========================================================
-dnl MOZ_ARG_HEADER(Features that require extra sources)
-
-dnl ========================================================
 dnl =
 dnl = Debugging Options
 dnl = 
 dnl ========================================================
 MOZ_ARG_HEADER(Debugging and Optimizations)
 
 dnl ========================================================
 dnl = Disable building with debug info.
@@ -6215,43 +4043,16 @@ MOZ_ARG_ENABLE_BOOL(boehm,
 [  --enable-boehm          Enable the Boehm Garbage Collector],
     GC_LEAK_DETECTOR=1,
     GC_LEAK_DETECTOR= )
 if test -n "$GC_LEAK_DETECTOR"; then
     AC_DEFINE(GC_LEAK_DETECTOR)
 fi
 
 dnl ========================================================
-dnl Disable runtime logging checks
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(logging,
-[  --disable-logging       Disable logging facilities],
-    NS_DISABLE_LOGGING=1,
-    NS_DISABLE_LOGGING= )
-if test "$NS_DISABLE_LOGGING"; then
-    AC_DEFINE(NS_DISABLE_LOGGING)
-else
-    AC_DEFINE(MOZ_LOGGING)
-fi
-
-dnl ========================================================
-dnl = dnl This will enable logging of addref, release, ctor, dtor.
-dnl ========================================================
-_ENABLE_LOGREFCNT=42
-MOZ_ARG_ENABLE_BOOL(logrefcnt,
-[  --enable-logrefcnt      Enable logging of refcounts (default=debug) ],
-    _ENABLE_LOGREFCNT=1,
-    _ENABLE_LOGREFCNT= )
-if test "$_ENABLE_LOGREFCNT" = "1"; then
-    AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
-elif test -z "$_ENABLE_LOGREFCNT"; then
-    AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
-fi
-
-dnl ========================================================
 dnl = Enable trace malloc
 dnl ========================================================
 NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
 MOZ_ARG_ENABLE_BOOL(trace-malloc,
 [  --enable-trace-malloc   Enable malloc tracing],
     NS_TRACE_MALLOC=1,
     NS_TRACE_MALLOC= )
 if test "$NS_TRACE_MALLOC"; then
@@ -6544,54 +4345,16 @@ MOZ_ARG_ENABLE_BOOL(timeline,
 [  --enable-timeline       Enable timeline services ],
     MOZ_TIMELINE=1,
     MOZ_TIMELINE= )
 if test -n "$MOZ_TIMELINE"; then
     AC_DEFINE(MOZ_TIMELINE)
 fi
 
 dnl ========================================================
-dnl Turn on reflow counting
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(reflow-perf,
-[  --enable-reflow-perf    Enable reflow performance tracing],
-    MOZ_REFLOW_PERF=1,
-    MOZ_REFLOW_PERF= )
-if test -n "$MOZ_REFLOW_PREF"; then
-    AC_DEFINE(MOZ_REFLOW_PREF)
-fi
-AC_SUBST(MOZ_REFLOW_PERF)
-
-dnl ========================================================
-dnl Enable performance metrics.
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(perf-metrics,
-[  --enable-perf-metrics   Enable performance metrics],
-    MOZ_PERF_METRICS=1,
-    MOZ_PERF_METRICS= )
-if test -n "$MOZ_PERF_METRICS"; then
-    AC_DEFINE(MOZ_PERF_METRICS)
-fi
-
-dnl ========================================================
-dnl Enable code size metrics.
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(codesighs,
-[  --enable-codesighs      Enable code size analysis tools],
-    _ENABLE_CODESIGHS=1,
-    _ENABLE_CODESIGHS= )
-if test -n "$_ENABLE_CODESIGHS"; then
-    if test -d $srcdir/tools/codesighs; then 
-        MOZ_MAPINFO=1
-    else
-        AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
-    fi
-fi
-
-dnl ========================================================
 dnl = Add support for Eazel profiler
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(eazel-profiler-support,
 [  --enable-eazel-profiler-support
                           Enable Corel/Eazel profiler support],
     ENABLE_EAZEL_PROFILER=1,
     ENABLE_EAZEL_PROFILER= )
 if test -n "$ENABLE_EAZEL_PROFILER"; then
@@ -6671,84 +4434,16 @@ MOZ_ARG_HEADER(Misc. Options)
 dnl ========================================================
 dnl update xterm title
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(xterm-updates,
 [  --enable-xterm-updates  Update XTERM titles with current command.],
     MOZ_UPDATE_XTERM=1,
     MOZ_UPDATE_XTERM= )
 
-dnl =========================================================
-dnl = Chrome format
-dnl =========================================================
-MOZ_ARG_ENABLE_STRING([chrome-format],
-[  --enable-chrome-format=jar|flat|both|symlink
-                          Select FORMAT of chrome files (default=jar)],
-    MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
-
-if test -z "$MOZ_CHROME_FILE_FORMAT"; then
-    MOZ_CHROME_FILE_FORMAT=jar
-fi
-
-if test "$MOZ_CHROME_FILE_FORMAT" != "jar" && 
-    test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
-    test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
-    test "$MOZ_CHROME_FILE_FORMAT" != "both"; then
-    AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, or symlink])
-fi
-
-dnl ========================================================
-dnl = Define default location for MOZILLA_FIVE_HOME
-dnl ========================================================
-MOZ_ARG_WITH_STRING(default-mozilla-five-home,
-[  --with-default-mozilla-five-home
-                          Set the default value for MOZILLA_FIVE_HOME],
-[ val=`echo $withval`
-  AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
-
-dnl ========================================================
-dnl = Location of the mozilla user directory (default is ~/.mozilla).],
-dnl ========================================================
-MOZ_ARG_WITH_STRING(user-appdir,
-[  --with-user-appdir=DIR  Set user-specific appdir (default=.mozilla)],
-[ val=`echo $withval`
-if echo "$val" | grep "\/" >/dev/null; then
-    AC_MSG_ERROR("Homedir must be single relative path.")
-else 
-    MOZ_USER_DIR="$val"
-fi])
-
-AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
-
-dnl ========================================================
-dnl = Doxygen configuration
-dnl ========================================================
-dnl Use commas to specify multiple dirs to this arg
-MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
-MOZ_ARG_WITH_STRING(doc-input-dirs,
-[  --with-doc-input-dirs=DIRS
-                          Header/idl dirs to create docs from],
-[ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
-AC_SUBST(MOZ_DOC_INPUT_DIRS)
-
-dnl Use commas to specify multiple dirs to this arg
-MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
-MOZ_ARG_WITH_STRING(doc-include-dirs,
-[  --with-doc-include-dirs=DIRS  
-                          Include dirs to preprocess doc headers],
-[ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
-AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
-
-MOZ_DOC_OUTPUT_DIR='./dist/docs'
-MOZ_ARG_WITH_STRING(doc-output-dir,
-[  --with-doc-output-dir=DIR
-                          Dir to generate docs into],
-[ MOZ_DOC_OUTPUT_DIR=$withval ] )
-AC_SUBST(MOZ_DOC_OUTPUT_DIR)
-
 if test -z "$SKIP_COMPILER_CHECKS"; then
 dnl ========================================================
 dnl =
 dnl = Compiler Options
 dnl = 
 dnl ========================================================
 MOZ_ARG_HEADER(Compiler Options)
 
@@ -7085,48 +4780,16 @@ dnl =
 dnl ========================================================
 MOZ_ARG_HEADER(Static build options)
 
 MOZ_ARG_ENABLE_BOOL(static,
 [  --enable-static         Enable building of internal static libs],
     BUILD_STATIC_LIBS=1,
     BUILD_STATIC_LIBS=)
 
-dnl Disable libxul in debug builds, but not for xulrunner.
-if test -n "$MOZ_DEBUG" -a "$MOZ_BUILD_APP" != "xulrunner"; then
-   MOZ_ENABLE_LIBXUL=
-fi
-
-MOZ_ARG_ENABLE_BOOL(libxul,
-[  --enable-libxul         Enable building of libxul],
-    MOZ_ENABLE_LIBXUL=1,
-    MOZ_ENABLE_LIBXUL=)
-
-if test -n "$MOZ_STATIC_BUILD_UNSUPPORTED" -a -n "$BUILD_STATIC_LIBS"; then
-	AC_MSG_ERROR([--enable-static is not supported for building $MOZ_APP_NAME. You probably want --enable-libxul.])
-fi
-
-if test -n "$MOZ_ENABLE_LIBXUL" -a -n "$BUILD_STATIC_LIBS"; then
-	AC_MSG_ERROR([--enable-libxul is not compatible with --enable-static])
-fi
-
-if test -n "$MOZ_ENABLE_LIBXUL" -a -z "$MOZ_XUL_APP"; then
-	AC_MSG_ERROR([--enable-libxul is only compatible with toolkit XUL applications.])
-fi
-
-if test -n "$MOZ_ENABLE_LIBXUL"; then
-    XPCOM_LIBS="$LIBXUL_LIBS"
-    AC_DEFINE(MOZ_ENABLE_LIBXUL)
-else
-    if test -n "$BUILD_STATIC_LIBS"; then
-        AC_DEFINE(MOZ_STATIC_BUILD)
-    fi
-    XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS"
-fi
-
 dnl ========================================================
 dnl = Force JS to be a static lib
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(js-static-build,
 [  --enable-js-static-build  Force js to be a static lib],
     JS_STATIC_BUILD=1,
     JS_STATIC_BUILD= )
 
@@ -7143,578 +4806,29 @@ fi
 
 dnl ========================================================
 dnl =
 dnl = Standalone module options
 dnl = 
 dnl ========================================================
 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
 
-dnl Check for GLib and libIDL.
-dnl ========================================================
-case "$target_os" in
-msvc*|mks*|cygwin*|mingw*|wince*)
-    SKIP_IDL_CHECK="yes"
-    ;;
-*)
-    SKIP_IDL_CHECK="no"
-    ;;
-esac
-
-if test -z "$COMPILE_ENVIRONMENT"; then
-    SKIP_IDL_CHECK="yes"
-fi
-
-dnl = Allow users to disable libIDL checking for standalone modules
-MOZ_ARG_WITHOUT_BOOL(libIDL,
-[  --without-libIDL        Skip check for libIDL (standalone modules only)],
-	SKIP_IDL_CHECK="yes")
-
-if test "$SKIP_IDL_CHECK" = "no"
-then
-    _LIBIDL_FOUND=
-    if test "$MACOS_SDK_DIR"; then 
-      dnl xpidl, and therefore libIDL, is only needed on the build host.
-      dnl Don't build it against the SDK, as that causes problems.
-      _MACSAVE_CFLAGS="$CFLAGS"
-      _MACSAVE_LIBS="$LIBS"
-      _MACSAVE_LDFLAGS="$LDFLAGS"
-      _MACSAVE_NEXT_ROOT="$NEXT_ROOT"
-      changequote(,)
-      CFLAGS=`echo $CFLAGS|sed -E -e "s%((-I|-isystem )${MACOS_SDK_DIR}/usr/(include|lib/gcc)[^ ]*)|-F${MACOS_SDK_DIR}(/System)?/Library/Frameworks[^ ]*|-nostdinc[^ ]*|-isysroot ${MACOS_SDK_DIR}%%g"`
-      LIBS=`echo $LIBS|sed -e "s?-L${MACOS_SDK_DIR}/usr/lib[^ ]*??g"`
-      LDFLAGS=`echo $LDFLAGS|sed -e "s?-Wl,-syslibroot,${MACOS_SDK_DIR}??g"`
-      changequote([,])
-      unset NEXT_ROOT
-    fi
-
-    if test "$MOZ_ENABLE_GTK2"; then
-        PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0 glib-2.0 gobject-2.0, _LIBIDL_FOUND=1,_LIBIDL_FOUND=)
-    fi
-    dnl if no gtk/libIDL1 or gtk2/libIDL2 combination was found, fall back
-    dnl to either libIDL1 or libIDL2.
-    if test -z "$_LIBIDL_FOUND"; then
-        AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
-        if test -z "$_LIBIDL_FOUND"; then
-            PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0,_LIBIDL_FOUND=1)
-        fi
-    fi
-    dnl
-    dnl If we don't have a libIDL config program & not cross-compiling, 
-    dnl     look for orbit-config instead.
-    dnl
-    if test -z "$_LIBIDL_FOUND" && test -z "$CROSS_COMPILE"; then
-        AC_PATH_PROGS(ORBIT_CONFIG, $ORBIT_CONFIG orbit-config)
-        if test -n "$ORBIT_CONFIG"; then
-            AC_MSG_CHECKING([for ORBit libIDL usability])
-        	_ORBIT_CFLAGS=`${ORBIT_CONFIG} client --cflags`
-    	    _ORBIT_LIBS=`${ORBIT_CONFIG} client --libs`
-            _ORBIT_INC_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-I/); } }' -- ${_ORBIT_CFLAGS}`
-            _ORBIT_LIB_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-L/); } }' -- ${_ORBIT_LIBS}`
-            LIBIDL_CFLAGS="$_ORBIT_INC_PATH"
-            LIBIDL_LIBS="$_ORBIT_LIB_PATH -lIDL -lglib"
-            LIBIDL_CONFIG=
-            _SAVE_CFLAGS="$CFLAGS"
-            _SAVE_LIBS="$LIBS"
-            CFLAGS="$LIBIDL_CFLAGS $CFLAGS"
-            LIBS="$LIBIDL_LIBS $LIBS"
-            AC_TRY_RUN([
-#include <stdlib.h>
-#include <libIDL/IDL.h>
-int main() {
-  char *s;
-  s=strdup(IDL_get_libver_string());
-  if(s==NULL) {
-    exit(1);
-  }
-  exit(0);
-}
-            ], [_LIBIDL_FOUND=1
-                result="yes"],
-               [LIBIDL_CFLAGS=
-                LIBIDL_LIBS=
-                result="no"],
-               [_LIBIDL_FOUND=1
-                result="maybe"] )
-            AC_MSG_RESULT($result)
-            CFLAGS="$_SAVE_CFLAGS"
-            LIBS="$_SAVE_LIBS"
-        fi
-    fi
-    if test -z "$_LIBIDL_FOUND"; then
-        AC_MSG_ERROR([libIDL not found.
-        libIDL $LIBIDL_VERSION or higher is required.])
-    fi
-    if test "$MACOS_SDK_DIR"; then
-      CFLAGS="$_MACSAVE_CFLAGS"
-      LIBS="$_MACSAVE_LIBS"
-      LDFLAGS="$_MACSAVE_LDFLAGS"
-      if test -n "$_MACSAVE_NEXT_ROOT" ; then
-        export NEXT_ROOT="$_MACSAVE_NEXT_ROOT"
-      fi
-    fi
-fi
-
-if test -n "$CROSS_COMPILE"; then
-     if test -z "$HOST_LIBIDL_CONFIG"; then
-        HOST_LIBIDL_CONFIG="$LIBIDL_CONFIG"
-    fi
-    if test -n "$HOST_LIBIDL_CONFIG" && test "$HOST_LIBIDL_CONFIG" != "no"; then
-        HOST_LIBIDL_CFLAGS=`${HOST_LIBIDL_CONFIG} --cflags`
-        HOST_LIBIDL_LIBS=`${HOST_LIBIDL_CONFIG} --libs`
-    else
-        HOST_LIBIDL_CFLAGS="$LIBIDL_CFLAGS"
-        HOST_LIBIDL_LIBS="$LIBIDL_LIBS"
-    fi
-fi
-
 if test -z "$SKIP_PATH_CHECKS"; then
 if test -z "${GLIB_CFLAGS}" || test -z "${GLIB_LIBS}" ; then
-    if test "$MOZ_ENABLE_GTK2" || test "$USE_ELF_DYNSTR_GC" ; then
-        PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
-    else
-        AM_PATH_GLIB(${GLIB_VERSION})
-    fi
+    PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
 fi
 fi
 
 if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
     GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
 fi
 
-AC_SUBST(LIBIDL_CFLAGS)
-AC_SUBST(LIBIDL_LIBS)
-AC_SUBST(STATIC_LIBIDL)
 AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
 AC_SUBST(GLIB_GMODULE_LIBS)
-AC_SUBST(HOST_LIBIDL_CONFIG)
-AC_SUBST(HOST_LIBIDL_CFLAGS)
-AC_SUBST(HOST_LIBIDL_LIBS)
-
-dnl ========================================================
-dnl Check for libart
-dnl ========================================================
-if test "$MOZ_SVG_RENDERER_LIBART"; then
-  if test ! -f $topsrcdir/other-licenses/libart_lgpl/Makefile.in; then
-    AC_MSG_ERROR([You must check out the mozilla version of libart. Use
-mk_add_options MOZ_CO_MODULE=mozilla/other-licenses/libart_lgpl])
-  fi
-
-  dnl libart's configure hasn't been run yet, but we know what the
-  dnl answer should be anyway
-  MOZ_LIBART_CFLAGS='-I${DIST}/include/libart_lgpl'
-  case "$target_os" in
-  msvc*|mks*|cygwin*|mingw*|wince*)
-      MOZ_LIBART_LIBS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)moz_art_lgpl.$(IMPORT_LIB_SUFFIX)' 
-      ;;
-  os2*)
-      MOZ_LIBART_LIBS='-lmoz_art -lm'
-      ;;
-  beos*)
-      MOZ_LIBART_LIBS='-lmoz_art_lgpl -lroot -lbe'
-      ;;
-  *)
-      MOZ_LIBART_LIBS='-lmoz_art_lgpl -lm'
-      ;;
-  esac
-  AC_FUNC_ALLOCA
-fi
-
-AC_SUBST(MOZ_LIBART_CFLAGS)
-AC_SUBST(MOZ_LIBART_LIBS)
-
-dnl ========================================================
-dnl Check for cairo
-dnl ========================================================
-MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
-
-MOZ_TREE_CAIRO=1
-MOZ_ARG_ENABLE_BOOL(system-cairo,
-[ --enable-system-cairo Use system cairo (located with pkgconfig)],
-MOZ_TREE_CAIRO=,
-MOZ_TREE_CAIRO=1 )
-
-# Check for headers defining standard int types.
-AC_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
-
-if test "$MOZ_TREE_CAIRO"; then
-    AC_DEFINE(MOZ_TREE_CAIRO)
-
-    # For now we assume that we will have a uint64_t available through
-    # one of the above headers or mozstdint.h.
-    AC_DEFINE(HAVE_UINT64_T)
-
-    # Define macros for cairo-features.h
-    if test "$MOZ_X11"; then
-        XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
-        XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
-        PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
-        PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
-        FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
-        MOZ_ENABLE_CAIRO_FT=1
-        CAIRO_FT_CFLAGS="$FT2_CFLAGS"
-    fi
-    if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
-        QPAINTER_SURFACE_FEATURE="#define CAIRO_HAS_QPAINTER_SURFACE 1"
-    fi
-    if test "$MOZ_WIDGET_TOOLKIT" = "mac" -o "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
-        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"
-    fi
-    if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
-        WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
-        WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
-        PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
-    fi
-    if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
-        OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
-        FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
-        PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
-        MOZ_ENABLE_CAIRO_FT=1
-        CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
-        CAIRO_FT_LIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
-    fi
-    if test "$MOZ_WIDGET_TOOLKIT" = "beos"; then
-        PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2)
-        BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1"
-        FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
-        MOZ_ENABLE_CAIRO_FT=1
-    fi
-    AC_SUBST(MOZ_ENABLE_CAIRO_FT)
-    AC_SUBST(CAIRO_FT_CFLAGS)
-
-    if test "$MOZ_DEBUG"; then
-      SANITY_CHECKING_FEATURE="#define CAIRO_DO_SANITY_CHECKING 1"
-    else
-      SANITY_CHECKING_FEATURE="#undef CAIRO_DO_SANITY_CHECKING"
-    fi
-
-    PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
-
-    AC_SUBST(PS_SURFACE_FEATURE)
-    AC_SUBST(PDF_SURFACE_FEATURE)
-    AC_SUBST(SVG_SURFACE_FEATURE)
-    AC_SUBST(XLIB_SURFACE_FEATURE)
-    AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
-    AC_SUBST(QUARTZ_SURFACE_FEATURE)
-    AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE)
-    AC_SUBST(XCB_SURFACE_FEATURE)
-    AC_SUBST(WIN32_SURFACE_FEATURE)
-    AC_SUBST(OS2_SURFACE_FEATURE)
-    AC_SUBST(BEOS_SURFACE_FEATURE)
-    AC_SUBST(DIRECTFB_SURFACE_FEATURE)
-    AC_SUBST(FT_FONT_FEATURE)
-    AC_SUBST(WIN32_FONT_FEATURE)
-    AC_SUBST(QUARTZ_FONT_FEATURE)
-    AC_SUBST(PNG_FUNCTIONS_FEATURE)
-    AC_SUBST(QPAINTER_SURFACE_FEATURE)
-
-    if test "$_WIN32_MSVC"; then
-        MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/mozcairo.lib $(DEPTH)/gfx/cairo/libpixman/src/mozlibpixman.lib'
-    else
-        MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/$(LIB_PREFIX)mozcairo.$(LIB_SUFFIX) $(DEPTH)/gfx/cairo/libpixman/src/$(LIB_PREFIX)mozlibpixman.$(LIB_SUFFIX)'" $CAIRO_FT_LIBS"
-
-        if test "$MOZ_X11"; then
-            MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender -lfreetype -lfontconfig"
-        fi
-    fi
-
-    CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
-    mv -f $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig 2> /dev/null
-
-else
-   PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION freetype2 fontconfig)
-   MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
-   MOZ_CAIRO_LIBS=$CAIRO_LIBS
-   if test "$MOZ_X11"; then
-        PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION)
-        MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS"
-        MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS"
-   fi
-fi
-
-AC_SUBST(MOZ_TREE_CAIRO)
-AC_SUBST(MOZ_CAIRO_CFLAGS)
-AC_SUBST(MOZ_CAIRO_LIBS)
-
-dnl ========================================================
-dnl Check for lcms
-dnl ========================================================
-
-MOZ_NATIVE_LCMS=
-MOZ_ARG_ENABLE_BOOL(system-lcms,
-[ --enable-system-lcms Use system lcms (located with pkgconfig)],
-MOZ_NATIVE_LCMS=1,
-MOZ_NATIVE_LCMS= )
-
-if test -z "$MOZ_NATIVE_LCMS"
-then
-    LCMS_CFLAGS=
-    if test "$_WIN32_MSVC"; then
-        if test -z "$BUILD_STATIC_LIBS" -a -z "$MOZ_ENABLE_LIBXUL"; then
-            LCMS_CFLAGS=-DLCMS_DLL
-        fi
-        LCMS_LIBS='$(LIBXUL_DIST)/lib/mozlcms.lib'
-    else
-        LCMS_LIBS='-L$(LIBXUL_DIST)/bin -lmozlcms'
-    fi
-else
-    PKG_CHECK_MODULES(LCMS, lcms >= $LCMS_VERSION)
-fi
-
-AC_SUBST(MOZ_NATIVE_LCMS)
-AC_SUBST(LCMS_CFLAGS)
-AC_SUBST(LCMS_LIBS)
-
-dnl ========================================================
-dnl disable xul
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(xul,
-[  --disable-xul           Disable XUL],
-    MOZ_XUL= )
-if test "$MOZ_XUL"; then
-  AC_DEFINE(MOZ_XUL)
-else
-  dnl remove extensions that require XUL
-  MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
-fi
-
-AC_SUBST(MOZ_XUL)
-
-dnl ========================================================
-dnl Two ways to enable Python support:
-dnl   --enable-extensions=python # select all available.
-dnl    (MOZ_PYTHON_EXTENSIONS contains the list of extensions)
-dnl or:
-dnl   --enable-extensions=python/xpcom,... # select individual ones
-dnl
-dnl If either is used, we locate the Python to use.
-dnl ========================================================
-dnl
-dnl If 'python' appears anywhere in the extensions list, go lookin'...
-if test `echo "$MOZ_EXTENSIONS" | grep -c python` -ne 0; then
-    dnl Allow PYTHON to point to the Python interpreter to use
-    dnl (note that it must be the python executable - which we
-    dnl run to locate the relevant paths etc)
-    dnl If not set, we use whatever Python we can find.
-    MOZ_PYTHON=$PYTHON
-    dnl Ask Python what its version number is
-    changequote(,)
-    MOZ_PYTHON_VER=`$PYTHON -c "import sys;print '%d%d' % sys.version_info[0:2]"`
-    MOZ_PYTHON_VER_DOTTED=`$PYTHON -c "import sys;print '%d.%d' % sys.version_info[0:2]"`
-    changequote([,])
-    dnl Ask for the Python "prefix" (ie, home/source dir)
-    MOZ_PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
-    dnl Setup the include and library directories.
-    if test "$OS_ARCH" = "WINNT"; then
-        MOZ_PYTHON_PREFIX=`$CYGPATH_W $MOZ_PYTHON_PREFIX | $CYGPATH_S`
-        dnl Source trees have "include" and "PC" for .h, and "PCbuild" for .lib
-        dnl Binary trees have "include" for .h, and "libs" for .lib
-        dnl We add 'em both - along with quotes, to handle spaces.
-        MOZ_PYTHON_DLL_SUFFIX=.pyd
-        MOZ_PYTHON_INCLUDES="\"-I$MOZ_PYTHON_PREFIX/include\" \"-I$MOZ_PYTHON_PREFIX/PC\""
-        MOZ_PYTHON_LIBS="\"/libpath:$MOZ_PYTHON_PREFIX/PCBuild\" \"/libpath:$MOZ_PYTHON_PREFIX/libs\""
-    else
-        dnl Non-Windows include and libs
-        MOZ_PYTHON_DLL_SUFFIX=$DLL_SUFFIX
-        MOZ_PYTHON_INCLUDES="-I$MOZ_PYTHON_PREFIX/include/python$MOZ_PYTHON_VER_DOTTED"
-        dnl Check for dynamic Python lib
-        dnl - A static Python is no good - multiple dynamic libraries (xpcom
-        dnl - core, xpcom loader, pydom etc) all need to share Python.
-        dnl - Python 2.3's std --enable-shared configure option will
-        dnl   create a libpython2.3.so.1.0. We should first try this
-        dnl   dotted versioned .so file because this is the one that
-        dnl   the PyXPCOM build mechanics tries to link to.
-        dnl   XXX Should find a better way than hardcoding "1.0".
-        dnl - Python developement tree dir layouts are NOT allowed here
-        dnl   because the PyXPCOM build just dies on it later anyway.
-        dnl - Fixes to the above by Python/*nix knowledgable people welcome!
-        if test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
-            MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
-        elif test -f "$MOZ_PYTHON_PREFIX/lib64/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
-            MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib64 -lpython$MOZ_PYTHON_VER_DOTTED"
-        elif test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
-            MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
-        elif test -f "$MOZ_PYTHON_PREFIX/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
-            dnl Don't Python development tree directory layout.
-            MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX -lpython$MOZ_PYTHON_VER_DOTTED"
-            AC_MSG_ERROR([The Python at $MOZ_PYTHON_PREFIX looks like a dev tree. The PyXPCOM build cannot handle this yet. You must 'make install' Python and use the installed tree.])
-        elif test "$OS_ARCH" = "Darwin"; then
-            dnl We do Darwin last, so if a custom non-framework build of
-            dnl python is used on OSX, then it will be picked up first by
-            dnl the logic above.
-            MOZ_PYTHON_LIBS="-framework Python"
-        else
-            AC_MSG_ERROR([Could not find build shared libraries for Python at $MOZ_PYTHON_PREFIX.  This is required for PyXPCOM.])
-        fi
-        if test "$OS_ARCH" = "Linux"; then
-            MOZ_PYTHON_LIBS="$MOZ_PYTHON_LIBS -lutil"
-        fi
-    fi
-    dnl Handle "_d" on Windows
-    if test "$OS_ARCH" = "WINNT" && test -n "$MOZ_DEBUG"; then
-        MOZ_PYTHON_DEBUG_SUFFIX="_d"
-    else
-        MOZ_PYTHON_DEBUG_SUFFIX=
-    fi
-    AC_MSG_RESULT(Building Python extensions using python-$MOZ_PYTHON_VER_DOTTED from $MOZ_PYTHON_PREFIX)
-fi
-
-dnl If the user asks for the 'python' extension, then we add
-dnl MOZ_PYTHON_EXTENSIONS to MOZ_EXTENSIONS - but with the leading 'python/'
-dnl Note the careful regex - it must match 'python' followed by anything
-dnl other than a '/', including the end-of-string.
-if test `echo "$MOZ_EXTENSIONS" | grep -c 'python\([[^/]]\|$\)'` -ne 0; then
-    for pyext in $MOZ_PYTHON_EXTENSIONS; do
-        MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS python/$pyext`
-    done
-fi
-dnl Later we may allow MOZ_PYTHON_EXTENSIONS to be specified on the
-dnl command-line, but not yet
-AC_SUBST(MOZ_PYTHON_EXTENSIONS)
-AC_SUBST(MOZ_PYTHON)
-AC_SUBST(MOZ_PYTHON_PREFIX)
-AC_SUBST(MOZ_PYTHON_INCLUDES)
-AC_SUBST(MOZ_PYTHON_LIBS)
-AC_SUBST(MOZ_PYTHON_VER)
-AC_SUBST(MOZ_PYTHON_VER_DOTTED)
-AC_SUBST(MOZ_PYTHON_DEBUG_SUFFIX)
-AC_SUBST(MOZ_PYTHON_DLL_SUFFIX)
-
-dnl ========================================================
-dnl disable profile sharing
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(profilesharing,
-[  --disable-profilesharing           Disable profile sharing],
-    MOZ_PROFILESHARING=,
-    MOZ_PROFILESHARING=1 )
-if test "$MOZ_PROFILESHARING"; then
-  MOZ_IPCD=1
-  AC_DEFINE(MOZ_PROFILESHARING)
-fi
-
-dnl ========================================================
-dnl enable ipc/ipcd
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(ipcd,
-[  --enable-ipcd                      Enable IPC daemon],
-    MOZ_IPCD=1,
-    MOZ_IPCD= )
-
-dnl ========================================================
-dnl disable profile locking
-dnl   do no use this in applications that can have more than
-dnl   one process accessing the profile directory.
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(profilelocking,
-[  --disable-profilelocking           Disable profile locking],
-    MOZ_PROFILELOCKING=,
-    MOZ_PROFILELOCKING=1 )
-if test "$MOZ_PROFILELOCKING"; then
-  AC_DEFINE(MOZ_PROFILELOCKING)
-fi
-
-dnl ========================================================
-dnl disable rdf services
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(rdf,
-[  --disable-rdf           Disable RDF],
-    MOZ_RDF= )
-if test "$MOZ_RDF"; then
-  AC_DEFINE(MOZ_RDF)
-fi
-
-AC_SUBST(MOZ_RDF)
-
-dnl ========================================================
-dnl necko configuration options
-dnl ========================================================
-
-dnl
-dnl option to disable various necko protocols
-dnl
-MOZ_ARG_ENABLE_STRING(necko-protocols,
-[  --enable-necko-protocols[={http,ftp,default,all,none}]
-                          Enable/disable specific protocol handlers],
-[ for option in `echo $enableval | sed 's/,/ /g'`; do
-    if test "$option" = "yes" || test "$option" = "all"; then
-        NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
-    elif test "$option" = "no" || test "$option" = "none"; then
-        NECKO_PROTOCOLS=""
-    elif test "$option" = "default"; then
-        NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
-    elif test `echo "$option" | grep -c \^-` != 0; then
-        option=`echo $option | sed 's/^-//'`
-        NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
-    else
-        NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
-    fi
-done],
-    NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
-dnl Remove dupes
-NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
-AC_SUBST(NECKO_PROTOCOLS)
-for p in $NECKO_PROTOCOLS; do
-    AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
-done
-
-dnl
-dnl option to disable necko's disk cache
-dnl
-MOZ_ARG_DISABLE_BOOL(necko-disk-cache,
-[  --disable-necko-disk-cache
-                          Disable necko disk cache],
-    NECKO_DISK_CACHE=,
-    NECKO_DISK_CACHE=1)
-AC_SUBST(NECKO_DISK_CACHE)
-if test "$NECKO_DISK_CACHE"; then
-    AC_DEFINE(NECKO_DISK_CACHE)
-fi
-
-dnl
-dnl option to minimize size of necko's i/o buffers
-dnl
-MOZ_ARG_ENABLE_BOOL(necko-small-buffers,
-[  --enable-necko-small-buffers
-                          Minimize size of necko's i/o buffers],
-    NECKO_SMALL_BUFFERS=1,
-    NECKO_SMALL_BUFFERS=)
-AC_SUBST(NECKO_SMALL_BUFFERS)
-if test "$NECKO_SMALL_BUFFERS"; then
-    AC_DEFINE(NECKO_SMALL_BUFFERS)
-fi 
-
-dnl
-dnl option to disable cookies
-dnl
-MOZ_ARG_DISABLE_BOOL(cookies,
-[  --disable-cookies       Disable cookie support],
-    NECKO_COOKIES=,
-    NECKO_COOKIES=1)
-AC_SUBST(NECKO_COOKIES)
-if test "$NECKO_COOKIES"; then
-    AC_DEFINE(NECKO_COOKIES)
-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
-  AC_DEFINE(MOZ_MORK)
-fi
-
-dnl Build the lightweight Mork reader if required
-AC_SUBST(MOZ_MORKREADER)
-if test "$MOZ_MORKREADER"; then
-  AC_DEFINE(MOZ_MORKREADER)
-fi
 
 dnl ========================================================
 if test "$MOZ_DEBUG" || test "$NS_TRACE_MALLOC"; then
     MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
 fi
 
 dnl ========================================================
 dnl =
@@ -7734,134 +4848,73 @@ AC_SUBST(LD)
 AC_SUBST(RC)
 AC_SUBST(RCFLAGS)
 AC_SUBST(WINDRES)
 AC_SUBST(USE_SHORT_LIBNAME)
 AC_SUBST(IMPLIB)
 AC_SUBST(FILTER)
 AC_SUBST(BIN_FLAGS)
 AC_SUBST(NS_USE_NATIVE)
-AC_SUBST(MOZ_WIDGET_TOOLKIT)
-AC_SUBST(MOZ_GFX_TOOLKIT)
-AC_SUBST(MOZ_UPDATE_XTERM)
-AC_SUBST(MINIMO)
-AC_SUBST(MOZ_PLATFORM_HILDON)
-AC_SUBST(NS_OSSO)
-AC_SUBST(NS_MAEMO_LOCATION)
-AC_SUBST(MOZ_AUTH_EXTENSION)
-AC_SUBST(MOZ_MATHML)
-AC_SUBST(MOZ_PERMISSIONS)
-AC_SUBST(MOZ_XTF)
-AC_SUBST(MOZ_NO_INSPECTOR_APIS)
-AC_SUBST(MOZ_PREF_EXTENSIONS)
-AC_SUBST(MOZ_SVG)
-AC_SUBST(MOZ_XSLT_STANDALONE)
 AC_SUBST(MOZ_JS_LIBS)
 AC_SUBST(MOZ_PSM)
 AC_SUBST(MOZ_DEBUG)
 AC_SUBST(MOZ_DEBUG_MODULES)
 AC_SUBST(MOZ_PROFILE_MODULES)
 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
 AC_SUBST(MOZ_DEBUG_FLAGS)
 AC_SUBST(MOZ_DEBUG_LDFLAGS)
 AC_SUBST(WARNINGS_AS_ERRORS)
 AC_SUBST(MOZ_DBGRINFO_MODULES)
-AC_SUBST(MOZ_EXTENSIONS)
-AC_SUBST(MOZ_IMG_DECODERS)
-AC_SUBST(MOZ_IMG_ENCODERS)
-AC_SUBST(MOZ_JSDEBUGGER)
-AC_SUBST(MOZ_OJI)
-AC_SUBST(MOZ_NO_XPCOM_OBSOLETE)
-AC_SUBST(MOZ_PLUGINS)
 AC_SUBST(ENABLE_EAZEL_PROFILER)
 AC_SUBST(EAZEL_PROFILER_CFLAGS)
 AC_SUBST(EAZEL_PROFILER_LIBS)
 AC_SUBST(MOZ_PERF_METRICS)
 AC_SUBST(GC_LEAK_DETECTOR)
-AC_SUBST(MOZ_LOG_REFCNT)
 AC_SUBST(MOZ_LEAKY)
 AC_SUBST(MOZ_JPROF)
 AC_SUBST(MOZ_SHARK)
 AC_SUBST(MOZ_CALLGRIND)
 AC_SUBST(MOZ_VTUNE)
 AC_SUBST(MOZ_XPCTOOLS)
 AC_SUBST(MOZ_JSLOADER)
-AC_SUBST(MOZ_USE_NATIVE_UCONV)
 AC_SUBST(MOZ_INSURE)
 AC_SUBST(MOZ_INSURE_DIRS)
 AC_SUBST(MOZ_INSURE_EXCLUDE_DIRS)
 AC_SUBST(MOZ_QUANTIFY)
 AC_SUBST(MOZ_INSURIFYING)
 AC_SUBST(LIBICONV)
-AC_SUBST(MOZ_PLACES)
-AC_SUBST(MOZ_PLACES_BOOKMARKS)
-AC_SUBST(MOZ_STORAGE)
-AC_SUBST(MOZ_FEEDS)
-AC_SUBST(NS_PRINTING)
-
-AC_SUBST(MOZ_JAVAXPCOM)
-AC_SUBST(JAVA_INCLUDE_PATH)
-AC_SUBST(JAVA)
-AC_SUBST(JAVAC)
-AC_SUBST(JAR)
-
-AC_SUBST(MOZ_PROFILESHARING)
-AC_SUBST(MOZ_PROFILELOCKING)
-
-AC_SUBST(MOZ_IPCD)
-
-AC_SUBST(HAVE_XIE)
-AC_SUBST(MOZ_XIE_LIBS)
-AC_SUBST(MOZ_ENABLE_POSTSCRIPT)
-
-AC_SUBST(XPCOM_USE_LEA)
+
 AC_SUBST(BUILD_STATIC_LIBS)
-AC_SUBST(MOZ_ENABLE_LIBXUL)
 AC_SUBST(ENABLE_TESTS)
-AC_SUBST(IBMBIDI)
-AC_SUBST(MOZ_UNIVERSALCHARDET)
-AC_SUBST(ACCESSIBILITY)
-AC_SUBST(MOZ_XPINSTALL)
-AC_SUBST(MOZ_VIEW_SOURCE)
-AC_SUBST(MOZ_SPELLCHECK)
-AC_SUBST(MOZ_XPFE_COMPONENTS)
-AC_SUBST(MOZ_USER_DIR)
-AC_SUBST(MOZ_CRASHREPORTER)
 
 AC_SUBST(ENABLE_STRIP)
 AC_SUBST(PKG_SKIP_STRIP)
 AC_SUBST(USE_ELF_DYNSTR_GC)
 AC_SUBST(INCREMENTAL_LINKER)
 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
-AC_SUBST(MOZ_XPCOM_OBSOLETE_LIBS)
 
 AC_SUBST(MOZ_FIX_LINK_PATHS)
-AC_SUBST(XPCOM_LIBS)
-AC_SUBST(XPCOM_FROZEN_LDOPTS)
-AC_SUBST(XPCOM_GLUE_LDOPTS)
-AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
 
 AC_SUBST(USE_DEPENDENT_LIBS)
 
 AC_SUBST(MOZ_BUILD_ROOT)
 AC_SUBST(MOZ_OS2_TOOLS)
 AC_SUBST(MOZ_OS2_USE_DECLSPEC)
 
 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
 AC_SUBST(MOZ_TIMELINE)
 AC_SUBST(WINCE)
 AC_SUBST(TARGET_DEVICE)
 
 AC_SUBST(MOZ_APP_NAME)
 AC_SUBST(MOZ_APP_DISPLAYNAME)
 AC_SUBST(MOZ_APP_VERSION)
-AC_SUBST(FIREFOX_VERSION)
 
 AC_SUBST(MOZ_PKG_SPECIAL)
 
 AC_SUBST(MOZILLA_OFFICIAL)
 AC_SUBST(BUILD_OFFICIAL)
 AC_SUBST(MOZ_MILESTONE_RELEASE)
 
 dnl win32 options
@@ -7892,48 +4945,21 @@ COMPILE_CFLAGS=`echo \
     $COMPILE_CFLAGS`
 
 COMPILE_CXXFLAGS=`echo \
     $_DEFINES_CXXFLAGS \
 	$_DEPEND_CFLAGS \
     $COMPILE_CXXFLAGS`
 
 AC_SUBST(SYSTEM_MAKEDEPEND)
-AC_SUBST(SYSTEM_JPEG)
-AC_SUBST(SYSTEM_PNG)
-AC_SUBST(SYSTEM_ZLIB)
-AC_SUBST(SYSTEM_BZ2)
-
-AC_SUBST(JPEG_CFLAGS)
-AC_SUBST(JPEG_LIBS)
-AC_SUBST(ZLIB_CFLAGS)
-AC_SUBST(ZLIB_LIBS)
-AC_SUBST(BZ2_CFLAGS)
-AC_SUBST(BZ2_LIBS)
-AC_SUBST(PNG_CFLAGS)
-AC_SUBST(PNG_LIBS)
-
-AC_SUBST(MOZ_JPEG_CFLAGS)
-AC_SUBST(MOZ_JPEG_LIBS)
-AC_SUBST(MOZ_ZLIB_CFLAGS)
-AC_SUBST(MOZ_ZLIB_LIBS)
-AC_SUBST(MOZ_BZ2_CFLAGS)
-AC_SUBST(MOZ_BZ2_LIBS)
-AC_SUBST(MOZ_PNG_CFLAGS)
-AC_SUBST(MOZ_PNG_LIBS)
 
 AC_SUBST(NSPR_CFLAGS)
 AC_SUBST(NSPR_LIBS)
 AC_SUBST(MOZ_NATIVE_NSPR)
 
-AC_SUBST(NSS_CFLAGS)
-AC_SUBST(NSS_LIBS)
-AC_SUBST(NSS_DEP_LIBS)
-AC_SUBST(MOZ_NATIVE_NSS)
-
 AC_SUBST(CFLAGS)
 AC_SUBST(CXXFLAGS)
 AC_SUBST(CPPFLAGS)
 AC_SUBST(COMPILE_CFLAGS)
 AC_SUBST(COMPILE_CXXFLAGS)
 AC_SUBST(LDFLAGS)
 AC_SUBST(LIBS)
 AC_SUBST(CROSS_COMPILE)
@@ -7958,19 +4984,16 @@ AC_SUBST(TARGET_OS)
 AC_SUBST(TARGET_NSPR_MDCPUCFG)
 AC_SUBST(TARGET_MD_ARCH)
 AC_SUBST(TARGET_XPCOM_ABI)
 AC_SUBST(OS_TARGET)
 AC_SUBST(OS_ARCH)
 AC_SUBST(OS_RELEASE)
 AC_SUBST(OS_TEST)
 
-AC_SUBST(MOZ_DISABLE_JAR_PACKAGING)
-AC_SUBST(MOZ_CHROME_FILE_FORMAT)
-
 AC_SUBST(WRAP_MALLOC_CFLAGS)
 AC_SUBST(WRAP_MALLOC_LIB)
 AC_SUBST(MKSHLIB)
 AC_SUBST(MKCSHLIB)
 AC_SUBST(MKSHLIB_FORCE_ALL)
 AC_SUBST(MKSHLIB_UNFORCE_ALL)
 AC_SUBST(DSO_CFLAGS)
 AC_SUBST(DSO_PIC_CFLAGS)
@@ -8043,17 +5066,19 @@ elif test "$OS_ARCH" = "OpenVMS"; then
   AC_DEFINE(XP_UNIX)
 elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
   AC_DEFINE(XP_UNIX)
   AC_DEFINE(UNIX_ASYNC_DNS)
   MOZ_MOVEMAIL=1
 fi
 AC_SUBST(MOZ_MOVEMAIL)
 
-AC_DEFINE(JS_THREADSAFE)
+AC_ARG_ENABLE(threadsafe,
+              [  --enable-threadsafe     Enable support for multiple threads.],
+              [AC_DEFINE(JS_THREADSAFE)],)
 
 if test "$MOZ_DEBUG"; then
     AC_DEFINE(MOZ_REFLOW_PERF)
     AC_DEFINE(MOZ_REFLOW_PERF_DSP)
 fi
 
 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
     AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
@@ -8103,50 +5128,16 @@ AC_SUBST(WIN_TOP_SRC)
 
 AC_SUBST(MOZILLA_VERSION)
 
 AC_SUBST(ac_configure_args)
 
 dnl Spit out some output
 dnl ========================================================
 
-dnl The following defines are used by xpcom
-_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
-CPP_THROW_NEW
-HAVE_CPP_2BYTE_WCHAR_T
-HAVE_CPP_ACCESS_CHANGING_USING
-HAVE_CPP_AMBIGUITY_RESOLVING_USING
-HAVE_CPP_BOOL
-HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
-HAVE_CPP_EXPLICIT
-HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
-HAVE_CPP_NAMESPACE_STD
-HAVE_CPP_NEW_CASTS
-HAVE_CPP_PARTIAL_SPECIALIZATION
-HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
-HAVE_CPP_TYPENAME
-HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
-HAVE_STATVFS
-NEED_CPP_UNUSED_IMPLEMENTATIONS
-NEW_H
-HAVE_GETPAGESIZE
-HAVE_ICONV
-HAVE_ICONV_WITH_CONST_INPUT
-HAVE_MBRTOWC
-HAVE_SYS_MOUNT_H
-HAVE_SYS_VFS_H
-HAVE_WCRTOMB
-"
-
-AC_CONFIG_HEADER(
-netwerk/necko-config.h
-xpcom/xpcom-config.h
-xpcom/xpcom-private.h
-)
-
 # Save the defines header file before autoconf removes it.
 # (Do not add AC_DEFINE calls after this line.)
   _CONFIG_TMP=confdefs-tmp.h
   _CONFIG_DEFS_H=mozilla-config.h
 
   cat > $_CONFIG_TMP <<\EOF
 /* List of defines generated by configure. Included with preprocessor flag,
  * -include, to avoid long list of -D defines on the compile command-line.
@@ -8189,20 +5180,23 @@ rm -f confdefs.h.save
 mv confdefs.h confdefs.h.save
 egrep -v "$_EGREP_PATTERN" confdefs.h.save > confdefs.h
 AC_OUTPUT_MAKE_DEFS()
 MOZ_DEFINES=$DEFS
 AC_SUBST(MOZ_DEFINES)
 rm -f confdefs.h
 mv confdefs.h.save confdefs.h
 
-dnl Load the list of Makefiles to generate.
-dnl   To add new Makefiles, edit allmakefiles.sh.
-dnl   allmakefiles.sh sets the variable, MAKEFILES.
-. ${srcdir}/allmakefiles.sh
+MAKEFILES="
+  Makefile
+  config/Makefile
+  config/autoconf.mk
+  config/mkdepend/Makefile
+"
+
 dnl 
 dnl Run a perl script to quickly create the makefiles.
 dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
 dnl   for the files it cannot handle correctly. This way, config.status
 dnl   will handle these files.
 dnl If it fails, nothing is set and config.status will run as usual.
 dnl
 dnl This does not change the $MAKEFILES variable.
@@ -8216,71 +5210,12 @@ echo $MAKEFILES | ${PERL} $srcdir/build/
 fi
 . ./conftest.sh
 rm conftest.sh
 
 echo $MAKEFILES > unallmakefiles
 
 AC_OUTPUT($MAKEFILES)
 
-dnl Prevent the regeneration of cairo-features.h forcing rebuilds of gfx stuff
-if test "$CAIRO_FEATURES_H"; then
-  if cmp -s $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig; then
-    mv -f "$CAIRO_FEATURES_H".orig "$CAIRO_FEATURES_H" 2> /dev/null
-  else
-    rm -f "$CAIRO_FEATURES_H".orig 2> /dev/null
-  fi
-fi
-
-dnl ========================================================
-dnl = Setup a nice relatively clean build environment for
-dnl = sub-configures.
-dnl ========================================================
-CC="$_SUBDIR_CC" 
-CXX="$_SUBDIR_CXX" 
-CFLAGS="$_SUBDIR_CFLAGS" 
-CPPFLAGS="$_SUBDIR_CPPFLAGS"
-CXXFLAGS="$_SUBDIR_CXXFLAGS"
-LDFLAGS="$_SUBDIR_LDFLAGS"
-HOST_CC="$_SUBDIR_HOST_CC" 
-HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
-HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
-RC=
-
-unset MAKEFILES
-unset CONFIG_FILES
-
-if test "$COMPILE_ENVIRONMENT"; then
-if test -z "$MOZ_NATIVE_NSPR"; then
-    ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
-    if test -z "$MOZ_DEBUG"; then
-        ac_configure_args="$ac_configure_args --disable-debug"
-    fi
-    if test "$MOZ_OPTIMIZE" = "1"; then
-        ac_configure_args="$ac_configure_args --enable-optimize"
-    fi
-    if test "$OS_ARCH" = "WINNT" && test "$NS_TRACE_MALLOC"; then
-       ac_configure_args="$ac_configure_args --enable-debug --disable-optimize"
-    fi
-    if test -n "$HAVE_64BIT_OS"; then
-        ac_configure_args="$ac_configure_args --enable-64bit"
-    fi
-    if test -n "$USE_ARM_KUSER"; then
-        ac_configure_args="$ac_configure_args --with-arm-kuser"
-    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" && test "$OS_ARCH" != "WINCE"; 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
-
-fi # COMPILE_ENVIRONMENT
-
+# Produce the js-config script at configure time; see the comments for
+# 'js-config' in Makefile.in.
+AC_MSG_RESULT(invoking make to create js-config script)
+$MAKE js-config
new file mode 100644
--- /dev/null
+++ b/js/src/js-config.in
@@ -0,0 +1,111 @@
+#!/bin/sh
+
+prefix='@prefix@'
+mozilla_version='@MOZILLA_VERSION@'
+LIBRARY_NAME='@LIBRARY_NAME@'
+NSPR_CFLAGS='@NSPR_CFLAGS@'
+JS_CONFIG_LIBS='@JS_CONFIG_LIBS@'
+MOZ_JS_LIBS='@MOZ_JS_LIBS@'
+
+usage()
+{
+	cat <<EOF
+Usage: js-config [OPTIONS]
+Options:
+	[--prefix[=DIR]]
+	[--exec-prefix[=DIR]]
+	[--includedir[=DIR]]
+	[--libdir[=DIR]]
+	[--version]
+	[--libs]
+	[--cflags]
+	[--lib-filenames]
+EOF
+	exit $1
+}
+
+if test $# -eq 0; then
+	usage 1 1>&2
+fi
+
+while test $# -gt 0; do
+  case "$1" in
+  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) optarg= ;;
+  esac
+
+  case $1 in
+    --prefix=*)
+      prefix=$optarg
+      ;;
+    --prefix)
+      echo_prefix=yes
+      ;;
+    --exec-prefix=*)
+      exec_prefix=$optarg
+      ;;
+    --exec-prefix)
+      echo_exec_prefix=yes
+      ;;
+    --includedir=*)
+      includedir=$optarg
+      ;;
+    --includedir)
+      echo_includedir=yes
+      ;;
+    --libdir=*)
+      libdir=$optarg
+      ;;
+    --libdir)
+      echo_libdir=yes
+      ;;
+    --version)
+      echo "$mozilla_version"
+      ;;
+    --cflags)
+      echo_cflags=yes
+      ;;
+    --libs)
+      echo_libs=yes
+      ;;
+    *)
+      usage 1 1>&2
+      ;;
+  esac
+  shift
+done
+
+# Set variables that may be dependent upon other variables
+if test -z "$exec_prefix"; then
+    exec_prefix=@exec_prefix@
+fi
+if test -z "$includedir"; then
+    includedir=@includedir@
+fi
+if test -z "$libdir"; then
+    libdir=@libdir@
+fi
+
+if test "$echo_prefix" = "yes"; then
+    echo $prefix
+fi
+
+if test "$echo_exec_prefix" = "yes"; then
+    echo $exec_prefix
+fi
+
+if test "$echo_includedir" = "yes"; then
+    echo $includedir
+fi
+
+if test "$echo_libdir" = "yes"; then
+    echo $libdir
+fi
+
+if test "$echo_cflags" = "yes"; then
+    echo "-I$includedir/js $NSPR_CFLAGS"
+fi
+
+if test "$echo_libs" = "yes"; then
+    echo "$MOZ_JS_LIBS $JS_CONFIG_LIBS"
+fi      
--- a/js/src/jsbuiltins.h
+++ b/js/src/jsbuiltins.h
@@ -37,17 +37,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef jsbuiltins_h___
 #define jsbuiltins_h___
 
 #ifdef JS_TRACER
 
-#include "nanojit.h"
+#include "nanojit/nanojit.h"
 
 enum JSTNErrType { INFALLIBLE, FAIL_NULL, FAIL_NEG, FAIL_VOID, FAIL_JSVAL };
 enum { JSTN_ERRTYPE_MASK = 7, JSTN_MORE = 8 };
 
 #define JSTN_ERRTYPE(jstn)  ((jstn)->flags & JSTN_ERRTYPE_MASK)
 
 /*
  * |prefix| and |argtypes| declare what arguments should be passed to the
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -46,17 +46,17 @@
 #ifdef _MSC_VER
 #include <malloc.h>
 #define alloca _alloca
 #endif
 #ifdef SOLARIS
 #include <alloca.h>
 #endif
 
-#include "nanojit.h"
+#include "nanojit/nanojit.h"
 #include "jsarray.h"            // higher-level library and API headers
 #include "jsbool.h"
 #include "jscntxt.h"
 #include "jsdbgapi.h"
 #include "jsemit.h"
 #include "jsfun.h"
 #include "jsinterp.h"
 #include "jsiter.h"
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -220,16 +220,17 @@ SIGN_NSS	+= $(SIGN_CMD) $(SOFTOKN); \
 
 endif # MOZ_PSM
 endif # !CROSS_COMPILE
 
 NO_PKG_FILES += \
 	core \
 	bsdecho \
 	gtscc \
+	js-config \
 	jscpucfg \
 	nsinstall \
 	viewer \
 	TestGtkEmbed \
 	bloaturls.txt \
 	codesighs* \
 	elf-dynstr-gc \
 	mangle* \
--- a/toolkit/toolkit-makefiles.sh
+++ b/toolkit/toolkit-makefiles.sh
@@ -161,20 +161,16 @@ MAKEFILES_intl="
   intl/unicharutil/tests/Makefile
   intl/unicharutil/tools/Makefile
   intl/strres/Makefile
   intl/strres/public/Makefile
   intl/strres/src/Makefile
   intl/strres/tests/Makefile
 "
 
-MAKEFILES_js="
-  js/src/Makefile
-"
-
 MAKEFILES_liveconnect="
   js/src/liveconnect/Makefile
   js/src/liveconnect/classes/Makefile
 "
 
 MAKEFILES_xpconnect="
   js/src/xpconnect/Makefile
   js/src/xpconnect/public/Makefile
@@ -769,17 +765,16 @@ MAKEFILES_libmar="
 add_makefiles "
   $MAKEFILES_db
   $MAKEFILES_dom
   $MAKEFILES_editor
   $MAKEFILES_expat
   $MAKEFILES_gfx
   $MAKEFILES_htmlparser
   $MAKEFILES_intl
-  $MAKEFILES_js
   $MAKEFILES_liveconnect
   $MAKEFILES_xpconnect
   $MAKEFILES_jsdebugger
   $MAKEFILES_content
   $MAKEFILES_layout
   $MAKEFILES_libimg
   $MAKEFILES_libjar
   $MAKEFILES_libreg
--- a/toolkit/toolkit-tiers.mk
+++ b/toolkit/toolkit-tiers.mk
@@ -35,17 +35,17 @@
 #
 # ***** END LICENSE BLOCK *****
 
 ifdef LIBXUL_SDK
 $(error toolkit-tiers.mk is not compatible with --enable-libxul-sdk=)
 endif
 
 include $(topsrcdir)/config/nspr/build.mk
-include $(topsrcdir)/js/src/build.mk
+include $(topsrcdir)/config/js/build.mk
 include $(topsrcdir)/xpcom/build.mk
 include $(topsrcdir)/netwerk/build.mk
 
 TIERS += \
 	external \
 	gecko \
 	toolkit \
 	$(NULL)