Index: third_party/binutils/download.py |
=================================================================== |
--- third_party/binutils/download.py (revision 266327) |
+++ third_party/binutils/download.py (working copy) |
@@ -47,17 +47,14 @@ |
return subprocess.check_output(['python', DETECT_HOST_ARCH]).strip() |
-def main(args): |
- if not sys.platform.startswith('linux'): |
- return 0 |
- |
- archdir = os.path.join(BINUTILS_DIR, 'Linux_' + GetArch()) |
+def FetchAndExtract(arch): |
+ archdir = os.path.join(BINUTILS_DIR, 'Linux_' + arch) |
tarball = os.path.join(archdir, BINUTILS_FILE) |
outdir = os.path.join(archdir, BINUTILS_OUT) |
sha1file = tarball + '.sha1' |
if not os.path.exists(sha1file): |
- print "WARNING: No binutils found for your architecture (%s)!" % GetArch() |
+ print "WARNING: No binutils found for your architecture (%s)!" % arch |
return 0 |
checksum = ReadFile(sha1file) |
@@ -96,5 +93,22 @@ |
return 0 |
+def main(args): |
+ if not sys.platform.startswith('linux'): |
+ return 0 |
+ |
+ arch = GetArch() |
mithro-old
2014/04/28 19:01:21
Maybe it should be;
-----------------------------
Lei Zhang
2014/04/28 19:13:22
GetArch() hasn't changed, for a machine with a 64-
|
+ if arch == 'x64': |
+ return FetchAndExtract(arch) |
+ if arch == 'ia32': |
+ ret = FetchAndExtract(arch) |
+ if ret != 0: |
+ return ret |
+ # Fetch the x64 toolchain as well for official bots with 64-bit kernels. |
+ return FetchAndExtract('x64') |
mithro-old
2014/04/28 19:01:21
I think this script could detect the GYP_DEFINEs s
Lei Zhang
2014/04/28 19:13:22
It's simpler to just install both toolchains. Not
|
+ print "Host architecture %s is not supported." % arch |
+ return 1 |
+ |
+ |
if __name__ == '__main__': |
sys.exit(main(sys.argv)) |