Bug 742795 - Autogenerate autoconf.mk. r=ted
☠☠ backed out by 867c9f564966 ☠ ☠
authorMike Hommey <mh+mozilla@glandium.org>
Mon, 06 Aug 2012 15:19:50 +0200
changeset 101551 7f8928077ed4fed434d03af45843de85298b13e1
parent 101550 0a9fd0b1b5bfbad9622877f3cdcba29b7491d07e
child 101552 1f4eae8d9e089cbc97fd8e0c444473184b2f1f68
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersted
bugs742795
milestone17.0a1
Bug 742795 - Autogenerate autoconf.mk. r=ted
build/ConfigStatus.py
build/tests/unit-ConfigStatus.py
config/autoconf.mk.in
js/src/build/ConfigStatus.py
js/src/config/autoconf.mk.in
--- a/build/ConfigStatus.py
+++ b/build/ConfigStatus.py
@@ -94,53 +94,58 @@ def shell_escape(s):
     '''
     return re.sub('''([ \t`#$^&*(){}\\|;'"<>?\[\]])''', r'\\\1', str(s)).replace('$', '$$')
 
 class ConfigEnvironment(object):
     '''A ConfigEnvironment is defined by a source directory and a build
     directory. It preprocesses files from the source directory and stores
     the result in the object directory.
 
-     There are two types of files: config files and config headers,
-     each treated through a different member function.
+    There are two types of files: config files and config headers,
+    each treated through a different member function.
 
-     Creating a ConfigEnvironment requires a few arguments:
-       - topsrcdir and topobjdir are, respectively, the top source and
-         the top object directory.
-       - defines is a list of (name, value) tuples. In autoconf, these are
-         set with AC_DEFINE and AC_DEFINE_UNQUOTED
-       - non_global_defines are a list of names appearing in defines above
-         that are not meant to be exported in ACDEFINES and ALLDEFINES (see
-         below)
-       - substs is a list of (name, value) tuples. In autoconf, these are
-         set with AC_SUBST.
+    Creating a ConfigEnvironment requires a few arguments:
+      - topsrcdir and topobjdir are, respectively, the top source and
+        the top object directory.
+      - defines is a list of (name, value) tuples. In autoconf, these are
+        set with AC_DEFINE and AC_DEFINE_UNQUOTED
+      - non_global_defines are a list of names appearing in defines above
+        that are not meant to be exported in ACDEFINES and ALLDEFINES (see
+        below)
+      - substs is a list of (name, value) tuples. In autoconf, these are
+        set with AC_SUBST.
 
-     ConfigEnvironment automatically defines two additional substs variables
-     from all the defines not appearing in non_global_defines:
-       - ACDEFINES contains the defines in the form -DNAME=VALUE, for use on
-         preprocessor command lines. The order in which defines were given
-         when creating the ConfigEnvironment is preserved.
-       - ALLDEFINES contains the defines in the form #define NAME VALUE, in
-         sorted order, for use in config files, for an automatic listing of
-         defines.
+    ConfigEnvironment automatically defines two additional substs variables
+    from all the defines not appearing in non_global_defines:
+      - ACDEFINES contains the defines in the form -DNAME=VALUE, for use on
+        preprocessor command lines. The order in which defines were given
+        when creating the ConfigEnvironment is preserved.
+      - ALLDEFINES contains the defines in the form #define NAME VALUE, in
+        sorted order, for use in config files, for an automatic listing of
+        defines.
+    and another additional subst variable from all the other substs:
+      - ALLSUBSTS contains the substs in the form NAME = VALUE, in sorted
+        order, for use in autoconf.mk. It includes ACDEFINES, but doesn't
+        include ALLDEFINES.
 
     ConfigEnvironment expects a "top_srcdir" subst to be set with the top
     source directory, in msys format on windows. It is used to derive a
     "srcdir" subst when treating config files. It can either be an absolute
     path or a path relative to the topobjdir.
     '''
 
     def __init__(self, topobjdir = '.', topsrcdir = '.',
                  defines = [], non_global_defines = [], substs = []):
         self.defines = dict(defines)
         self.substs = dict(substs)
         self.topsrcdir = topsrcdir
         self.topobjdir = topobjdir
         global_defines = [name for name, value in defines if not name in non_global_defines]
         self.substs['ACDEFINES'] = ' '.join(["-D%s=%s" % (name, shell_escape(self.defines[name])) for name in global_defines])
+        self.substs['ALLSUBSTS'] = '\n'.join(sorted(["%s = %s" % (name, self.substs[name]) for name in self.substs]))
         self.substs['ALLDEFINES'] = '\n'.join(sorted(["#define %s %s" % (name, self.defines[name]) for name in global_defines]))
 
     def get_relative_srcdir(self, file):
         '''Returns the relative source directory for the given file, always
         using / as a path separator.
         '''
         assert(isinstance(file, basestring))
         dir = posixpath.dirname(relpath(file, self.topobjdir).replace(os.sep, '/'))
--- a/build/tests/unit-ConfigStatus.py
+++ b/build/tests/unit-ConfigStatus.py
@@ -49,30 +49,40 @@ class TestFileAvoidWrite(unittest.TestCa
             # Check that no write actually happens when writing the
             # same content as what already is in the file
             with FileAvoidWrite('file') as file:
                 file.write('content')
 
 
 class TestEnvironment(unittest.TestCase):
     def test_auto_substs(self):
-        '''Test the automatically set values of ACDEFINES and ALLDEFINES.
+        '''Test the automatically set values of ACDEFINES, ALLDEFINES
+        and ALLSUBSTS.
         '''
         env = ConfigEnvironment(
                   defines = [ ('foo', 'bar'), ('baz', 'qux 42'),
                               ('abc', 'def'), ('extra', 'foobar') ],
-                  non_global_defines = ['extra', 'ignore'])
+                  non_global_defines = ['extra', 'ignore'],
+                  substs = [ ('FOO', 'bar'), ('ABC', 'def'),
+                             ('bar', 'baz qux'), ('zzz', '"abc def"') ])
         # non_global_defines should be filtered out in ACDEFINES and
         # ALLDEFINES.
         # Original order of the defines need to be respected in ACDEFINES
-        self.assertEqual(env.substs['ACDEFINES'], '-Dfoo=bar -Dbaz=qux\\ 42 -Dabc=def')
+        self.assertEqual(env.substs['ACDEFINES'], '''-Dfoo=bar -Dbaz=qux\ 42 -Dabc=def''')
         # ALLDEFINES, on the other hand, needs to be sorted
         self.assertEqual(env.substs['ALLDEFINES'], '''#define abc def
 #define baz qux 42
 #define foo bar''')
+        # Likewise for ALLSUBSTS, which also mustn't contain ALLDEFINES
+        # but contain ACDEFINES
+        self.assertEqual(env.substs['ALLSUBSTS'], '''ABC = def
+ACDEFINES = -Dfoo=bar -Dbaz=qux\ 42 -Dabc=def
+FOO = bar
+bar = baz qux
+zzz = "abc def"''')
 
     def test_config_file(self):
         '''Test the creation of config files.
         '''
         with MockedOpen({'file.in': '''#ifdef foo
 @foo@
 @bar@
 '''}):
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -1,668 +1,2 @@
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# A netscape style .mk file for autoconf builds
-
-target          = @target@
-ac_configure_args = @ac_configure_args@
-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_BASENAME = @MOZ_APP_BASENAME@
-MOZ_APP_VENDOR = @MOZ_APP_VENDOR@
-MOZ_APP_PROFILE = @MOZ_APP_PROFILE@
-MOZ_APP_ID = @MOZ_APP_ID@
-MAR_CHANNEL_ID = @MAR_CHANNEL_ID@
-ACCEPTED_MAR_CHANNEL_IDS = @ACCEPTED_MAR_CHANNEL_IDS@
-MOZ_PROFILE_MIGRATOR = @MOZ_PROFILE_MIGRATOR@
-MOZ_EXTENSION_MANAGER = @MOZ_EXTENSION_MANAGER@
-MOZ_APP_UA_NAME = @MOZ_APP_UA_NAME@
-MOZ_UA_OS_AGNOSTIC = @MOZ_UA_OS_AGNOSTIC@
-MOZ_APP_VERSION = @MOZ_APP_VERSION@
-MOZ_APP_MAXVERSION = @MOZ_APP_MAXVERSION@
-MOZ_MACBUNDLE_NAME = @MOZ_MACBUNDLE_NAME@
-MOZ_MACBUNDLE_ID = @MOZ_MACBUNDLE_ID@
-MOZ_APP_STATIC_INI = @MOZ_APP_STATIC_INI@
-
-MOZ_PKG_SPECIAL = @MOZ_PKG_SPECIAL@
-
-prefix		= @prefix@
-exec_prefix	= @exec_prefix@
-bindir		= @bindir@
-includedir	= @includedir@
-libdir		= @libdir@
-datadir		= @datadir@
-mandir		= @mandir@
-
-LIBXUL_SDK      = @LIBXUL_SDK@
-
-MOZ_FS_LAYOUT = @MOZ_FS_LAYOUT@
-
-L10NBASEDIR     = @L10NBASEDIR@
-
-LIBXUL_DIST	= @LIBXUL_DIST@
-SYSTEM_LIBXUL   = @SYSTEM_LIBXUL@
-
-XULRUNNER_STUB_NAME = @XULRUNNER_STUB_NAME@
-
-MOZ_CHROME_FILE_FORMAT	= @MOZ_CHROME_FILE_FORMAT@
-MOZ_OMNIJAR		= @MOZ_OMNIJAR@
-OMNIJAR_NAME		= @OMNIJAR_NAME@
-
-MOZ_WIDGET_TOOLKIT	= @MOZ_WIDGET_TOOLKIT@
-MOZ_GFX_OPTIMIZE_MOBILE = @MOZ_GFX_OPTIMIZE_MOBILE@
-
-MOZ_X11			= @MOZ_X11@
-
-MOZ_PANGO = @MOZ_PANGO@
-
-MOZ_JS_LIBS		   = @MOZ_JS_LIBS@
-
-MOZ_DEBUG	= @MOZ_DEBUG@
-MOZ_DEBUG_SYMBOLS = @MOZ_DEBUG_SYMBOLS@
-MOZ_DEBUG_ENABLE_DEFS		= @MOZ_DEBUG_ENABLE_DEFS@
-MOZ_DEBUG_DISABLE_DEFS	= @MOZ_DEBUG_DISABLE_DEFS@
-MOZ_DEBUG_FLAGS	= @MOZ_DEBUG_FLAGS@
-MOZ_DEBUG_LDFLAGS=@MOZ_DEBUG_LDFLAGS@
-MOZ_EXTENSIONS  = @MOZ_EXTENSIONS@
-MOZ_JSDEBUGGER  = @MOZ_JSDEBUGGER@
-MOZ_IPDL_TESTS 	= @MOZ_IPDL_TESTS@
-MOZ_MEMORY      = @MOZ_MEMORY@
-MOZ_JEMALLOC    = @MOZ_JEMALLOC@
-MOZ_PROFILING   = @MOZ_PROFILING@
-MOZ_ENABLE_PROFILER_SPS = @MOZ_ENABLE_PROFILER_SPS@
-MOZ_JPROF       = @MOZ_JPROF@
-MOZ_SHARK       = @MOZ_SHARK@
-MOZ_CALLGRIND   = @MOZ_CALLGRIND@
-MOZ_VALGRIND    = @MOZ_VALGRIND@
-MOZ_VTUNE       = @MOZ_VTUNE@
-MOZ_ETW         = @MOZ_ETW@
-DEHYDRA_PATH    = @DEHYDRA_PATH@
-
-MOZ_USING_CCACHE = @MOZ_USING_CCACHE@
-CLANG_CXX = @CLANG_CXX@
-MOZ_LINKER = @MOZ_LINKER@
-MOZ_OLD_LINKER = @MOZ_OLD_LINKER@
-MOZ_ENABLE_SZIP = @MOZ_ENABLE_SZIP@
-NS_TRACE_MALLOC = @NS_TRACE_MALLOC@
-USE_ELF_DYNSTR_GC = @USE_ELF_DYNSTR_GC@
-USE_ELF_HACK = @USE_ELF_HACK@
-STDCXX_COMPAT = @STDCXX_COMPAT@
-MOZ_LIBSTDCXX_TARGET_VERSION=@MOZ_LIBSTDCXX_TARGET_VERSION@
-MOZ_LIBSTDCXX_HOST_VERSION=@MOZ_LIBSTDCXX_HOST_VERSION@
-INCREMENTAL_LINKER = @INCREMENTAL_LINKER@
-MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@
-ENABLE_TESTS	= @ENABLE_TESTS@
-ENABLE_MARIONETTE = @ENABLE_MARIONETTE@
-IBMBIDI = @IBMBIDI@
-MOZ_UNIVERSALCHARDET = @MOZ_UNIVERSALCHARDET@
-ACCESSIBILITY = @ACCESSIBILITY@
-MOZ_BRANDING_DIRECTORY = @MOZ_BRANDING_DIRECTORY@
-MOZ_MAINTENANCE_SERVICE	= @MOZ_MAINTENANCE_SERVICE@
-MOZ_VERIFY_MAR_SIGNATURE	= @MOZ_VERIFY_MAR_SIGNATURE@
-MOZ_ENABLE_SIGNMAR	= @MOZ_ENABLE_SIGNMAR@
-MOZ_UPDATER	= @MOZ_UPDATER@
-MOZ_UPDATE_CHANNEL	= @MOZ_UPDATE_CHANNEL@
-MOZ_UPDATE_PACKAGING	= @MOZ_UPDATE_PACKAGING@
-MOZ_DISABLE_PARENTAL_CONTROLS = @MOZ_DISABLE_PARENTAL_CONTROLS@
-NS_ENABLE_TSF = @NS_ENABLE_TSF@
-MOZ_SPELLCHECK = @MOZ_SPELLCHECK@
-MOZ_ANDROID_HISTORY = @MOZ_ANDROID_HISTORY@
-MOZ_WEBSMS_BACKEND = @MOZ_WEBSMS_BACKEND@
-MOZ_JAVA_COMPOSITOR = @MOZ_JAVA_COMPOSITOR@
-MOZ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LIBJPEG_TURBO_AS@
-LIBJPEG_TURBO_ASFLAGS = @LIBJPEG_TURBO_ASFLAGS@
-LIBJPEG_TURBO_X86_ASM = @LIBJPEG_TURBO_X86_ASM@
-LIBJPEG_TURBO_X64_ASM = @LIBJPEG_TURBO_X64_ASM@
-LIBJPEG_TURBO_ARM_ASM = @LIBJPEG_TURBO_ARM_ASM@
-NS_PRINTING = @NS_PRINTING@
-MOZ_PDF_PRINTING = @MOZ_PDF_PRINTING@
-MOZ_CRASHREPORTER = @MOZ_CRASHREPORTER@
-MOZ_CRASHREPORTER_INJECTOR = @MOZ_CRASHREPORTER_INJECTOR@
-MOZ_HELP_VIEWER = @MOZ_HELP_VIEWER@
-MOC = @MOC@
-RCC = @RCC@
-MOZ_NSS_PATCH = @MOZ_NSS_PATCH@
-MOZ_WEBGL = @MOZ_WEBGL@
-MOZ_ANGLE_RENDERER = @MOZ_ANGLE_RENDERER@
-MOZ_DIRECTX_SDK_PATH = @MOZ_DIRECTX_SDK_PATH@
-MOZ_DIRECTX_SDK_CPU_SUFFIX = @MOZ_DIRECTX_SDK_CPU_SUFFIX@
-MOZ_D3DX9_VERSION = @MOZ_D3DX9_VERSION@
-MOZ_D3DX9_CAB = @MOZ_D3DX9_CAB@
-MOZ_D3DCOMPILER_CAB = @MOZ_D3DCOMPILER_CAB@
-MOZ_D3DX9_DLL = @MOZ_D3DX9_DLL@
-MOZ_D3DCOMPILER_DLL = @MOZ_D3DCOMPILER_DLL@
-MOZ_GL_PROVIDER = @MOZ_GL_PROVIDER@
-MOZ_GL_DEFAULT_PROVIDER = @MOZ_GL_DEFAULT_PROVIDER@
-MOZ_WEBRTC = @MOZ_WEBRTC@
-
-
-JAVA=@JAVA@
-JAVAC=@JAVAC@
-JAR=@JAR@
-
-TAR=@TAR@
-
-MAKENSISU=@MAKENSISU@
-
-# 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@
-
-MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS = @MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS@
-MOZ_COMPONENT_NSPR_LIBS=@MOZ_COMPONENT_NSPR_LIBS@
-
-MOZ_FIX_LINK_PATHS=@MOZ_FIX_LINK_PATHS@
-
-XPCOM_FROZEN_LDOPTS=@XPCOM_FROZEN_LDOPTS@
-XPCOM_LIBS=@XPCOM_LIBS@
-LIBXUL_LIBS=@LIBXUL_LIBS@
-
-ENABLE_STRIP	= @ENABLE_STRIP@
-PKG_SKIP_STRIP	= @PKG_SKIP_STRIP@
-STRIP_FLAGS = @STRIP_FLAGS@
-
-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@
-
-NECKO_PROTOCOLS = @NECKO_PROTOCOLS@
-NECKO_COOKIES = @NECKO_COOKIES@
-NECKO_WIFI = @NECKO_WIFI@
-MOZ_AUTH_EXTENSION = @MOZ_AUTH_EXTENSION@
-
-MOZ_NATIVE_HUNSPELL = @MOZ_NATIVE_HUNSPELL@
-MOZ_HUNSPELL_LIBS = @MOZ_HUNSPELL_LIBS@
-MOZ_HUNSPELL_CFLAGS = @MOZ_HUNSPELL_CFLAGS@
-
-MOZ_NATIVE_LIBEVENT = @MOZ_NATIVE_LIBEVENT@
-MOZ_LIBEVENT_LIBS = @MOZ_LIBEVENT_LIBS@
-MOZ_LIBEVENT_INCLUDES = @MOZ_LIBEVENT_INCLUDES@
-
-MOZ_NATIVE_LIBVPX = @MOZ_NATIVE_LIBVPX@
-MOZ_LIBVPX_LIBS = @MOZ_LIBVPX_LIBS@
-MOZ_LIBVPX_CFLAGS = @MOZ_LIBVPX_CFLAGS@
-
-MOZ_NATIV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LAGS = @MOZ_PGO_OPTIMIZE_FLAGS@
-MOZ_OPTIMIZE_LDFLAGS = @MOZ_OPTIMIZE_LDFLAGS@
-MOZ_OPTIMIZE_SIZE_TWEAK = @MOZ_OPTIMIZE_SIZE_TWEAK@
-
-MOZ_ALLOW_HEAP_EXECUTE_FLAGS = @MOZ_ALLOW_HEAP_EXECUTE_FLAGS@
-
-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@
-XEXT_LIBS	= @XEXT_LIBS@
-XCOMPOSITE_LIBS	= @XCOMPOSITE_LIBS@
-XSS_LIBS	= @XSS_LIBS@
-
-MOZ_THUMB2	= @MOZ_THUMB2@
-MOZ_EGL_XRENDER_COMPOSITE	= @MOZ_EGL_XRENDER_COMPOSITE@
-
-WIN_TOP_SRC	= @WIN_TOP_SRC@
-AR		= @AR@
-AR_FLAGS	= @AR_FLAGS@
-AR_EXTRACT	= @AR_EXTRACT@
-AR_LIST		= @AR_LIST@
-AR_DELETE	= @AR_DELETE@
-AS		= @AS@
-ASFLAGS		= @ASFLAGS@
-AS_DASH_C_FLAG	= @AS_DASH_C_FLAG@
-LD		= @LD@
-RC		= @RC@
-RCFLAGS		= @RCFLAGS@
-MC		= @MC@
-WINDRES		= @WINDRES@
-IMPLIB		= @IMPLIB@
-FILTER		= @FILTER@
-BIN_FLAGS	= @BIN_FLAGS@
-MIDL		= @MIDL@
-MIDL_FLAGS	= @MIDL_FLAGS@
-_MSC_VER	= @_MSC_VER@
-
-DLL_PREFIX	= @DLL_PREFIX@
-LIB_PREFIX	= @LIB_PREFIX@
-OBJ_SUFFIX	= @OBJ_SUFFIX@
-LIB_SUFFIX	= @LIB_SUFFIX@
-DLL_SUFFIX	= @DLL_SUFFIX@
-BIN_SUFFIX	= @BIN_SUFFIX@
-ASM_SUFFIX	= @ASM_SUFFIX@
-IMPORT_LIB_SUFFIX = @IMPORT_LIB_SUFFIX@
-LIBS_DESC_SUFFIX = @LIBS_DESC_SUFFIX@
-USE_N32		= @USE_N32@
-HAVE_64BIT_OS	= @HAVE_64BIT_OS@
-
-CC		    = @CC@
-CXX		    = @CXX@
-CPP       = @CPP@
-TOOLCHAIN_PREFIX = @TOOLCHAIN_PREFIX@
-
-CC_VERSION	= @CC_VERSION@
-CXX_VERSION	= @CXX_VERSION@
-
-GNU_AS		= @GNU_AS@
-GNU_LD		= @GNU_LD@
-GNU_CC		= @GNU_CC@
-GNU_CXX		= @GNU_CXX@
-INTEL_CC	= @INTEL_CC@
-INTEL_CXX	= @INTEL_CXX@
-
-STL_FLAGS		= @STL_FLAGS@
-WRAP_STL_INCLUDES	= @WRAP_STL_INCLUDES@
-MOZ_MSVC_STL_WRAP__Throw= @MOZ_MSVC_STL_WRAP__Throw@
-MOZ_MSVC_STL_WRAP__RAISE= @MOZ_MSVC_STL_WRAP__RAISE@
-
-HOST_CC		= @HOST_CC@
-HOST_CXX	= @HOST_CXX@
-HOST_CFLAGS	= @HOST_CFLAGS@
-HOST_CXXFLAGS	= @HOST_CXXFLAGS@
-HOST_LDFLAGS	= @HOST_LDFLAGS@
-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_OS_ARCH	= @HOST_OS_ARCH@
-host_cpu	= @host_cpu@
-host_vendor	= @host_vendor@
-host_os		= @host_os@
-
-TARGET_NSPR_MDCPUCFG = @TARGET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
-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@
-NSS_DISABLE_DBM = @NSS_DISABLE_DBM@
-
-XPCOM_GLUE_LDOPTS	= @XPCOM_GLUE_LDOPTS@
-XPCOM_STANDALONE_GLUE_LDOPTS	= @XPCOM_STANDALONE_GLUE_LDOPTS@
-XPCOM_STATICRUNTIME_GLUE_LDOPTS	= @XPCOM_STATICRUNTIME_GLUE_LDOPTS@
-XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS	= @XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS@
-
-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_LDFLAGS            = @WRAP_LDFLAGS@
-DSO_CFLAGS              = @DSO_CFLAGS@
-DSO_PIC_CFLAGS          = @DSO_PIC_CFLAGS@
-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@
-TK_CFLAGS	= @TK_CFLAGS@
-TK_LIBS		= @TK_LIBS@
-
-CAIRO_FT_CFLAGS		= @CAIRO_FT_CFLAGS@
-
-MOZ_TREE_FREETYPE		= @MOZ_TREE_FREETYPE@
-MOZ_ENABLE_CAIRO_FT	= @MOZ_ENABLE_CAIRO_FT@
-MOZ_ENABLE_GTK2		= @MOZ_ENABLE_GTK2@
-MOZ_ENABLE_QT		= @MOZ_ENABLE_QT@
-MOZ_ENABLE_XREMOTE	= @MOZ_ENABLE_XREMOTE@
-MOZ_ENABLE_DWRITE_FONT	= @MOZ_ENABLE_DWRITE_FONT@
-MOZ_ENABLE_D2D_SURFACE	= @MOZ_ENABLE_D2D_SURFACE@
-MOZ_ENABLE_D3D9_LAYER	= @MOZ_ENABLE_D3D9_LAYER@
-MOZ_ENABLE_D3D10_LAYER  = @MOZ_ENABLE_D3D10_LAYER@
-MOZ_METRO	= @MOZ_METRO@
-MAKEPRI	= @MAKEPRI@
-CRTDLLVERSION	= @CRTDLLVERSION@
-CRTEXPDLLVERSION	= @CRTEXPDLLVERSION@
-
-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_ENABLE_QTNETWORK    = @MOZ_ENABLE_QTNETWORK@
-MOZ_ENABLE_QMSYSTEM2    = @MOZ_ENABLE_QMSYSTEM2@
-MOZ_ENABLE_QTMOBILITY   = @MOZ_ENABLE_QTMOBILITY@
-MOZ_ENABLE_CONTENTACTION   = @MOZ_ENABLE_CONTENTACTION@
-MOZ_ENABLE_MEEGOTOUCHSHARE = @MOZ_ENABLE_MEEGOTOUCHSHARE@
-MOZ_ENABLE_CONTENTMANAGER = @MOZ_ENABLE_CONTENTMANAGER@
-
-MOZ_DBUS_CFLAGS         = @MOZ_DBUS_CFLAGS@
-MOZ_DBUS_LIBS           = @MOZ_DBUS_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@
-
-XT_LIBS			= @XT_LIBS@
-
-MOZ_LIBPROXY_CFLAGS     = @MOZ_LIBPROXY_CFLAGS@
-MOZ_LIBPROXY_LIBS       = @MOZ_LIBPROXY_LIBS@
-MOZ_ENABLE_LIBPROXY     = @MOZ_ENABLE_LIBPROXY@
-
-MOZ_LIBNOTIFY_CFLAGS	= @MOZ_LIBNOTIFY_CFLAGS@
-MOZ_LIBNOTIFY_LIBS	= @MOZ_LIBNOTIFY_LIBS@
-MOZ_ENABLE_LIBNOTIFY	= @MOZ_ENABLE_LIBNOTIFY@
-
-MOZ_ALSA_LIBS           = @MOZ_ALSA_LIBS@
-MOZ_ALSA_CFLAGS         = @MOZ_ALSA_CFLAGS@
-
-GLIB_CFLAGS	= @GLIB_CFLAGS@
-GLIB_LIBS	= @GLIB_LIBS@
-GLIB_GMODULE_LIBS	= @GLIB_GMODULE_LIBS@
-
-MOZ_NATIVE_MAKEDEPEND	= @MOZ_NATIVE_MAKEDEPEND@
-
-CL_INCLUDES_PREFIX = @CL_INCLUDES_PREFIX@
-
-MOZ_AUTO_DEPS	= @MOZ_AUTO_DEPS@
-COMPILER_DEPEND = @COMPILER_DEPEND@
-MDDEPDIR        := @MDDEPDIR@
-CC_WRAPPER = @CC_WRAPPER@
-CXX_WRAPPER = @CXX_WRAPPER@
-
-MOZ_DEMANGLE_SYMBOLS = @MOZ_DEMANGLE_SYMBOLS@
-
-OS_TARGET=@OS_TARGET@
-OS_ARCH=@OS_ARCH@
-OS_RELEASE=@OS_RELEASE@
-OS_TEST=@OS_TEST@
-CPU_ARCH=@CPU_ARCH@
-INTEL_ARCHITECTURE=@INTEL_ARCHITECTURE@
-
-# For Solaris build
-SOLARIS_SUNPRO_CC = @SOLARIS_SUNPRO_CC@
-SOLARIS_SUNPRO_CXX = @SOLARIS_SUNPRO_CXX@
-
-# For AIX build
-AIX_OBJMODEL = @AIX_OBJMODEL@
-
-# For OS/2 build
-MOZ_OS2_TOOLS = @MOZ_OS2_TOOLS@
-MOZ_OS2_HIGH_MEMORY = @MOZ_OS2_HIGH_MEMORY@
-
-MOZ_PSM=@MOZ_PSM@
-
-MOZILLA_OFFICIAL = @MOZILLA_OFFICIAL@
-
-# Win32 options
-MOZ_BROWSE_INFO	= @MOZ_BROWSE_INFO@
-MOZ_TOOLS_DIR	= @MOZ_TOOLS_DIR@
-MSMANIFEST_TOOL = @MSMANIFEST_TOOL@
-WIN32_REDIST_DIR = @WIN32_REDIST_DIR@
-MOZ_GLUE_LDFLAGS = @MOZ_GLUE_LDFLAGS@
-MOZ_GLUE_PROGRAM_LDFLAGS = @MOZ_GLUE_PROGRAM_LDFLAGS@
-WIN32_CRT_LIBS = @WIN32_CRT_LIBS@
-
-# This is used to pass jemalloc flags to NSS
-DLLFLAGS = @DLLFLAGS@
-
-# Codesighs tools option, enables win32 mapfiles.
-MOZ_MAPINFO	= @MOZ_MAPINFO@
-
-MOZ_PHOENIX	= @MOZ_PHOENIX@
-MOZ_XULRUNNER	= @MOZ_XULRUNNER@
-
-MOZ_DISTRIBUTION_ID = @MOZ_DISTRIBUTION_ID@
-
-MOZ_PLATFORM_MAEMO = @MOZ_PLATFORM_MAEMO@
-MOZ_PLATFORM_MAEMO_CFLAGS	= @MOZ_PLATFORM_MAEMO_CFLAGS@
-MOZ_PLATFORM_MAEMO_LIBS 	= @MOZ_PLATFORM_MAEMO_LIBS@
-MOZ_MAEMO_LIBLOCATION 	= @MOZ_MAEMO_LIBLOCATION@
-
-MOZ_ENABLE_LIBCONIC = @MOZ_ENABLE_LIBCONIC@
-LIBCONIC_CFLAGS     = @LIBCONIC_CFLAGS@
-LIBCONIC_LIBS       = @LIBCONIC_LIBS@
-
-GSTREAMER_CFLAGS = @GSTREAMER_CFLAGS@
-GSTREAMER_LIBS   = @GSTREAMER_LIBS@
-
-MACOS_SDK_DIR	= @MACOS_SDK_DIR@
-NEXT_ROOT	= @NEXT_ROOT@
-GCC_VERSION	= @GCC_VERSION@
-UNIVERSAL_BINARY= @UNIVERSAL_BINARY@
-MOZ_CAN_RUN_PROGRAMS = @MOZ_CAN_RUN_PROGRAMS@
-HAVE_DTRACE= @HAVE_DTRACE@
-
-VISIBILITY_FLAGS = @VISIBILITY_FLAGS@
-WRAP_SYSTEM_INCLUDES = @WRAP_SYSTEM_INCLUDES@
-
-HAVE_ARM_SIMD = @HAVE_ARM_SIMD@
-HAVE_ARM_NEON = @HAVE_ARM_NEON@
-HAVE_GCC_ALIGN_ARG_POINTER = @HAVE_GCC_ALIGN_ARG_POINTER@
-HAVE_COMPILER_FLAG_MSSSE3 = @HAVE_COMPILER_FLAG_MSSSE3@
-
-MOZ_THEME_FASTSTRIPE = @MOZ_THEME_FASTSTRIPE@
-
-MOZ_SERVICES_AITC = @MOZ_SERVICES_AITC@
-MOZ_SERVICES_NOTIFICATIONS = @MOZ_SERVICES_NOTIFICATIONS@
-MOZ_SERVICES_SYNC = @MOZ_SERVICES_SYNC@
-
-MOZ_WEBAPP_RUNTIME = @MOZ_WEBAPP_RUNTIME@
-
-MOZ_OFFICIAL_BRANDING = @MOZ_OFFICIAL_BRANDING@
-
-HAVE_CLOCK_MONOTONIC = @HAVE_CLOCK_MONOTONIC@
-REALTIME_LIBS = @REALTIME_LIBS@
-
-MOZ_APP_COMPONENT_LIBS = @MOZ_APP_COMPONENT_LIBS@
-MOZ_APP_EXTRA_LIBS = @MOZ_APP_EXTRA_LIBS@
-
-ANDROID_NDK       = @ANDROID_NDK@
-ANDROID_TOOLCHAIN = @ANDROID_TOOLCHAIN@
-ANDROID_PLATFORM  = @ANDROID_PLATFORM@
-ANDROID_SDK       = @ANDROID_SDK@
-ANDROID_PLATFORM_TOOLS = @ANDROID_PLATFORM_TOOLS@
-ANDROID_VERSION   = @ANDROID_VERSION@
-ANDROID_SOURCE    = @ANDROID_SOURCE@
-STLPORT_SOURCES   = @STLPORT_SOURCES@
-
-ANDROID_PACKAGE_NAME = @ANDROID_PACKAGE_NAME@
-
-JS_SHARED_LIBRARY = @JS_SHARED_LIBRARY@
-
-MOZ_INSTRUMENT_EVENT_LOOP = @MOZ_INSTRUMENT_EVENT_LOOP@
-
-MOZ_SYSTEM_PLY = @MOZ_SYSTEM_PLY@
-
-MOZ_PACKAGE_JSSHELL = @MOZ_PACKAGE_JSSHELL@
-
-MOZ_LINKER_EXTRACT = @MOZ_LINKER_EXTRACT@
-
-MOZ_PER_WINDOW_PRIVATE_BROWSING = @MOZ_PER_WINDOW_PRIVATE_BROWSING@
-
+@ALLSUBSTS@
 include $(topsrcdir)/config/baseconfig.mk
--- a/js/src/build/ConfigStatus.py
+++ b/js/src/build/ConfigStatus.py
@@ -94,53 +94,58 @@ def shell_escape(s):
     '''
     return re.sub('''([ \t`#$^&*(){}\\|;'"<>?\[\]])''', r'\\\1', str(s)).replace('$', '$$')
 
 class ConfigEnvironment(object):
     '''A ConfigEnvironment is defined by a source directory and a build
     directory. It preprocesses files from the source directory and stores
     the result in the object directory.
 
-     There are two types of files: config files and config headers,
-     each treated through a different member function.
+    There are two types of files: config files and config headers,
+    each treated through a different member function.
 
-     Creating a ConfigEnvironment requires a few arguments:
-       - topsrcdir and topobjdir are, respectively, the top source and
-         the top object directory.
-       - defines is a list of (name, value) tuples. In autoconf, these are
-         set with AC_DEFINE and AC_DEFINE_UNQUOTED
-       - non_global_defines are a list of names appearing in defines above
-         that are not meant to be exported in ACDEFINES and ALLDEFINES (see
-         below)
-       - substs is a list of (name, value) tuples. In autoconf, these are
-         set with AC_SUBST.
+    Creating a ConfigEnvironment requires a few arguments:
+      - topsrcdir and topobjdir are, respectively, the top source and
+        the top object directory.
+      - defines is a list of (name, value) tuples. In autoconf, these are
+        set with AC_DEFINE and AC_DEFINE_UNQUOTED
+      - non_global_defines are a list of names appearing in defines above
+        that are not meant to be exported in ACDEFINES and ALLDEFINES (see
+        below)
+      - substs is a list of (name, value) tuples. In autoconf, these are
+        set with AC_SUBST.
 
-     ConfigEnvironment automatically defines two additional substs variables
-     from all the defines not appearing in non_global_defines:
-       - ACDEFINES contains the defines in the form -DNAME=VALUE, for use on
-         preprocessor command lines. The order in which defines were given
-         when creating the ConfigEnvironment is preserved.
-       - ALLDEFINES contains the defines in the form #define NAME VALUE, in
-         sorted order, for use in config files, for an automatic listing of
-         defines.
+    ConfigEnvironment automatically defines two additional substs variables
+    from all the defines not appearing in non_global_defines:
+      - ACDEFINES contains the defines in the form -DNAME=VALUE, for use on
+        preprocessor command lines. The order in which defines were given
+        when creating the ConfigEnvironment is preserved.
+      - ALLDEFINES contains the defines in the form #define NAME VALUE, in
+        sorted order, for use in config files, for an automatic listing of
+        defines.
+    and another additional subst variable from all the other substs:
+      - ALLSUBSTS contains the substs in the form NAME = VALUE, in sorted
+        order, for use in autoconf.mk. It includes ACDEFINES, but doesn't
+        include ALLDEFINES.
 
     ConfigEnvironment expects a "top_srcdir" subst to be set with the top
     source directory, in msys format on windows. It is used to derive a
     "srcdir" subst when treating config files. It can either be an absolute
     path or a path relative to the topobjdir.
     '''
 
     def __init__(self, topobjdir = '.', topsrcdir = '.',
                  defines = [], non_global_defines = [], substs = []):
         self.defines = dict(defines)
         self.substs = dict(substs)
         self.topsrcdir = topsrcdir
         self.topobjdir = topobjdir
         global_defines = [name for name, value in defines if not name in non_global_defines]
         self.substs['ACDEFINES'] = ' '.join(["-D%s=%s" % (name, shell_escape(self.defines[name])) for name in global_defines])
+        self.substs['ALLSUBSTS'] = '\n'.join(sorted(["%s = %s" % (name, self.substs[name]) for name in self.substs]))
         self.substs['ALLDEFINES'] = '\n'.join(sorted(["#define %s %s" % (name, self.defines[name]) for name in global_defines]))
 
     def get_relative_srcdir(self, file):
         '''Returns the relative source directory for the given file, always
         using / as a path separator.
         '''
         assert(isinstance(file, basestring))
         dir = posixpath.dirname(relpath(file, self.topobjdir).replace(os.sep, '/'))
--- a/js/src/config/autoconf.mk.in
+++ b/js/src/config/autoconf.mk.in
@@ -1,285 +1,2 @@
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# A netscape style .mk file for autoconf builds
-
-target          = @target@
-ac_configure_args = @ac_configure_args@
-MOZILLA_VERSION = @MOZILLA_VERSION@
-
-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@
-libdir		= @libdir@
-datadir		= @datadir@
-mandir		= @mandir@
-
-TOP_DIST	= @TOP_DIST@
-
-MOZ_JS_LIBS		   = @MOZ_JS_LIBS@
-
-MOZ_SYNC_BUILD_FILES = @MOZ_SYNC_BUILD_FILES@
-
-MOZ_DEBUG	= @MOZ_DEBUG@
-MOZ_DEBUG_SYMBOLS = @MOZ_DEBUG_SYMBOLS@
-MOZ_DEBUG_ENABLE_DEFS		= @MOZ_DEBUG_ENABLE_DEFS@
-MOZ_DEBUG_DISABLE_DEFS	= @MOZ_DEBUG_DISABLE_DEFS@
-MOZ_DEBUG_FLAGS	= @MOZ_DEBUG_FLAGS@
-MOZ_DEBUG_LDFLAGS=@MOZ_DEBUG_LDFLAGS@
-MOZ_MEMORY      = @MOZ_MEMORY@
-MOZ_PROFILING   = @MOZ_PROFILING@
-MOZ_JPROF       = @MOZ_JPROF@
-MOZ_SHARK       = @MOZ_SHARK@
-MOZ_VALGRIND    = @MOZ_VALGRIND@
-MOZ_CALLGRIND   = @MOZ_CALLGRIND@
-MOZ_VTUNE       = @MOZ_VTUNE@
-MOZ_ETW       = @MOZ_ETW@
-JS_HAS_CTYPES = @JS_HAS_CTYPES@
-DEHYDRA_PATH    = @DEHYDRA_PATH@
-
-MOZ_USING_CCACHE = @MOZ_USING_CCACHE@
-CLANG_CXX = @CLANG_CXX@
-NS_TRACE_MALLOC = @NS_TRACE_MALLOC@
-INCREMENTAL_LINKER = @INCREMENTAL_LINKER@
-MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@
-ENABLE_TESTS	= @ENABLE_TESTS@
-
-# 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@
-
-MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS = @MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS@
-MOZ_COMPONENT_NSPR_LIBS=@MOZ_COMPONENT_NSPR_LIBS@
-
-MOZ_FIX_LINK_PATHS=@MOZ_FIX_LINK_PATHS@
-
-ENABLE_STRIP	= @ENABLE_STRIP@
-PKG_SKIP_STRIP	= @PKG_SKIP_STRIP@
-
-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_NATIVE_NSPR = @MOZ_NATIVE_NSPR@
-
-CROSS_COMPILE   = @CROSS_COMPILE@
-
-OS_CPPFLAGS	= @OS_CPPFLAGS@
-OS_CFLAGS	= @OS_CFLAGS@
-OS_CXXFLAGS	= @OS_CXXFLAGS@
-OS_LDFLAGS	= @OS_LDFLAGS@
-
-OS_COMPILE_CFLAGS = @OS_COMPILE_CFLAGS@
-OS_COMPILE_CXXFLAGS = @OS_COMPILE_CXXFLAGS@
-
-OS_LIBS		= @OS_LIBS@
-ACDEFINES	= @ACDEFINES@
-
-WARNINGS_AS_ERRORS = @WARNINGS_AS_ERRORS@
-FAIL_ON_WARNINGS = @FAIL_ON_WARNINGS@
-
-MOZ_OPTIMIZE	= @MOZ_OPTIMIZE@
-MOZ_FRAMEPTR_FLAGS = @MOZ_FRAMEPTR_FLAGS@
-MOZ_OPTIMIZE_FLAGS = @MOZ_OPTIMIZE_FLAGS@
-MOZ_PGO_OPTIMIZE_FLAGS = @MOZ_PGO_OPTIMIZE_FLAGS@
-MOZ_OPTIMIZE_LDFLAGS = @MOZ_OPTIMIZE_LDFLAGS@
-MOZ_OPTIMIZE_SIZE_TWEAK = @MOZ_OPTIMIZE_SIZE_TWEAK@
-
-PROFILE_GEN_CFLAGS = @PROFILE_GEN_CFLAGS@
-PROFILE_GEN_LDFLAGS = @PROFILE_GEN_LDFLAGS@
-PROFILE_USE_CFLAGS = @PROFILE_USE_CFLAGS@
-PROFILE_USE_LDFLAGS = @PROFILE_USE_LDFLAGS@
-
-WIN_TOP_SRC	= @WIN_TOP_SRC@
-AR		= @AR@
-AR_FLAGS	= @AR_FLAGS@
-AR_EXTRACT	= @AR_EXTRACT@
-AR_LIST		= @AR_LIST@
-AR_DELETE	= @AR_DELETE@
-AS		= @AS@
-ASFLAGS		= @ASFLAGS@
-AS_DASH_C_FLAG	= @AS_DASH_C_FLAG@
-LD		= @LD@
-RC		= @RC@
-RCFLAGS		= @RCFLAGS@
-MC		= @MC@
-WINDRES		= @WINDRES@
-IMPLIB		= @IMPLIB@
-FILTER		= @FILTER@
-BIN_FLAGS	= @BIN_FLAGS@
-_MSC_VER	= @_MSC_VER@
-
-DLL_PREFIX	= @DLL_PREFIX@
-LIB_PREFIX	= @LIB_PREFIX@
-OBJ_SUFFIX	= @OBJ_SUFFIX@
-LIB_SUFFIX	= @LIB_SUFFIX@
-DLL_SUFFIX	= @DLL_SUFFIX@
-BIN_SUFFIX	= @BIN_SUFFIX@
-ASM_SUFFIX	= @ASM_SUFFIX@
-IMPORT_LIB_SUFFIX = @IMPORT_LIB_SUFFIX@
-LIBS_DESC_SUFFIX = @LIBS_DESC_SUFFIX@
-USE_N32		= @USE_N32@
-HAVE_64BIT_OS	= @HAVE_64BIT_OS@
-
-CC		    = @CC@
-CXX		    = @CXX@
-CPP       = @CPP@
-
-CC_VERSION	= @CC_VERSION@
-CXX_VERSION	= @CXX_VERSION@
-
-GNU_AS		= @GNU_AS@
-GNU_LD		= @GNU_LD@
-GNU_CC		= @GNU_CC@
-GNU_CXX		= @GNU_CXX@
-INTEL_CC	= @INTEL_CC@
-INTEL_CXX	= @INTEL_CXX@
-
-HOST_CC		= @HOST_CC@
-HOST_CXX	= @HOST_CXX@
-HOST_CFLAGS	= @HOST_CFLAGS@
-HOST_CXXFLAGS	= @HOST_CXXFLAGS@
-HOST_LDFLAGS	= @HOST_LDFLAGS@
-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_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@
-TARGET_OS	= @TARGET_OS@
-TARGET_MD_ARCH	= @TARGET_MD_ARCH@
-TARGET_XPCOM_ABI = @TARGET_XPCOM_ABI@
-
-AUTOCONF	= @AUTOCONF@
-PERL		= @PERL@
-PYTHON		= @PYTHON@
-RANLIB		= @RANLIB@
-XARGS		= @XARGS@
-STRIP		= @STRIP@
-DOXYGEN		= @DOXYGEN@
-PBBUILD_BIN	= @PBBUILD_BIN@
-SDP		= @SDP@
-NSINSTALL_BIN	= @NSINSTALL_BIN@
-
-NSPR_CONFIG	= @NSPR_CONFIG@
-NSPR_CFLAGS	= @NSPR_CFLAGS@
-NSPR_LIBS	= @NSPR_LIBS@
-
-MOZ_NATIVE_ZLIB = @MOZ_NATIVE_ZLIB@
-MOZ_ZLIB_LIBS   = @MOZ_ZLIB_LIBS@
-MOZ_ZLIB_CFLAGS = @MOZ_ZLIB_CFLAGS@
-
-MOZ_NATIVE_FFI	= @MOZ_NATIVE_FFI@
-MOZ_FFI_LIBS	= @MOZ_FFI_LIBS@
-MOZ_FFI_CFLAGS	= @MOZ_FFI_CFLAGS@
-
-USE_DEPENDENT_LIBS = @USE_DEPENDENT_LIBS@
-
-JS_NATIVE_EDITLINE = @JS_NATIVE_EDITLINE@
-JS_DISABLE_SHELL   = @JS_DISABLE_SHELL@
-EDITLINE_LIBS      = @EDITLINE_LIBS@
-
-# 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_LDFLAGS            = @WRAP_LDFLAGS@
-DSO_CFLAGS              = @DSO_CFLAGS@
-DSO_PIC_CFLAGS          = @DSO_PIC_CFLAGS@
-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@
-
-MOZ_NATIVE_MAKEDEPEND	= @MOZ_NATIVE_MAKEDEPEND@
-
-CL_INCLUDES_PREFIX = @CL_INCLUDES_PREFIX@
-
-MOZ_AUTO_DEPS	= @MOZ_AUTO_DEPS@
-COMPILER_DEPEND = @COMPILER_DEPEND@
-MDDEPDIR        := @MDDEPDIR@
-CC_WRAPPER = @CC_WRAPPER@
-CXX_WRAPPER = @CXX_WRAPPER@
-
-MOZ_DEMANGLE_SYMBOLS = @MOZ_DEMANGLE_SYMBOLS@
-
-OS_TARGET=@OS_TARGET@
-OS_ARCH=@OS_ARCH@
-OS_RELEASE=@OS_RELEASE@
-OS_TEST=@OS_TEST@
-CPU_ARCH=@CPU_ARCH@
-INTEL_ARCHITECTURE=@INTEL_ARCHITECTURE@
-
-# For Solaris build
-SOLARIS_SUNPRO_CC = @SOLARIS_SUNPRO_CC@
-SOLARIS_SUNPRO_CXX = @SOLARIS_SUNPRO_CXX@
-
-# For AIX build
-AIX_OBJMODEL = @AIX_OBJMODEL@
-
-# For OS/2 build
-MOZ_OS2_TOOLS = @MOZ_OS2_TOOLS@
-MOZ_OS2_HIGH_MEMORY = @MOZ_OS2_HIGH_MEMORY@
-
-MOZILLA_OFFICIAL = @MOZILLA_OFFICIAL@
-
-# Win32 options
-MOZ_BROWSE_INFO	= @MOZ_BROWSE_INFO@
-MOZ_TOOLS_DIR	= @MOZ_TOOLS_DIR@
-MSMANIFEST_TOOL = @MSMANIFEST_TOOL@
-MOZ_GLUE_LDFLAGS = @MOZ_GLUE_LDFLAGS@
-MOZ_GLUE_PROGRAM_LDFLAGS = @MOZ_GLUE_PROGRAM_LDFLAGS@
-
-# Codesighs tools option, enables win32 mapfiles.
-MOZ_MAPINFO	= @MOZ_MAPINFO@
-
-QEMU_CANT_RUN_JS_SHELL = @QEMU_CANT_RUN_JS_SHELL@
-
-MACOS_SDK_DIR	= @MACOS_SDK_DIR@
-NEXT_ROOT	= @NEXT_ROOT@
-GCC_VERSION	= @GCC_VERSION@
-UNIVERSAL_BINARY= @UNIVERSAL_BINARY@
-MOZ_CAN_RUN_PROGRAMS = @MOZ_CAN_RUN_PROGRAMS@
-HAVE_DTRACE= @HAVE_DTRACE@
-
-VISIBILITY_FLAGS = @VISIBILITY_FLAGS@
-WRAP_SYSTEM_INCLUDES = @WRAP_SYSTEM_INCLUDES@
-
-ENABLE_METHODJIT = @ENABLE_METHODJIT@
-ENABLE_METHODJIT_SPEW = @ENABLE_METHODJIT_SPEW@
-HAVE_ARM_SIMD= @HAVE_ARM_SIMD@
-
-JS_SHARED_LIBRARY = @JS_SHARED_LIBRARY@
-HAVE_LINUX_PERF_EVENT_H = @HAVE_LINUX_PERF_EVENT_H@
-
-MOZ_METRO	= @MOZ_METRO@
-
-MOZ_ASAN = @MOZ_ASAN@
-
+@ALLSUBSTS@
 include $(topsrcdir)/config/baseconfig.mk