diff --git a/configure.py b/configure.py index 415c17fca64..5be7966b802 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 8e5453b56ab..336f6a2e9b3 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 a842f4fbd3d..f21e0810d2c 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])