Bug 1256622 - Allow to build spidermonkey from the top-level configure draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 16 Mar 2016 06:49:37 +0900
changeset 340745 071458a941df5a514b458dcdcf0af165a3d9432b
parent 340735 aa1a857be3802cdaf28215857c85606827d4271e
child 516262 c0770c825c6005a7c656587a87732105245b57f9
push id13052
push userbmo:mh+mozilla@glandium.org
push dateTue, 15 Mar 2016 22:53:09 +0000
bugs1256622
milestone48.0a1
Bug 1256622 - Allow to build spidermonkey from the top-level configure
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',