| OLD | NEW |
| (Empty) |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 # This script locates the Android compilers given the bin directory of the | |
| 6 # android toolchain. | |
| 7 | |
| 8 import glob | |
| 9 import subprocess | |
| 10 import sys | |
| 11 | |
| 12 if len(sys.argv) != 2: | |
| 13 print "Error: expecting one argument of the android toolchain dir." | |
| 14 sys.exit(1) | |
| 15 | |
| 16 # TODO(brettw) this logic seems like a bad idea. It was copied from | |
| 17 # common.gypi. It seems like the toolchain should just know the name given the | |
| 18 # current platform rather than having to rely on glob. | |
| 19 android_toolchain = sys.argv[1] | |
| 20 cc = glob.glob(android_toolchain + "/*-gcc") | |
| 21 cxx = glob.glob(android_toolchain + "/*-g++") | |
| 22 if len(cc) != 1 or len(cxx) != 1: | |
| 23 print "Either none or more than one matching compiler." | |
| 24 sys.exit(1) | |
| 25 | |
| 26 # Get the host compilers from the current path. | |
| 27 which_gcc = subprocess.check_output(["which gcc"], shell=True).strip() | |
| 28 which_gxx = subprocess.check_output(["which g++"], shell=True).strip() | |
| 29 | |
| 30 print ('["' + cc[0] + '","' + cxx[0] + '","' + which_gcc + '","' + | |
| 31 which_gxx + '"]') | |
| OLD | NEW |