Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1251210 - In configure.py, take AUTOCONF from the environment, if…
Browse files Browse the repository at this point in the history
… 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).
  • Loading branch information
glandium committed Feb 25, 2016
1 parent d1551be commit 87cf98f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
21 changes: 17 additions & 4 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@
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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
1 change: 0 additions & 1 deletion js/src/old-configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 .])
Expand Down
1 change: 0 additions & 1 deletion old-configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 87cf98f

Please sign in to comment.