Bug 1256622 - Allow to build spidermonkey from the top-level configure. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 16 Mar 2016 06:49:37 +0900
changeset 340838 94f3363ab6dd66851b7b66db2468cf9186218aff
parent 340837 24a4df5f63a08c142a2f2b93f20c3dde538d2b1d
child 340839 1e381e3428d1b46233bb649d572ceddcc7cc0f91
push id13075
push userbmo:mh+mozilla@glandium.org
push dateWed, 16 Mar 2016 01:22:38 +0000
reviewersgps
bugs1256622
milestone48.0a1
Bug 1256622 - Allow to build spidermonkey from the top-level configure. r=gps
build/moz.configure/old.configure
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -76,33 +76,38 @@ def check_mozconfig_variables():
                 error(
                     'You need to add `%s` to the `wanted_mozconfig_variables` '
                     'list in build/moz.configure/init.configure.' % option.env)
 
 check_mozconfig_variables()
 
 
 @depends('OLD_CONFIGURE', mozconfig, autoconf, check_build_environment, shell,
-         old_configure_assignments)
+         old_configure_assignments, build_project)
 @advanced
 def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell,
-                      old_configure_assignments):
+                      old_configure_assignments, build_project):
     import glob
     import itertools
     import subprocess
     # Import getmtime without overwriting the sandbox os.path.
     from os.path import getmtime
 
     from mozbuild.shellutil import quote
 
     # os.path.abspath in the sandbox will ensure forward slashes on Windows,
     # which is actually necessary because this path actually ends up literally
     # as $0, and backslashes there breaks autoconf's detection of the source
     # directory.
     old_configure = os.path.abspath(old_configure[0])
+    if build_project == 'js':
+        old_configure_dir = os.path.dirname(old_configure)
+        if not old_configure_dir.endswith('/js/src'):
+            old_configure = os.path.join(old_configure_dir, 'js', 'src',
+                                         os.path.basename(old_configure))
 
     refresh = True
     if os.path.exists(old_configure):
         mtime = getmtime(old_configure)
         aclocal = os.path.join(build_env['TOPSRCDIR'], 'build', 'autoconf',
                                '*.m4')
         for input in itertools.chain(
             (old_configure + '.in',