From db3b7db18f99dbed7066b70b1f792d27c965bbb3 Mon Sep 17 00:00:00 2001 From: Tooru Fujisawa Date: Fri, 10 Mar 2017 13:21:35 +0900 Subject: [PATCH] Bug 1342378 - Update js/src/configure when input files are newer than it. r=sfink --- js/src/devtools/automation/autospider.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/js/src/devtools/automation/autospider.py b/js/src/devtools/automation/autospider.py index 4a7741ee7f38..7bdcef60952e 100755 --- a/js/src/devtools/automation/autospider.py +++ b/js/src/devtools/automation/autospider.py @@ -284,13 +284,27 @@ for k, v in variant.get('env', {}).items(): OUTDIR=OUTDIR, ) +def need_updating_configure(configure): + if not os.path.exists(configure): + return True + + dep_files = [ + os.path.join(DIR.js_src, 'configure.in'), + os.path.join(DIR.js_src, 'old-configure.in'), + ] + for file in dep_files: + if os.path.getmtime(file) > os.path.getmtime(configure): + return True + + return False + if not args.nobuild: CONFIGURE_ARGS += ' --enable-nspr-build' CONFIGURE_ARGS += ' --prefix={OBJDIR}/dist'.format(OBJDIR=POBJDIR) # Generate a configure script from configure.in. configure = os.path.join(DIR.js_src, 'configure') - if not os.path.exists(configure): + if need_updating_configure(configure): shutil.copyfile(configure + ".in", configure) os.chmod(configure, 0755)