From b82e33004b1f4ce87be73f7f78179a5556bac132 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Fri, 26 Feb 2016 02:08:29 +0900 Subject: [PATCH] Bug 1251210 - In configure.py, take AUTOCONF from the environment, if set there. r=ted At the same time, remove the (useless and wrong) check for AUTOCONF in old-configure.in (wrong because it very likely is picking autoconf > 2.5). --HG-- extra : rebase_source : 4a17c9d92c9561ef221b1a300e0e6d48ca56862f --- configure.py | 21 +++++++++++++++++---- js/src/old-configure.in | 1 - old-configure.in | 1 - 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/configure.py b/configure.py index 415c17fca648..5be7966b8023 100644 --- a/configure.py +++ b/configure.py @@ -24,7 +24,15 @@ if sys.platform == 'win32': shell = shell + '.exe' +def is_absolute_or_relative(path): + if os.altsep and os.altsep in path: + return True + return os.sep in path + + def find_program(file): + if is_absolute_or_relative(file): + return os.path.abspath(file) if os.path.isfile(file) else None try: return which(file) except WhichError: @@ -45,10 +53,12 @@ def autoconf_refresh(configure): else: return - for ac in ('autoconf-2.13', 'autoconf2.13', 'autoconf213'): - autoconf = find_program(ac) - if autoconf: - break + for ac in (os.environ.get('AUTOCONF'), 'autoconf-2.13', 'autoconf2.13', + 'autoconf213'): + if ac: + autoconf = find_program(ac) + if autoconf: + break else: fink = find_program('fink') if fink: @@ -58,6 +68,9 @@ def autoconf_refresh(configure): if not autoconf: raise RuntimeError('Could not find autoconf 2.13') + # Add or adjust AUTOCONF for subprocesses, especially the js/src configure + os.environ['AUTOCONF'] = autoconf + print('Refreshing %s' % configure, file=sys.stderr) with open(configure, 'wb') as fh: diff --git a/js/src/old-configure.in b/js/src/old-configure.in index 8e5453b56abd..336f6a2e9b3c 100644 --- a/js/src/old-configure.in +++ b/js/src/old-configure.in @@ -570,7 +570,6 @@ fi AC_SUBST(NSINSTALL_BIN) MOZ_PATH_PROG(DOXYGEN, doxygen, :) -MOZ_PATH_PROG(AUTOCONF, autoconf, :) MOZ_PATH_PROG(XARGS, xargs) if test -z "$XARGS" -o "$XARGS" = ":"; then AC_MSG_ERROR([xargs not found in \$PATH .]) diff --git a/old-configure.in b/old-configure.in index a842f4fbd3d0..f21e0810d2c3 100644 --- a/old-configure.in +++ b/old-configure.in @@ -782,7 +782,6 @@ fi AC_SUBST(NSINSTALL_BIN) MOZ_PATH_PROG(DOXYGEN, doxygen, :) -MOZ_PATH_PROG(AUTOCONF, autoconf, :) MOZ_PATH_PROGS(UNZIP, unzip) if test -z "$UNZIP" -o "$UNZIP" = ":"; then AC_MSG_ERROR([unzip not found in \$PATH])